ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Fetzer <>
Subject <target unless=...>
Date Wed, 15 May 2013 14:13:34 GMT
Hi!  I've found that my unless= is somewhat useless when using <antcall>.  Here's a
repro for what I'm trying to do:
<project name="test" default="testIt">
  <taskdef resource="net/sf/antcontrib/antlib.xml"/>
  <target name="testIt">
     <antcall target="test1" inheritall="true" />
     <antcall target="test2" inheritall="true" />
  <target name="test1">
    <property name="testit" value="true"/>
    <echo message="in test1 and value of testit is:  ${testit}"/>
  <target name="test2" unless="testit">
    <echo message="in test2"/>
    <echo message="value of testit is:  ${testit}"/>
And the results that I'm sure you anticipate as you understand how antcall works:
[me@myMachine]$ ant -f test.xml
Buildfile: test.xml
     [echo] in test1 and value of testit is:  true
     [echo] in test2
     [echo] value of testit is:  ${testit}
Total time: 0 seconds
My actual antcall is in a for loop using a list to call targets that start with the same word,
like so:
<for list="${build.apps} param="app">
      <antcall target="build@{app}"/>
Can anyone give me a better methodology for achieving the results I'm after?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message