ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@bost.de>
Subject Re: "include" equivalnet in ant?
Date Tue, 07 Nov 2000 08:45:22 GMT
>>>>> "DF" == Duane Fields <dfields@caleonetworks.com> writes:

 DF> I'd like to be able to include a collection of targets from
 DF> another build.xml into an antfile,

Copy of the FAQ entry I've created four weeks ago but that hasn't been
released yet (*grmbl*) follows:

-------------------

How do I include another fragment of a buildfile?

You can use XML's way of including external files and let the parser
do the job for Ant:

<?xml version="1.0"?>

<!DOCTYPE project [
    <!ENTITY common SYSTEM "file:./common.xml">
]>

<project name="test" default="test" basedir=".">

  <target name="setup">
    ...
  </target>

  &common;

  ...

</project>

will literally include the contents of common.xml where you've placed
the &common; entity.

In combination with a DTD this would look like this:

<!DOCTYPE project PUBLIC "-//ANT//DTD project//EN" "file:./ant.dtd" [
   <!ENTITY include SYSTEM "file:./header.xml">
]>

Mime
View raw message