Within an ant build.xml, I want to influence a child process's verbose flag based on whether ant itself was run with verbose enabled. Is there a variable set to determine this? Or otherwise, can I parse the raw Ant command line somehow to check whether -v
is passed?
Asked
Active
Viewed 480 times
1

Reinderien
- 11,755
- 5
- 49
- 77
-
might this be of any use :: http://stackoverflow.com/questions/5232168/is-there-a-way-to-set-ant-verbose-inside-build-xml – emeraldjava Jun 02 '15 at 22:25
-
Unfortunately not. Instead of enabling verbose within Ant, I need to detect verbose within Ant - the opposite. – Reinderien Jun 03 '15 at 00:22
-
@Reinderien Was my answer correct? If you accept correct answers people will be motivated to help you in future – Oleg Pavliv Jun 05 '15 at 09:32
-
@OlegPavliv I'm aware. I haven't had the time to test it, but when I do I'll let you know. – Reinderien Jun 05 '15 at 17:53
1 Answers
2
The property sun.java.command
contains command line options
<project >
<echo message="${sun.java.command}" />
<condition property="verbose.is.set">
<contains string="${sun.java.command}" substring="-v" />
</condition>
<echo message="${verbose.is.set}" />
</project>

Oleg Pavliv
- 20,462
- 7
- 59
- 75