ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <n...@apache.org>
Subject Re: Newbe: How to get platform-independence - *.bat vs *.sh
Date Thu, 15 Feb 2001 00:37:06 GMT
----- Original Message -----
From: "Barbara Bliss" <bhb@sdrc.com>
To: <ant-user@jakarta.apache.org>
Sent: Thursday, February 15, 2001 1:04 AM
Subject: Newbe: How to get platform-independence - *.bat vs *.sh


> Option 3: find/write a task that determines which os the build is
> running on and set the java.packager.extension property.

Option 3a: find/write a task that determines which os the build is
running on and only executes the command if the os is matching the one I
specified.

See ExecOn in the docs. You can specify an attribute "os" which is matched
against the property "os.name".

You should be able to specify something like

<execon executable="ls" on="Linux">
  <arg value="-l"/>
</execon><execon executable="cmd.exe /c dir" on="Windows 2000"/>

To get a directory-listing on Linux or Windows, depending where Ant is
executed.
This is *not* tested, so you may get errors and may to change this to your
needs.
Nico




Mime
View raw message