How do I do this within my build file? Say I just want to <echo/>
the name?
views:
28answers:
1
+2
A:
There is no built-in property for the current executing target name. Some debate on this is here.
If you configure ant with log4j as a listener like this, the output will display each target start and end like below. Calling ant build
:
D:\apache-ant-1.8.0RC1\bin>ant -lib D:\log4j\log4j\1.2.13 -listener org.apache.tools.ant.listener.Log4jListener build
Buildfile: D:\apache-ant-1.8.0RC1\bin\build.xml
11:39:34 INFO Build started.
build:
11:39:34 INFO Target "build" started.
[echo] 100
11:39:34 INFO Updating property file: D:\abc.properties
[propertyfile] Updating property file: D:\abc.properties
11:39:35 INFO Target "build" finished.
BUILD SUCCESSFUL
Total time: 0 seconds
JoseK
2010-06-22 06:32:05
Thanks for the link to the discussion, it was helpful reading to gain a perspective. Unfortunately, I don't think a listener is what I'm after. I had assumed that since the project name and invoked targets were get-able, the current target would be as well, and that I was just missing a property somewhere.
Tom Tresansky
2010-06-22 16:29:12