How to put condition in exec in build.xml file?

How to put a condition in exec in the build.xml file called from Hudson?

I need to use arg only if something happened (I send some parameters), and I need an if task or condition to solve this problem.

+4
source share
1 answer

The Ant Contrib library has an if task, which looks like this:

 <if> <my condition goes here> <then> </then> </if> 

In raw Ant, you use a task condition that looks like this:

 <condition property="condition.to.set"> <my condition goes here> </condition> 

and then the conditional goal:

 <target name="mine" if="condition.to.set"> 

I prefer Ant Contrib as it is easier to read.

+2
source

Source: https://habr.com/ru/post/1438372/


All Articles