ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Vromans CPWR <johan.vrom...@nl.compuware.com>
Subject Re: Preset execution environment
Date Tue, 20 Apr 2004 13:44:29 GMT
Johan Vromans CPWR wrote:
> The new 1.6 'import' feature is great, but what I would like is a way to 
> have ant automatically execute a predefined import. For example:
> 
>   ant --pre-import=common.xml --buildfile build.xml my-target
> 
> This would behave as if build.xml started like:
> 
>   <project ...>
>     <import file="common.xml" />

After evaluating and experimenting with several of the good ideas that were 
raised in response to my original question, I decided to bite the bullet and try 
  it out.

I cloned ProjectHelper2.java and modified it to perform the 'floating import' 
when it completes parsing the top-level build file (just before running the top 
level's implicit target). The modified ProjectHelper can be selected with the 
org.apache.tools.ant.ProjectHelper property, and an additional property controls 
the name of the pre-import file. No changes to ant necessary, just one 
additional class.

The greatest advantage is that for production I need only change a couple of 
ant.sh / ant.bat scripts, instead of 100s of individual build.xml files.

-- Johan

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


Mime
View raw message