I thought ant 1.5 was supposed to be released in the next couple of weeks... Could be 
wrong.   

Some info about includes. (Stolen from the ant 1.5 docs)

#include targets to simplify multi build.xml projects 
You can import XML files into a build file using the XML parser itself. This lets a 
multi-project development program share code through reference, rather than cut and 
paste re-use. It also lets one build up a file of standard tasks which can be reused 
over time. Because the import mechanism is at a level below which ant is aware, treat 
it as equivalent to the #include mechanism of the 'legacy' languages C and C++. 
There are two inclusion mechanisms, an ugly one for all parsers and a clean one. For 
now, the ugly method is the most portable:- 

        <!DOCTYPE project [
          <!ENTITY IncludeBuildCore SYSTEM "buildCore.xml">
          <!ENTITY IncludeBuildSecondary SYSTEM "buildSecondary.xml">
        ]>  
        
        <target name="includedBuild">
                &IncludeBuildCore;
                &IncludeBuildSecondary;
        </target>

The cleaner method using XInclude/Xpath will let you include named targets from one 
build file or another, using the xpointer syntax. You'll need to wait for the W3C 
proposals to finalise and the java XML parsers to implement it before using xpointer 
references. 
Before you go overboard with using XML inclusion, note that the ant task lets you call 
any target in any other build file -with all your property settings propagating down 
to that target. So you can actually have a suite of utility targets 
-"deploy-to-stack-a", "email-to-team", "cleanup-installation" which can be called from 
any of your main build files, perhaps with subtly changed parameters. Indeed, after a 
couple of projects you may be able to create a re-usable core build file which 
contains the core targets of a basic java development project -compile, debug, deploy- 
which project specific build files call with their own settings. If you can achive 
this then you are definately making your way up the software maturity ladder. NB, ant 
copies all your properties unless the inheritall attribute is set to false. Before 
that attribute existed you had to carefully name all property definitions in all build 
files to prevent unintentional overwriting of the invoked property by that of the 
caller, now you just have to remember to set inheritall="false" on all uses of the ant 
task. 


Looks like there is no app level xml include.

Dave

* * *

View thread online: http://jboss.org/forums/thread.jsp?forum=66&thread=13850

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to