Is it possible specify Ant listener/logger inside build.xml
, not on a command line?
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.
ProfileLogger. This logger stores the time needed for executing a task, target and the whole build and prints these information. The output contains a timestamp when entering the build, target or task and a timestamp and the needed time when exiting.
The 'basedir' is the base directory from which any relative directories used within the Ant build file are referenced from. If this is omitted the parent directory of the build file will be used.
How do I write build. xml file? here is a sample build. xml you just need to know important element e.g. project ,target ,property and task and the order in which different target gets executed to start with basic build procedure.
Within the buildfile it's possible to make use of the ant api and create an internal task via scriptdef
.
i.e. implemented with groovy:
http://josefbetancourt.wordpress.com/2011/08/18/buildlistener-groovy-scriptdef/
http://octodecillion.com/blog/buildlistener-groovy-scriptdef/
It's also possible to adjust the loglevel inside the buildfile, see :
https://stackoverflow.com/a/5464009/130683
https://stackoverflow.com/a/5479606/130683
It's not in the build file, but you can set the ANT_ARGS env variable to specify the logger
http://wiki.apache.org/ant/TheElementsOfAntStyle
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