ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: Conditional echo
Date Tue, 05 Nov 2002 20:59:36 GMT

----- Original Message -----
From: "David McTavish" <dmctavish@SANDVINE.com>
To: "'Ant Users List'" <ant-user@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 11:04 AM
Subject: Conditional echo


>
> Hi all,
> I was wondering if anybody could provide some insight in how I could
> conditionaly "echo" a message. Basically, what I would like to do is echo
a
> message if the target was called from within the same build script
> (build.xml), but not if it was called from an external source. I was
> thinking I could pass in a property when I make external calls to set the
> level of verbosity to off.
>
> ie:
> <ant dir=".." target="my.target" inheritall="false">
> <property name="verbose" value="false" />
> </ant>
>
> However, I'm not sure how I can write my echo tasks to handle this
> conditional property. I'd really like to avoid having to write two
separate
> targets for every 'echo' that is based on the if/unless conditions if
> possible.


you can use the current level attribute of <echo>, set it to info for info
level echoing (normal), or to verbose or debug to hide the messages till the
user hits -verbose, -debug.



>
> ../build.xml:
>
> <property name="verbose" value="true"/>
>
> <target name="my.target">
> <echo message="status report 1"/>
> </target>
>
>
>
> thx,
> d.
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message