ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Coene <>
Subject Is there something like "project-inheritance" ?
Date Tue, 14 May 2002 09:01:50 GMT

I would like to use the same buildfile for all of my projects.

Let me first illustrate the problem:
At this moment, we are working with some sort of "buildfile template" which 
is copied everytime we create a new project. This copy can be slightly 
modified to deal with specific project needs. This causes problems if we 
want to update a target of the "template buildfile" because we also have to 
change that target in all of the copied buildfiles (and it takes some time 
to do this...).

Conceptually, I want something like this:
<!-- stored in a file named master.xml at location>
<project name="master" >
     <target name="compile" ...>

<!-- stored somewhere in Project A -->
<project name="projectA" extends="">

where the "projectA" project can use the compile target of the "master" 
project (like inheritance in Java)
In this way, the master buildfile can be stored at one place and changes to 
this master buildfile (for example in change in the compile target) 
automatically causes projectA to use the new version.

I tried to solve this problem with this attempt:

<project name="projectA">
     <target name="init">
         <get src=""
                dest="master.xml" />

     <target name="compile" depends="init">
         <ant antfile="master.xml" target="compile" />

But, maybe there are better/other solutions than this one. Any help would 
be greatly appriciated!


Maarten Coene
Katholieke Universiteit Leuven
Dept. Computerwetenschappen             Tel: ++32 (0)16/32 78 25
Celestijnenlaan 200A
B-3001 Heverlee

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message