Posts

Showing posts with the label Build

Antcall Based On A Condition

Answer : Something like this should work: <if> <isset property="some.property"/> <then> <antcall target="do.something"/> </then> </if> If then conditions require ant-contrib, but so does just about anything useful in ant. I know I'm really late to this but here is another way to do this if you are using an of ant-contrib where if doesn't support a nested antcall element (I am using antcontrib 1.02b which doesn't). <target name="TaskUnderRightCondition" if="some.property"> ... </target> You can further expand this to check to see if some.property should be set just before this target is called by using depends becuase depends is executed before the if attribute is evaluated. Thus you could have this: <target name="TestSomeValue"> <condition property="some.property"> <equals arg1="${someval}" arg2=...