ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: dynamic properties
Date Thu, 23 May 2002 15:17:35 GMT
See http://marc.theaimsgroup.com/?l=ant-user&m=102201011129362&w=2 .

<condition> just sets a property if it's elements are true. Then you must
use targets and proper dependencies between them to perform something
conditionally. What you want to do is only support by ant-contrib's <if>
task (search archive for info on it). --DD

-----Original Message-----
From: G.L. Grobe [mailto:gary@grobe.net] 
Sent: Wednesday, May 22, 2002 11:37 PM
To: Ant Users List
Subject: Re: dynamic properties

I'm using 1.4.1. Something here I am not understanding. I see how to set the
property, but how do I test the property to know what paths to use here.

      <condition property="acais.osrunning" value="Linux">
         <equals arg1="${os.name}" arg2="Linux">
            <property name="jboss.dir"
value="/u/public/JBoss-2.4.4_Tomcat-4.0.1"/>
            <property name="home.dir"        value="/u/build/acais"/>
            <property name="build.dir"       value="/u/build/acais-temp"/>
            <property name="release.dir"
value="/u/build/acais-release"/>
         </equals>
         <equals arg1="${os.name}" arg2="Mac OS X">
            <property name="jboss.dir"
value="/u/public/JBoss-2.4.4_Tomcat-4.0.1"/>
            <property name="home.dir"        value="/u/build/acais"/>
            <property name="build.dir"       value="/u/build/acais-temp"/>
            <property name="release.dir"
value="/u/build/acais-release"/>
      </condition>

I'm trying to do the following logic ...

    <condition property="platform" value="Linux">
         <os name="Linux">
    </condition>

I'd then like to say something like ... (it's wrong, but read as ...)

<if os.name == "linux">
    <property name="my.dir" value="this.path"/>
<elseif os.name == "mac">
    <property name="my.dir" value="that.path"/>
</if>

> > Using Ant 1.4.1, what's the best way to test if a property is of a
> > certain value so that I may set other props ...
>
> The <equals> element of <condition>.



--
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>


Mime
View raw message