ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Any examples of how we can simplify ant build.xml with templa tes (?)
Date Wed, 04 Feb 2004 15:20:10 GMT
> From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> <project>
>   <scriptdef name="hook" language="javascript">
>     <attribute name="target"/><![CDATA[
>       if (project.getTargets().containsKey(attributes.get("target")))
>         project.getTargets().get(attributes.get("target")).performTasks();
>       ]]>
>     </scriptdef>
>   <target name="compile">
>     <hook target="pre-compile"/>
>     <javac/>
>     <hook target="post-compile"/>
>   </target>
> </project>

Whoa, that's a powerful trick Jan!

And adding if/unless on all tasks would have made Ant too scripty ;-) --DD

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


Mime
View raw message