if I have
<target name="A" depends="B,C"/>
is there a deterministic order of execution of targets B
and C
? Are they executed one after the other in the order of their appearance in the list, are they executed in parallel? Does C
wait for B
to finish?
To run the ant build file, open up command prompt and navigate to the folder, where the build. xml resides, and then type ant info. You could also type ant instead. Both will work,because info is the default target in the build file.
An Ant target is a sequence of tasks to be executed to perform a part (or whole) of the build process. Ant targets are defined by the user of Ant. Thus, what tasks an Ant target contains depends on what the user of Ant is trying to do in the build script.
Online documentation and books say that target is a stage of the entire build process, while task is the smallest unti of work.
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. <target name="one" depends="two, three">
They are executed one after the other. C will not start until B finishes.
Furthermore, the 'if' clause is not checked until after the 'depends' targets are executed.
It's in the order of appearance in the list. See https://ant.apache.org/manual/targets.html:
Ant tries to execute the targets in the depends attribute in the order they appear (from left to right)...
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