ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John P. McGrath" <>
Subject RE: Common path definitions
Date Fri, 13 Jul 2001 20:56:11 GMT
Kyle Adams [] wrote:

> ===============
> lib.home = /usr/java/libraries
> foo.path = ${lib.home}/foo.jar
> bar.path = ${lib.home/bar1.jar:${lib.home}/bar2.jar
> build.xml
> ==========
> <javac srcdir="${src.dir}" destdir="${dest.dir}">
>  <classpath>
>    <pathelement path="${foo.path}" />
>    <pathelement path="${bar.path}" />
>  </classpath>
> </javac>
> > 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...
> 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.

It is exactly what I have been doing, and also what I have been trying to
avoid.  This loads text strings from another file (a ".properties" file) and
then defines a path within the build file using those strings.  I had hoped
to store a path definition in another file and then somehow "include" that
file into the build file.

I was able to do an "include" using XML entities, but then I cannot use a
property to determine the location of the included file.

It is not critical, since encoding the paths as strings will work.  But I
had hoped to store higher level elements in the include file.  If such a
mechanism existed, it could also be used to include task definitions, and
those cannot be encoded as strings.


John McGrath

View raw message