ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <Nico.Sees...@epost.de>
Subject Re: Questions on Ant
Date Wed, 18 Oct 2000 20:19:05 GMT

----- Original Message -----
From: "Max Nalsky" <maxim@mccme.ru>
To: <ant-dev@jakarta.apache.org>
Sent: Wednesday, October 18, 2000 9:26 PM
Subject: Re: Questions on Ant


>
> Well,
>
> What Ken suggests seems to be a kind of hack (even if it'd worked as he
> suppose). Am I right there's no "right" way to do what I need? Maybe it
> makes sense to modify Target.java so that a target could take a list of
> comma-separated properies names and check whether all of them are true?
>

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



Mime
View raw message