Ant : how can I use properties to store nested element

C

Christopher Ho

Hi all,

I have a build script which uses <fileset> nested in <path> to store
the classpath and then this <path> is used in javac. e.g.

<path id="MY_CLASSPATH">
<fileset dir="${build.dir.lib}" includes="**/*.*"/>
<fileset file="${global.lib.j2ee}"/>
</path>

<javac
srcdir = "${project.compile.src}"
destdir = "${project.compile.dest}">
<classpath>
<path refid="MY_CLASSPATH"/>
</classpath>
</javac>

I just wondering is it possible to store the fileset in the properties
file so that I can reference it in other place? I want to do a fileset
instead of writing all the jar file names explicitly.
e.g.
In the properties file:
project.compile.classpath=dir:${build.dir.lib}:file:${global.lib.j2ee}
(or something like that....)

then in my build.xml:
<javac
srcdir = "${project.compile.src}"
destdir = "${project.compile.dest}">
classpath = "${project.compile.classpath}">
</javac>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top