Printing Ant target execution time

Viewed 13384

I want to print the execution time taken for each individual Ant target and its dependent targets.

<target name="target1" depends="target2, target3"> 
....
</target>

When run should show following output

Target 2 - x seconds
Target 3 - y seconds
Target 1 - z seconds

Any suggestions on how to achieve this?

4 Answers

Use one of the listeners from Ant add-on task collections:

Or check their sources, and roll your own listener.

There is the TStamp task that you can use to demark your other tasks.

See here: http://ant.apache.org/manual/Tasks/tstamp.html

There is some extension/addon that will do it all for you without having to do this. Will scrabble around for it if no-one comes up with it first.

Related