Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to specify logger for ant inside build.xml?

Tags:

ant

Is it possible specify Ant listener/logger inside build.xml, not on a command line?

like image 612
yegor256 Avatar asked Apr 19 '11 19:04

yegor256


People also ask

How do I run an Ant file in xml?

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.

Why profile logger is used in Ant?

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.

What is Basedir in build xml?

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.

Can you write a build xml?

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.


2 Answers

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

like image 144
Rebse Avatar answered Sep 26 '22 23:09

Rebse


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

like image 37
Nate Avatar answered Sep 26 '22 23:09

Nate