ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: How to use localization with ant?
Date Fri, 30 May 2003 06:38:43 GMT
Or use the ${os.name} with default values:

<property file="${os.name}.properties" />
<property file="default.properties" />

Then you define your values in default.properties and only platform specific
values which are different from the defaults are listed the
${os.name}.properties.


Jan


-----Urspr√ľngliche Nachricht-----
Von: Verma, Nitin (GECP, OTHER, 529706) [mailto:NITIN.VERMA@APPL.GE.COM]
Gesendet am: Donnerstag, 29. Mai 2003 19:23
An: Ant Users List
Betreff: RE: How to use localization with ant?

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/alternative (inline, None, 0 bytes)
View raw message