1

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?

Reinderien
  • 11,755
  • 5
  • 49
  • 77

1 Answers1

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