You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by William Ferguson <wi...@mincom.com> on 2000/08/01 11:09:56 UTC

Target if

How can I get a Target to execute only if a file is *not* present?

Is there a way of negating the value to the if attribute?

I can obviously set a property if a file exists using available, but how
to use the negative?


William Ferguson

This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please
delete it and notify the sender. The contents of this E-mail are the
opinion of the writer only and are not endorsed by Mincom Limited unless
expressly stated otherwise.


RE: Target if

Posted by William Ferguson <wi...@mincom.com>.
Thanks Donald,

that'll teach me for using old doco.

William Ferguson

This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please
delete it and notify the sender. The contents of this E-mail are the
opinion of the writer only and are not endorsed by Mincom Limited unless
expressly stated otherwise.


> -----Original Message-----
> From: Peter Donald [mailto:donaldp@mad.scientist.com]
> Sent: Tuesday, 1 August 2000 19:11
> To: ant-user@jakarta.apache.org
> Subject: Re: Target if
>
>
> At 07:09  1/8/00 +1000, you wrote:
> >How can I get a Target to execute only if a file is *not* present?
> >
> >Is there a way of negating the value to the if attribute?
> >
> >I can obviously set a property if a file exists using
> available, but how
> >to use the negative?
>
> <available property="blah.present" file="blah.txt" />
> <target name="blee" unless="blah.present">
> ...
>
>
> does this do what you want ???
> Cheers,
>
> Pete
>
> *------------------------------------------------------*
> | "Nearly all men can stand adversity, but if you want |
> | to test a man's character, give him power."          |
> |       -Abraham Lincoln                               |
> *------------------------------------------------------*
>


Re: Target if

Posted by Peter Donald <do...@mad.scientist.com>.
At 07:09  1/8/00 +1000, you wrote:
>How can I get a Target to execute only if a file is *not* present?
>
>Is there a way of negating the value to the if attribute?
>
>I can obviously set a property if a file exists using available, but how
>to use the negative?

<available property="blah.present" file="blah.txt" />
<target name="blee" unless="blah.present">
...


does this do what you want ???
Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*