Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ant: order of execution of "depends" target?

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?

like image 791
akonsu Avatar asked Sep 08 '16 18:09

akonsu


People also ask

How do I run a specific target in Ant?

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.

What are Ant targets?

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.

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.

What does depends mean Ant?

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">


2 Answers

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.

like image 142
Brandon Hulsebusch Avatar answered Sep 20 '22 10:09

Brandon Hulsebusch


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)...

like image 40
M A Avatar answered Sep 21 '22 10:09

M A