ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <peter.rei...@corvil.com>
Subject Re: multiple args to java task
Date Tue, 21 Oct 2003 14:42:31 GMT
On Tuesday 21 October 2003 15:16, Dominique Devienne wrote:
> > From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> >
> > If you havenĀ“t a complex start procedure for the decompiler maybe you
> > can use <apply> here.
> >
> > <apply executable="java">
> >     <arg value="jode.decompiler.Main"/>
> >     <arg value="--dest"/>
> >     <arg value="${dest.dir}"/>
> >     <fileset ... />
> > </apply
> >
> >
> >
> > ... maybe we should give <apply> the ability to start java apps ...
>
> Discussed before (at least a couple time I can remember), and rejected on
> the grounds that a custom task should be written instead... I disagree, so
> if you want to raise it up again, I'll support you ;-)
>
> Given the new <macrodef> though, I can see how it would be easy to emulate
> one. Peter, can I with <macrodef> say that the macro can take an optional
> <classpath>? Examples I've seen with macros so far had child elements to
> contain other elements to be passed to some internal task to the macro. I'm
> thinking of declaring a macro with an optional <classpath>, that would be
> <pathConvert> to feed on the command line of "java" executed by <apply>.
> Sounds feasible? Otherwise I'm pretty sure I'll hack up a task one of these
> days... --DD

I am not too sure I understand.
An element to a macrodef can be optional, but if it not present, the
macro will simply not place it in the macro instance.

One can emulate <apply/> for <java/> using a <foreach/> task or **NEW**
a
<for/> task from antcontrib.

    <path id="xml_files">
        <fileset dir="." includes="**/*.xml"/>
    </path>

    <for param="arg">
      <path refid="xml_files"/>
      <sequential>
        <java classname="Echo" classpath="classes">
          <arg value="${arg}"/>
        </java>
      </sequential>
    </for>

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


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


Mime
View raw message