ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Platform-specific properties
Date Thu, 04 Apr 2002 06:13:15 GMT
On Wed, 3 Apr 2002, John Lindwall <> wrote:

> What is your reaction to handling platform-specific properties as
> shown below?  Is there a better way?

I'd load property files instead of using targets. 

If all you need is to distinguish between Windows and non-Windows,
this could be as simple as

  <condition property="property-file" value="">
      <os family="windows" />
  <property name="property-file" value="" />
  <property file="${property-file}" />

This takes advantage of immutable properties, if <condition> has set
the property property-file, the property task after that won't do

You can extend this to more than two files by using more <condition>s
easily, this scales better than one target per environment IMHO.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message