I built the following build file to narrow down a problem I'm having with
the If/Unless feature.
<project name="java standard library" default="echo" basedir=".">
<property name="bw.local.present" value="true"/>
<property name="bw.dev.present" value="false"/>
<target name="echoLocal" if="${bw.local.present}">
<echo>BW Local Present</echo>
</target>
<target name="echoDev" if="${bw.dev.present}">
<echo>BW Dev Present</echo>
</target>
<target name="echo" depends="echoLocal,echoDev"/>
</project>
I would expect the target 'echoLocal' to print out but not 'echoDev'. In
the following excerpt from a debug output, the properties seem to be set
correctly, but the "If" check still says that it is going to skip running
the target because the property is not set.
**************************************************
Project base dir set to: C:\IT\Dev\JavaLib
+Task: property
Setting project property: bw.local.present -> true
+Task: property
Setting project property: bw.dev.present -> false
+Target: echoLocal
+Task: echo
+Target: echoDev
+Task: echo
+Target: echo
Build sequence for target `echo' is [echoLocal, echoDev, echo]
Complete build sequence is [echoLocal, echoDev, echo]
echoLocal:
Skipped because property '${bw.local.present}' not set.
echoDev:
Skipped because property '${bw.dev.present}' not set.
echo:
BUILD SUCCESSFUL
Total time: 2 seconds
*************************************************
Thanks in advance for help and I've attached a copy of the full debug
output in case it's helpful.
(See attached file: out.txt)
Andy
****************************
Andrew Goodnough
Dana Commercial Credit
Programmer
(419) 891-2065
out.txt