A1: You can alreay use "XML-Includes":
 
<!DOCTYPE project [
  <!ENTITY buildFW SYSTEM "buildFW.inc">
  <!ENTITY buildHO SYSTEM "buildHO.inc">
%buildFW;
%buildHO;
]>
  <target name="performBuild">
    &buildFW;
    &buildHO;
 
Although you may get problems if you wish to include one specific file from build-files distributed in different directories? (I guess from other postings on the list)
 
A2: (Q2a) How should inheritance or even overloading work? Inheritance could be that you declare a target and use this target thru ant/antcall-tasks, but overloading? Do you reimplement the whole target then?
 
Nico
----- Original Message -----
Sent: Wednesday, November 08, 2000 8:55 AM
Subject: Inheritance of build.xml files

Hi,
 
The context :
- I have several active projects  and I'd like to ensure that they all use a template build.xml file that I have given to them (Actually, we have an "Implementation Guide" where we have defined the rules for the build.xml file, i.e. standard properties that each project must have, standard targets, ...). I'd like also like to make sure that when an addition is made to this template build.xml file, every project updates his own build.xml file to match the modification.
 
The problem:
- For the moment, Ant does not support either the notion of including another build.xml file or better yet, the notion of inheritance from another build.xml file (meaning that all targets, all properties are inherited and could eventually be overloaded).
 
The questions :
Q1 : What's your opinion for adding an include fearture to include another build.xml file in Ant ?
Q2 : What's your opinion for the inheritance feature described above (I can already hear the voices saying that it is going to be complicated, that if you want it to be perfect, then you need also to introduce private, public keywords to know if a given target can be overloaded or not, ... But still I'd like to have your opinion on this).
 
I hope this subject has not been already raised (I could not find it but I may have missed it).
 
Thanks a lot.
 
Vincent Massol
 

Reply via email to