ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: load a property file based on operating system
Date Thu, 21 Nov 2002 19:54:53 GMT
The <condition> element must be specified as a
nested element of <target>

Try:

 <project name="test" default="all" basedir=".">
   <target name="init">
     <condition property="build.properties.filename"
                   value="build-linux.properties">
         <os name="Linux"/>
     </condition>
     <condition property="build.properties.filename"
                   value="build-w2k.properties">
         <os name="Windows 2000"/>
     </condition>

     <property name="build.properties.filename"
              value="build.properties"/>
   </target>
   <target name="all" depends="init">...</target>
 </project>


----- Original Message -----
From: "Kevin HaleBoyes" <kzboyes@yahoo.com>


> I have two property files
>    build-linux.properties   and
>    build-w2k.properties
>
> I'd like to load the proper one based on the operating system
> that I'm building my application on.  I tried the following:
>
> <project name="test" default="all" basedir=".">
>     <condition property="build.properties.filename"
>                   value="build-linux.properties">
>         <os name="Linux"/>
>     </condition>
>     <condition property="build.properties.filename"
>                   value="build-w2k.properties">
>         <os name="Windows 2000"/>
>     </condition>
>
>     <property name="build.properties.filename"
>              value="build.properties"/>
>
>     <target name="all">...</target>
> </project>
>
> but it doesn't work.  I get the following error message:
> file:/home/hb/Work/cml/tmp/build.xml:5:
>    Unexpected element "condition"
>
>
> Any ideas on how to do this?
> Thanks,
> Kevin.
>
>
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> 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