ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Verma, Nitin (GECP, OTHER, 529706)" <NITIN.VE...@APPL.GE.COM>
Subject RE: How to use localization with ant?
Date Thu, 29 May 2003 17:23:03 GMT
wow!

Thanx ... it's better than what I was trying now

        <script language="jpython">
props  = project.getProperties()
ps = props.get("path.separator")
if ps == ";":
    guess = win
else:
    guess = unix
    
project.setUserProperty("os.guess", guess)
        </script>

thanx again!

-----Original Message-----
From: peter reilly [mailto:peter.reilly@corvil.com]
Sent: Thursday, May 29, 2003 10:46 PM
To: Ant Users List
Subject: Re: How to use localization with ant?


Without using antcontrib's if task:

<project name="t" default="t">

  <target name="t" depends="init">

  </target>

  <condition property="win">
    <os family="windows"/>
  </condition>

  <target name="set-win" if="win">
    <property name="my.os" value="win"/>
  </target>

  <target name="init" depends="set-win">
    <property name="my.os" value="unix"/>
    
    <property file="${my.os}.properties"/>
  </target>

</project>

Peter
On Thursday 29 May 2003 18:02, Verma, Nitin (GECP, OTHER, 529706) wrote:
> Thanx! This is a nice option but my project should build on any OS having
> ant and java.
> Anyother option?
>
> -----Original Message-----
> From: peter reilly [mailto:peter.reilly@corvil.com]
> Sent: Thursday, May 29, 2003 10:23 PM
> To: Ant Users List
> Subject: Re: How to use localization with ant?
>
>
>
> I use the following:
>
>       <property file="${os.name}.properties"/>
>
> and have a "Linux.properties" and a "SunOS.properties" file and
> one for each of the mad bad winos's as there is nearly always
> some differences between them.
>
> Peter
>
> On Thursday 29 May 2003 17:33, Verma, Nitin (GECP, OTHER, 529706) wrote:
> > <property file="build.properties" locate="win"/>
> > This loads build.properties.win
> > <property file="build.properties" locate="unix"/>
> > This loads build.properties.unix
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message