ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Pearlman Spencer" <>
Subject RE: Sharing path id across multiple build files. Is it possible?
Date Mon, 19 Nov 2001 10:21:05 GMT
Try this:
If you want to define a new target or property or classpath
Add this to the top of the build.xml file:
	<!DOCTYPE project  [
		<!ENTITY test-file SYSTEM "testInclude.xml">
And then start the project:
	<project name="project" default="all" basedir=".">
And then where you need to include the file:
And get on with the rest:


-----Original Message-----
From: Martin Saxer []
Sent: 17 November 2001 01:21
Subject: Sharing path id across multiple build files. Is it possible?


I've searched the mail archives and ant documentation for a couple hours
and haven't found a solution to my problem.  I'm wondering if somebody
has a quick fix that could fix this problem.

Problem statement: I'm using Ant 1.4.  My project has multiple build
files, one of which could be considered the parent build file that calls
the children build files in succession.  The issue is that I need to set
the exact same <path id="classes.path"> element in each of the child
build files.  It'd be nice if this could be centralized as I've done for
all of the project properties/variables.

Here's a subset of what the <path> element looks like:

<path id="classes.path">
	<fileset dir="${thirdparty.dir}" >
		<include name="**/*.jar"/>

Is there an easy way to reference this with a refid from another
build.xml?  If so, what is the syntax?

I tried another trick that didn't work - I put the code above inside a
target like so:

<target name="setclasspath" description="Sets classpath for project
	<path id="classes.path">
		<fileset dir="${thirdparty.dir}" >
			<include name="**/*.jar"/>

In the child build file I added:

<target name="setclasspath">
	<ant antfile="build.xml" dir="../parent" target="setclasspath"/>

Unfortunately, classes.path can't be used as a refid like this.

So...any other ideas I can try?


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message