ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: How to suppress <exec> output?
Date Wed, 17 Mar 2004 20:25:09 GMT
--- barry@goodconsultants.com wrote:
> The command that i am using is 
> <exec executable="cp" failifexecutionfails="false"
>   errorproperty="is.UnixStyle"/>

Firstly, you can set your property based on the
AVAILABILITY of the command.  The following example is
modified from exec's test script:

<property environment="env"/>
<!-- UNIX -->
<available file="cp" filepath="${env.PATH}"
property="cp.executable"/>
<!-- CYGWIN -->
<available file="cp.exe" filepath="${env.PATH}"
property="cp.exe.executable"/>
<condition property="cp.can.run">
    <or>
        <isset property="cp.executable"/>
        <isset property="cp.exe.executable"/>
    </or>
</condition>

This is more to the point than calling cp
indiscriminately.  However, to answer your original
question, using <exec>'s outputproperty attribute
should suppress the output.  Or you could use the OS
to set a null.device property to NUL for Windows (and
cygwin) or /dev/null for Unix, then use <exec
output="${null.device}" ...> .

-Matt


__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message