Modulation of class classes in ant scripts (e.g. via refid)

Since my ant file is quite complex, I want to modulate classpath elements.

I am currently using refidas follows:

<path id="compile.classpath">
  <pathelement path="foo"/>
  <!-- ... -->
</path>

<path id="test.classpath">
  <path refid="compile.classpath"/>
  <pathelement path="bar"/>
  <!-- ... -->
</path>

<!-- ... -->

    <javac>
        <classpath refid="compile.classpath"/>
    </javac>

    <junit>
        <!-- ... -->
        <classpath>
             <path refid="test.classpath"/>
             <path path="bazz"/>
        </classpath>
    </junit>

<!-- ... -->

Is this a smart approach? Or is there a better one?

Is it possible to use path identifier ( compile.classpath) for pathpath-refid (in <javac>) method ? (Currently, it works, but refidrequires that the elements have the same type. Since pathand classpathare the same structures, whether they are of the same type?)

+5
source share
1 answer

I successfully used this approach in a previous job, and it was really the only way to stay healthy.

, ext-libs.xml, , , , . , build.xml ( ) , , lib.jaxb, , .

classpath, , .

, .

+5

All Articles