----- Original Message -----
From: "David McTavish" <[EMAIL PROTECTED]>
To: "'Ant Users List'" <[EMAIL PROTECTED]>
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>

Reply via email to