You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Scott Ellsworth <sc...@alodar.com> on 2001/10/08 22:57:29 UTC

Help: is there a way to include another build file?

Howdy, all.

In our hierarchy, we have a build directory with subdirectories for each 
product of the work.  Each one of those has an ant build script in it to 
generate the resulting library, executable, or whatever.  I noted recently 
that the four build files are identical except for a few defines at the 
top.  This has let me document the entire build process as:

1.  Go to the overall build directory.
2.  Seek a directory named after the product you want to build.  For 
example, if you want to build the "experiment" program, look for the 
"experiment" subdirectory under build.  Similarly, the "metagraph.jar" 
library is built in the "metagraph" directory under build.
3.  Move into the appropriate subdirectory
4.  Type "ant" to build the product in question.  This will not deploy it.
5.  Type "ant deploy-debug" to deploy a debug version of the product.

I am a bit uncomfortable having the exact same tasks in each of the 
build.xml files.  Is there a way to have a build file include a bunch of 
tasks from another one?  I could then have all of the product build files 
just do some defines and include a single master build script.

It appears that I could go the other way - have one master build file which 
then did tasks on the subdirectories, but we really do not want that 
behavior.  The master build file is something we would kind of like people 
not to mess with, and thus we would rather not have them execute it.

For the visually inclined:

org
-metagraph
--build
---build.xml
---metagraph
----build.xml
---experiment
----build.xml

To build "metagraph.jar", cd to org.metagraph.build.metagraph, and type 
"ant", then to deploy, type "ant deploy-debug".

Scott
Scott Ellsworth
scott@alodar.com


RE: Help: is there a way to include another build file?

Posted by Scott Ellsworth <sc...@alodar.com>.
At 05:27 PM 10/9/2001 +1000, Conor MacNeill wrote:
>You can use XML based includes
>
>http://jakarta.apache.org/ant/faq.html#xml-entity-include

Thanks, Conor!  I had looked in the FAQ, but was thinking "including a 
build file" rather than "including text".

Scott
Scott Ellsworth
scott@alodar.com


Re: Help: is there a way to include another build file?

Posted by Jeff Turner <je...@socialchange.net.au>.
Yep. As an example, have a look at the jakarta-taglibs project's build
system. There's one common xml, and each target has an overridable 'pre'
and 'post' target. Works really well.

--Jeff

On Tue, Oct 09, 2001 at 05:27:41PM +1000, Conor MacNeill wrote:
> Scott,
> 
> You can use XML based includes
> 
> http://jakarta.apache.org/ant/faq.html#xml-entity-include
> 
> Conor

RE: Help: is there a way to include another build file?

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Scott,

You can use XML based includes

http://jakarta.apache.org/ant/faq.html#xml-entity-include

Conor