Reinderien
Reinderien

Reputation: 15253

How do you determine within Ant whether verbose is enabled?

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?

Upvotes: 2

Views: 562

Answers (1)

Oleg Pavliv
Oleg Pavliv

Reputation: 21172

The property sun.java.command contains command line options

<project >
    <condition property="verbose" value="true">
        <contains string="${sun.java.command} " substring=" -v " />
    </condition>
    <property name="verbose" value="false" />

</project>

Upvotes: 3

Related Questions