ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ELangenb...@desknetinc.com
Subject Re: Questions
Date Fri, 21 Jul 2000 17:24:53 GMT
Dino writes:
> I would like to have an include tag (which references another generic xml
> build file) that gets included into the build file (this is the same with
> the include keyword for makefiles). I'm finding myself writing the exact
> same rules for a number of project with the name of the jar file being
> different.
>
> A question: where can I find an example of a more complex system using
ant
> (eg having a top level build file with constructs subproject files and
each
> subproject have build files that have dependencies between subprojects)?

You can do this using XML entities.  Here's a simple example:

===========
 build.xml
===========
<?xml version="1.0"?>

<!DOCTYPE project [
     <!ENTITY usage SYSTEM "usage.ent">
     <!ENTITY zip SYSTEM "zip.ent">
     <!ENTITY compile SYSTEM "compile.ent">
     <!ENTITY dist SYSTEM "dist.ent">
     <!ENTITY test SYSTEM "test.ent">
]>

<project name="mypackage" default="main" basedir=".">

     <!-- Usage -->
     &usage;

     <!-- Zip Targets -->
     &zip;

     <!-- Compile Targets -->
     &compile;

     <!-- Distribution Targets -->
     &dist;

     <!-- Test Targets -->
     &test;

</project>

Then, you build each of your ".ent" (.ent is just a convention...it can be
anything) files:

=============
 compile.ent
=============
<target name="compile">
     <javac .../>
</target>

etc.

I hope this helps.

Erik



Mime
View raw message