ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "G.L. Grobe" <g...@grobe.net>
Subject Re: dynamic properties
Date Thu, 23 May 2002 04:37:07 GMT
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>


Mime
View raw message