ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doremieux, Olivier" <Olivier.Doremi...@fc.celera.com>
Subject RE: Platform detection
Date Thu, 10 Aug 2000 16:29:04 GMT
This might do the trick but not in All cases.
I think when you are using NT you don't need an AutoExec.bat.
You can boot from another harddrive than C:, so the path can not be hardcode
in the build.xml
Is there someway to use the java properties System.getProperty("os.arch") or
System.getProperty("os.name") from there we have some way to know on which
platform the build.xml is used.

Thank you

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@bost.de]
Sent: Thursday, August 10, 2000 8:44 AM
To: ant-user@jakarta.apache.org
Subject: Re: Platform detection


>>>>> "DO" == Doremieux, Olivier <Olivier.Doremieux@fc.celera.com> writes:

 DO> In my build.xml I want to be able to use it on Multiple
 DO> Plaforms. But depending on the Platform I want to run different
 DO> target.  Let say I want to execute target A & B on Windows and A
 DO> & C on Solaris.  How can I do that?

Maybe we should add an option for this to <available>?

Does

<project ... default="main">
  <target name="check">
    <available value="windows" file="C:\autoexec.bat" />
  </target>

  <target name="A" depends="check">
    ...
  </target>

  <target name="B" depends="A" if="windows">
    ...
  </target>

  <target name="C" depends="A" unless="windows">
    ...
  </target>

  <target name="main" depends="B,C" />
</project>

do the trick?

Stefan

Mime
View raw message