I want to do something like the following
<target name="complex-conditional">
<if>
<exec command= "python some-python-script-that-returns-true-or-false-strings-to-stout.py/>
<then>
<echo message="I did sometheing" />
</then>
<else>
<echo message="I did something else" />
</else>
</if>
</target>
How do I evaluate the result of executing some script inside of an ant conditional?
The
<exec>task hasoutputproperty,errorpropertyandresultpropertyparameters that allow you to specify property names in which to store command output / errors / result code.You can then use one (or more) of them in your conditional statement(s):