Hi Clint
On Fri, 4 Jan 2002 17:36:05 -0500 , "Combs, Clint"
<[EMAIL PROTECTED]> wrote:
>My company is using ant for all our Java builds. We have a primary build
>file, called common.xml, and all include files named project-name.xml
>include this file via a line like:
>
><!ENTITY include.commontasks SYSTEM "file:./common.xml">
>
>This works great, but I have a project where I'd like to extend the "clean"
>target that is found in common.xml. In other words, I'd like to define the
>"clean" target in project-name.xml to do everything in common.xml, plus a
>few more things. Obviously, I could define another target name which
>depends on clean, but that would break the overall build process, which
>calls clean automatically on each project.
How about the approach described below?
Regards,
Rolf
common.xml:
<property name="clean.target" value="clean.commontasks" />
<target name="clean">
<antcall target="${clean.target}" />
</target>
<!-- The common clean target: -->
<target name="clean.commontasks">
<echo message="Now executing commontasks clean..." />
</target>
The project build.xml:
<?xml version="1.0"?>
<!DOCTYPE project [<!ENTITY common SYSTEM "file:./common.xml">]>
<project name="myproject" default="test" basedir=".">
<!-- Comment this out and clean.commontasks will be called: -->
<property name="clean.target" value="clean.myproject" />
&common;
<target name="test" depends="clean" />
<!-- The overriding clean target: -->
<target name="clean.myproject">
<antcall target="clean.commontasks" />
<echo message="Now executing project clean..." />
</target>
</project>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>