ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Any examples of how we can simplify ant build.xml with templa tes (?)
Date Wed, 04 Feb 2004 12:30:16 GMT
> That's not exactly what I meant.  I meant the super build would have 
> this:
> 
>    <target name="compile" depends="pre-compile">
> 
> but pre-compile is not defined in super.  Then sub builds would be 
> required to implement the pre-compile target.
> 
> 	Erik


I´ve realized something like that.

define-hook.xml
---------------
<project name="common-define-hook">
    <scriptdef name="hook" language="javascript">
        <attribute name="target"/>
        <![CDATA[
            if (project.getTargets().containsKey(attributes.get("target")))
{
 
project.getTargets().get(attributes.get("target")).performTasks();
            }
        ]]>
    </scriptdef>
</project>


build.xml
---------
<project>
    <import file="define-hook.xml"/>
    <target name="compile">
        <hook target="pre-compile"/>
        <javac/>
        <hook target="post-compile"/>
    </target>
</project>


Jan

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