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.
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.
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.
Online documentation and books say that target is a stage of the entire build process, while task is the smallest unti of work.
The former:
<target name="all" depends="compile,jsps">
This is documented in the Ant Manual.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With