Ant : how can I use properties to store nested element

Discussion in 'Java' started by Christopher Ho, Apr 1, 2004.

  1. 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>
     
    Christopher Ho, Apr 1, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Bedford
    Replies:
    6
    Views:
    2,297
  2. Fred Flintstone
    Replies:
    2
    Views:
    9,310
    Fred Flintstone
    Sep 13, 2006
  3. Rick
    Replies:
    1
    Views:
    2,314
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 19, 2007
  4. carsten_
    Replies:
    2
    Views:
    517
    MCMicS
    Mar 10, 2008
  5. AAaron123
    Replies:
    2
    Views:
    438
    AAaron123
    Oct 7, 2009
Loading...

Share This Page