You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Doremieux, Olivier" <Ol...@fc.celera.com> on 2000/08/10 17:19:46 UTC

Platform detection

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

Thank you in advance

Olivier

Re: Platform detection

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "DO" == Doremieux, Olivier <Ol...@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