ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: OS-specific execution of any element requested
Date Fri, 20 Sep 2002 11:49:26 GMT
you could use a <condition> as such:

  <condition property="isWindows">
      <os family="windows" />

with a PatternSet. i.e.:

<patternset id="sources" >
  <include name="files" if="isWindows"/>

and then call a target as such:

<target name="fooWindows" if="isWindows"/>

if you make one target per os, and call all of them with an <antcall>, the
right one should get called.


-----Message d'origine-----
De : Markus Kramer []
Envoye : vendredi 20 septembre 2002 12:53
A :
Objet : OS-specific execution of any element requested

I don't see a way to constrain elements of a java target to the
operating system.
This leads to "Copy and Paste" java targets, one for each OS, which is a
bad thing.
The following does not work, but it would be nice to have, I think.
I propose that *each* element can have a os attribute.
Below, there are three offending os="windows" attributes at the jvmarg
and the pathelement elements.
The meaning of a jvmarg element with an os="windows" attributes would be
that its only regarded when on Win32.

  <java classname=""
        fork="yes" >
 <arg value="${eaffile}"/>
 <jvmarg value="-Djava.ext.dirs=${src}/java.ext.dir" />
 <jvmarg value="-Djava.library.path=${src}/jmf__Vwin2.1.1a" /
    <jvmarg value="${jvmarg}"/>
    <classpath refid="extpacFooBar"/>
      <pathelement location="${build}"/>
      <pathelement location="${src}/mpi/lib/jmf__Vwin2.1.1a/jmf.jar"/
      <pathelement location="${src}/mpi/lib/jmf__Vwin2.1.1a/sound.jar"/

The same is true for OS-specific build pargets.
Does Ant provide a workaround?


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

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

View raw message