ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mariusz Nowostawski <mari...@marni.otago.ac.nz>
Subject Re: A question about "available" and doing conditionals in a build xml file.
Date Wed, 17 May 2000 22:15:16 GMT

Glenn wrote:

> The problem with using "unless" is that it implies that the property in
> question must be set.  So 
> <target name="blah" unless="unless.property">
>   ...
> </target>
> only works if you have set "unless.property" at some point.  How do I set
> "couldnt.find.generated" (from discussion below) with available?  Can't do
> it currently, as available only tests for positives, not negatives.

What if available would set a property to "true" if true, and to
"false" if resource/class/file is not available?
 
> Personally, I'd like an ifnot attribute in the Target class that was
> mutually exclusive to if.  

That is what I was thinking, and that's what I like most.

> [...] Mariusz, you proposed below to replace
> the "prop" attribute with "test," and "set" with "property."  Ok so far,
> but what do you do with "unset"?  

I agree. So in that case "set" and "unset" are fine, but it would be nice
to rename "property" from "available" to "set" for consistency. But.. do
we need them if we have "ifnot" on targets ;o) ?


> At any rate, I'd be happy to do the "ifnot" patch for Target if anyone
> wants it.

+1   
I would like to have it a lot  ;o)

Actually I have exactly the same problem with idl generated files, and
what I did is to regenerate java sources always after distclean - ugly,
but with current Ant as it is there is no nice way for dealing with
it. With "ifnot" this problem simply does not exist.


Mariusz


Mime
View raw message