Chapter 9. Tracing Target Execution

Antelope is put into 'tracing mode' when the "Trace" button is clicked. When in tracing mode, the background of the button panel will be blue. When in tracing mode, clicking the target buttons will not actually execute the target. Instead, the output will show the specific order of execution of tasks performed by the target and targets that the selected target depends on. This is useful for figuring out exactly what a specific target does and the order of operations. To turn off tracing mode, click the "Trace" button a second time.

In general, targets are not parsed below task level, that is, nested task attributes are not displayed. However, two tasks are treated specially as they have a direct bearing on how a target executes. These two tasks are ant and antcall. If the trace encounters the ant task, the buildfile and target attributes will be displayed, the build file loaded, and the target traced in that build file. If the trace encounters an antcall task, the target attribute will be parsed and the target will be traced.

Here is a sample trace:


Tracing target: deploy-all
Legend: <target>[task]

<deploy-all>
<clean>[delete]
<deploy-all>[javac deprecation=on debug=on destdir=build srcdir=src
 includes=ise/ excludes=ise/antelope/plugin/ includejavaruntime=yes source=1.4]
<deploy-all>[copy todir=build]
<deploy-all>[jar jarfile=/usr/local/java/antelope/Antelope]
</deploy-all>

Done tracing target: deploy-all

And a line by line explanation:

Table 9.1. Target Trace Example Explanation

Tracing target: deploy-allThe trace is going to trace the deploy-all target.
Legend: <target>[task]Targets shown with angle brackets, tasks with square brackets.
<deploy-all>The trace is starting on the deploy-all target.
<clean>[delete]The deploy-all target depends on the clean target, which performs a 'delete' task.
<deploy-all>[javac deprecation=on debug=on destdir=build srcdir=src includes=ise/ excludes=ise/antelope/plugin/ includejavaruntime=yes source=1.4]The deploy-all target executes a 'javac' task. The parameters for the task are shown.
<deploy-all>[copy todir=build]The deploy-all target executes a 'copy' tasks. Most likely, this tasks has nested includes and/or excludes, which are not shown in the trace.
<deploy-all>[jar jarfile=/usr/local/java/antelope/Antelope]The deploy-all target executes the 'jar' task.
</deploy-all>The trace has reached the end of the deploy-all target.
Done tracing target: deploy-allObviously, the trace is done.

So the 'deploy_all' target first causes the 'clean' target to execute a 'delete' task, then causes the 'compile' target to execute a 'javac' task, and finally causes the 'deploy' target to create a jar file.

Figure 9.1. Antelope in 'Trace' Mode

Antelope in 'Trace' Mode