Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ANT: How to "add" path elements from one path into a second path?

Tags:

java

build

ant

I have an ANT build xml file which includes a path declaration with numerous path elements. I would like to declare a second path that "includes" somehow all the elements from the former path into its own. That would then allow me to just the later path rather than requiring me to include both when paths are required.

Without copying all the elements from the former path into the later path, surely theres a better way.

like image 518
mP. Avatar asked Jan 05 '10 04:01

mP.


1 Answers

As shown here, you want to use the refid attribute. For example, here p2 refers to the elements in p1

<path id="p1">
    <fileset dir="lib">
        <include name="**/*.jar"/>
    </fileset>
</path>

<path id="p2">
    <path refid="p1"/>
    <fileset dir="src">
        <include name="**/*.java"/>
    </fileset>
</path>
like image 70
Michael Easter Avatar answered Oct 03 '22 23:10

Michael Easter