ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Nalsky <>
Subject Re: Questions on Ant
Date Wed, 18 Oct 2000 20:36:04 GMT
On Wed, 18 Oct 2000, Nico Seessle wrote:

> Currently the "right" way may be to use the script-task in a way similar to
> this (I have not checked this for validity, maybe the if-statement must be
> corrected):
> <project name="myProject" ...
>     <script language="javascript"> <![CDATA[
>         var prop1 = myProject.getProperty('property1');
>         var prop2 = myProject.getProperty('property2');
>         if (prop1 == null || prop2 == null)
>        {
>             myProject.setProperty('propertyMissing', 'true');
>        }
>     ]]></script>
> And then use
> <target name="myTarget" if ="propertyMissing">
>   <fail message="You have not defined a required property"/>
> Nico

Yes, it seems to solve my problem, I'll try.

Actually, I'm new to Ant, so I need some time to start "feeling" it. From
the discussions in this mailing list I've already got the idea that ant is
not make, so there hardly will be regular expressions in ant, etc, etc.
So, I don't like to propose a silly things, but maybe a list of properties
inside "if" and "unless" tags in <target> would extend Ant's
functionality leaving it simple. What do Ant's developers think?

Max Nalsky

View raw message