You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jantje <ja...@skynet.be> on 2008/07/02 01:52:30 UTC
? function in build.xml
Hi there,
I have this in build.xml
<delete dir="/tmp/module"/>
<mkdir dir="/tmp/module/usr/local/fop"/>
<copy todir="/tmp/module/usr/local/fop">
<fileset dir="/usr/local/fop/"/>
</copy>
These three tasks I have to repeat multiple times (only changing fop in f.i.
jdk or project or..). Is it possible to make some kind of function so I only
have to pass the word "fop"? f.i.:
function SSS {
<delete dir="/tmp/module"/>
<mkdir dir="/tmp/module/usr/local/${1}"/>
<copy todir="/tmp/module/usr/local/${1}">
<fileset dir="/usr/local/${1}/"/>
</copy>
}
Thanks..
--
View this message in context: http://www.nabble.com/--function-in-build.xml-tp18227643p18227643.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: ? function in build.xml
Posted by Frank Harnack <ha...@mail05.harlau.de>.
Hello jantje,
the macrodef-Task should help:
http://ant.apache.org/manual/CoreTasks/macrodef.html
The for-Task (ant-contrib) could be interesting too:
http://ant-contrib.sourceforge.net/tasks/tasks/for.html
Regards
Frank
Quoting jantje <ja...@skynet.be>:
>
> Hi there,
>
> I have this in build.xml
> <delete dir="/tmp/module"/>
> <mkdir dir="/tmp/module/usr/local/fop"/>
> <copy todir="/tmp/module/usr/local/fop">
> <fileset dir="/usr/local/fop/"/>
> </copy>
> These three tasks I have to repeat multiple times (only changing fop in f.i.
> jdk or project or..). Is it possible to make some kind of function so I only
> have to pass the word "fop"? f.i.:
>
> function SSS {
> <delete dir="/tmp/module"/>
> <mkdir dir="/tmp/module/usr/local/${1}"/>
> <copy todir="/tmp/module/usr/local/${1}">
> <fileset dir="/usr/local/${1}/"/>
> </copy>
> }
>
> Thanks..
> --
> View this message in context:
> http://www.nabble.com/--function-in-build.xml-tp18227643p18227643.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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