Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple depends in Ant task

Tags:

ant

depends

If I have three targets, one all, one compile and one jsps, how would I make all depend on the other two?

Would it be:

<target name="all" depends="compile,jsps"> 

...or would it be:

<target name="all" depends="compile","jsps"> 

Or maybe something even different?

I tried searching for example ant scripts to base it off of, but I couldn't find one with multiple depends.

like image 578
corsiKa Avatar asked May 22 '10 15:05

corsiKa


People also ask

What are ant depends?

The depends attribute can be included in the target tag to specify that this target requires another target to be executed prior to being executed itself. Multiple targets can be specified and separated with commas.

How do you list ant targets?

which you can then set as the default, so just typing ant will list the available targets. small suggestion. make "help" target as default. As a result running "ant" will invoke "help" target that will print all available targets.

What is the difference between target and task?

Online documentation and books say that target is a stage of the entire build process, while task is the smallest unti of work.


2 Answers

The former:

<target name="all" depends="compile,jsps"> 

This is documented in the Ant Manual.

like image 104
Brett Kail Avatar answered Oct 17 '22 14:10

Brett Kail


It's the top one.

Just use the echo tag if you want to quickly see for yourself

<target name="compile"><echo>compile</echo></target>  <target name="jsps"><echo>jsps</echo></target>  <target name="all" depends="compile,jsps"></target> 

You can also look at the antcall tag if you want more flexibility on ordering tasks

like image 38
laher Avatar answered Oct 17 '22 14:10

laher