ant-user mailing list archives

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

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 http://mycompany.com-->
<project name="master" >
     <target name="compile" ...>
     </target>
</project>

<!-- stored somewhere in Project A -->
<project name="projectA" extends="http://mycompany.com/master.xml">
...
</project>

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="http://mycompany.com/master.xml"
                dest="master.xml" />
     </target>

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

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

regards,
Maarten

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


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message