ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vilya Harvey" <vilya.har...@digitalsteps.com>
Subject Re: OS-specific execution of any element requested
Date Fri, 20 Sep 2002 16:18:22 GMT
I've modified my copy of Ant (1.5) to have if="" and unless="" on every
task; I can send you the modified source code if you like. When I have a bit
more time I intend to submit a patch against the version in CVS through the
proper channels...

Vil.
--
Vilya Harvey, Consultant
vilya.harvey@digitalsteps.com                 / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457                 http://www.digitalsteps.com/


----- Original Message -----
From: "Matt Benson" <gudnabrsam@yahoo.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Friday, September 20, 2002 4:58 PM
Subject: Re: OS-specific execution of any element requested


> I thought that would be nice too, having if and unless
> available everywhere.  I don't really think about it
> anymore.  What you do is wrap these types of things in
> other targets, put the if/unless on the targets, and
> make your main target dependent on those.
>
> -Matt
>
> --- Markus Kramer <Markus.Kramer@mpi.nl> wrote:
> > Matt,
> > this sounds wonderful, trouble is that the unless
> > attribute is not allowed for
> > things like paths:
> >     <classpath refid="extpacElan"
> > unless="${onWindows}" />
> > brakes Ant.
> > My proposal would be to have the unless (and the if)
> > attribute allowed on
> > *any* Ant element.
> > This is more flexible than my first proposal to have
> > an "os" attribute.
> > Trouble is, that "if" attributes are not allowed
> > everywhere.
> > I even don't know where they are allowed.
> >
> > All of you, have a nice weekend.
> > Markus
> >
> >
> >
> > Matt Benson wrote:
> >
> > > Or making all the targets dependencies and relying
> > on
> > > if/unless to stop the wrong ones from executing is
> > > probably the intended way, as opposed to <antcall>
> > > which is nice for more dynamic things.
> > >
> > > -Matt
> > >
> > > --- EXT / FOCAL MALAPRADE Roland
> > > <ext.focal.malaprade@sncf.fr> wrote:
> > > > you could use a <condition> as such:
> > > >
> > > >   <condition property="isWindows">
> > > >       <os family="windows" />
> > > >   </condition>
> > > >
> > > > with a PatternSet. i.e.:
> > > >
> > > > <patternset id="sources" >
> > > >   <include name="files" if="isWindows"/>
> > > > </patternset>
> > > >
> > > > 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.
> > > >
> > > > Roland
> > > >
> > > >
> > > >
> > > > -----Message d'origine-----
> > > > De : Markus Kramer [mailto:Markus.Kramer@mpi.nl]
> > > > Envoye : vendredi 20 septembre 2002 12:53
> > > > A : ant-user@jakarta.apache.org
> > > > 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="foo.bar.Main"
> > > >         fork="yes" >
> > > >  <arg value="${eaffile}"/>
> > > >  <jvmarg
> > value="-Djava.ext.dirs=${src}/java.ext.dir"
> > > > />
> > > >  <jvmarg
> > > >
> > value="-Djava.library.path=${src}/jmf__Vwin2.1.1a" /
> > > > os="windows">
> > > >     <jvmarg value="${jvmarg}"/>
> > > >     <classpath refid="extpacFooBar"/>
> > > >     <classpath>
> > > >       <pathelement location="${build}"/>
> > > >       <pathelement
> > > >
> > location="${src}/mpi/lib/jmf__Vwin2.1.1a/jmf.jar"/
> > > > os="windows">
> > > >       <pathelement
> > > >
> > location="${src}/mpi/lib/jmf__Vwin2.1.1a/sound.jar"/
> > > > os="windows">
> > > >     </classpath>
> > > >   </java>
> > > >
> > > > The same is true for OS-specific build pargets.
> > > > Does Ant provide a workaround?
> > > >
> > > > best
> > > > -Markus
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <mailto:ant-user-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > > <mailto:ant-user-help@jakarta.apache.org>
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <mailto:ant-user-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > > <mailto:ant-user-help@jakarta.apache.org>
> > > >
> > >
> > > __________________________________________________
> > > Do you Yahoo!?
> > > New DSL Internet Access from SBC & Yahoo!
> > > http://sbc.yahoo.com
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:ant-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <mailto:ant-user-help@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:ant-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:ant-user-help@jakarta.apache.org>
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message