ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: creating tasks
Date Thu, 20 Feb 2003 06:46:52 GMT
<antcall> invokes other targets while <taskdef> defines new tasks.
I´m doing both: invoking via depends and defining.
I have to define the task because I´m using <test1/>.


Jan Matèrne

> -----Ursprüngliche Nachricht-----
> Von: Antoine Levy-Lambert [mailto:levylambert@tiscali-dsl.de]
> Gesendet am: Donnerstag, 20. Februar 2003 07:26
> An: Ant Users List
> Betreff: Re: creating tasks
> 
> antcall does already the job, rather than taskdef. see this link :
> http://ant.apache.org/manual/CoreTasks/antcall.html
> ----- Original Message -----
> From: <Jan.Materne@rzf.fin-nrw.de>
> To: <user@ant.apache.org>
> Sent: Thursday, February 20, 2003 7:11 AM
> Subject: AW: creating tasks
> 
> 
> I can´t see any difference to the Ant-way:
> 
> <target name="compileCTask">
>     <javac src="${ctask.src}" />
> </target>
> 
> <target name="test" depends="compileTask">
>     <taskdef name="test1" classname="..." classpath="${ctask.src}" />
>     <test1 />
> </target>
> 
> 
> AFAIK Erik used such a construct in his book.
> 
> 
> Jan Matèrne
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Ronald Klop [mailto:ronald-mailinglist@base.nl]
> > Gesendet am: Mittwoch, 19. Februar 2003 17:42
> > An: user@ant.apache.org
> > Betreff: creating tasks
> >
> > Hello,
> >
> > I made the attached code today for creating tasks easily.
> > The idea was using something like this:
> >
> > <taskdef name="custom" classname="nl.base.util.CustomTask">
> > <classpath refid="local.classpath"/>
> > </taskdef>
> >
> > <target name="test">
> > <!-- define a new task named task1 -->
> > <custom action="new" name="task1" args="dir">
> > <echo>Compiling ${task1.dir}</echo>
> > <javac srcdir="${task1.dir}"/>
> > <delete .../>
> > </custom>
> > <!-- run the taks named task1 -->
> > <custom action="do" name="task1" args="dir=/bla1"/>
> > <custom action="do" name="task1" args="dir=/bla2"/>
> > <custom action="do" name="task1" args="dir=/bla3"/>
> > <custom action="do" name="task1" args="dir=/bla4"/>
> > </target>
> >
> > The output would than be:
> > [echo] Compiling /bla1
> > [javac] ...
> > [delete] ...
> > [echo] Compiling /bla2
> > [javac] ...
> > [delete] ...
> > [echo] Compiling /bla3
> > [javac] ...
> > [delete] ...
> > [echo] Compiling /bla4
> > [javac] ...
> > [delete] ...
> >
> > So, my idea is to make a task which can execute a couple of
> > other tasks,
> > which can be defined in the build.xml.
> >
> > This works, but the problem is, that the arguments are evaluated at
> > creation of the task and not at execution.
> > So in the above example it wil print 'Compiling
> > ${task1.dir}', because
> > the property 'task1.dir' isn't known until execution.
> >
> > Is there a solution for this? Or are there other tasks which
> > do the same
> > as I want?
> >
> > Greetings,
> >
> > Ronald.
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message