ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Adams" <>
Subject RE: Common path definitions
Date Tue, 10 Jul 2001 13:16:36 GMT
First off, thanks to Holly for the good advice.  I'll be looking at a better
"default" location for my properties files, as suggested.

Hmm... I don't know of any way to "define" something in a properties file 
as a particular object (ie, a path).  Right now property files are (to the 
best of my knowledge) limited to strings.   Here's a simplified example of 
how I would re-structure your paths:

lib.home = /usr/java/libraries
foo.path = ${lib.home}/foo.jar
bar.path = ${lib.home/bar1.jar:${lib.home}/bar2.jar


<javac srcdir="${src.dir}" destdir="${dest.dir}">
    <pathelement path="${foo.path}" />
    <pathelement path="${bar.path}" />

> And I can find no way to tell Ant to use the <path> elements defined in
> another file.

The above solution seems to do exactly that, but...

> I could store the information as property strings, and then define the
> <path> elements in each build file that needs to use them, but that is what
> I am trying to avoid. also is suspiciously similar to what you're trying to avoid.  I guess I'm having
a tough time understanding exactly what you're trying to do.  Does this help any?


>    <path id="foo.path">
>        <pathelement location="/usr/java/libraries/foo.jar" />
>    </path>
>    <path id="bar.path">
>        <pathelement location="/usr/java/libraries/bar1.jar" />
>        <pathelement location="/usr/java/libraries/bar2.jar" />
>    </path>

View raw message