I am calling a target by means of phingcall command. I want to pass back a status variable from the called target or at least change the existing value from the calling target. Goal: I want to branch in my main target controlling logic if the sub target fails which I indicate with a property. The code below does not work. Any idea how to make it work or an altertive approach for my goal?
Thanks, Juergen
<target name="main">
<echo>target a</echo>
<echo>${bOk}</echo>
<exec command="echo 1" outputProperty="bOk" />
<echo>bOk is 1: ${bOk}</echo>
<phingcall inheritRefs="true" target="sub">
</phingcall>
<echo>bOk should now be 0: ${bOk}</echo>
</target>
<target name="sub">
<echo>target b</echo>
<echo>bOk is 1: ${bOk}</echo>
<exec command="echo 0" outputProperty="bOk" />
<echo>bOk now is 0: ${bOk}</echo>
</target>
The problem here is that
<echo>bOk should now be 0: ${bOk}</echo>
echos
bOk should now be 0: 1
<rv sMode="set" bValue="${bOk}" />
and the getter:<rv sMode="get" outputProperty="bOk" />
– Sideslip