ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Saxer" <martin.sa...@vykor.com>
Subject Sharing path id across multiple build files. Is it possible?
Date Sat, 17 Nov 2001 01:20:39 GMT
Hi,

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"/>
	</fileset>
</path>

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
build">
	<path id="classes.path">
		<fileset dir="${thirdparty.dir}" >
			<include name="**/*.jar"/>
		</fileset>
	</path>
</target>

In the child build file I added:

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

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

So...any other ideas I can try?

Thanks,
Martin


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


Mime
View raw message