Ant shared properties?
2 posts in topic
Flat View  Flat View

Posted By:   Tom_Santos
Posted On:   Thursday, June 20, 2002 06:41 PM

I'm evaluating ant and I'm trying to figure out if there's a way to share properties across a number of build.xml files.

I have a directory tree where I want to have a build.xml in every directory so I can build recursively from any given directory. All of the build.xml files need to have the same set of jars in their classpath and I'd rather not include the long list of jars in every build.xml file.

Is there some way for a bunch of seemingly unrelated build.xml files to share a common set of properties? In make you can use include to share things like this.

Re: Ant shared properties?

Posted By:   Heng_Cao  
Posted On:   Tuesday, June 25, 2002 12:39 PM

A common way to reuse properties and targets is to use XML entity references, please take a look at my answer in
Reusable build.xml, using absolute path in fileset

Re: Ant shared properties?

Posted By:   Erik_Hatcher  
Posted On:   Friday, June 21, 2002 02:55 AM

build.xml is simply XML, so you can use entity references to include fragments. Here's an pointer to Ant's own FAQ: How do I include an XML snippet in my build file? .

Or you could simply use:

On a related note, if you're running all these builds from a master build file instead of directly, you can (with Ant 1.5) pass references to datatypes such as a to child build files using .

About | Sitemap | Contact