The problem I am having is that ant is compiling classes it shouldn't (i.e. they are 
not specified in the javac task's includes). The extra classes aren't dependencies as 
when I compile using my IDE, only the expected classes are compiled.

Even more curiously, the output of 'ant -verbose' only lists the classes I would 
expect to be compiled.

So ant/javac is stating that it is only going to compile the classes as specified in 
the includes directive, but it goes on to compile additional classes also.

The (large) project I am working on has multiple build files set up like this:

build.xml       - main build file that sets up common properties
        |-buildServer.xml       - build targets for the server code base
        |-buildPresentation.xml - build targets for the presentation code base
        ...

The main build.xml file has targets set up that merely call the corresponding targets 
in the sub-project build files.

build.xml:

<target name="compilePresentation" depends="prepare">
        <ant inheritRefs="true" antfile="${presentation.file}" 
target="compilePresentation"/>
</target>

buildPresentation.xml:

<target name="compilePresentation">
        <javac destdir="${build.dir}" debug="on" includeAntRuntime="no">
            <classpath refid="class.path"/>
            <src path="${java.src}"/>
            <include name="com/runservicenet/uwp/presentation/**"/>
            <include name="com/runservicenet/uwp/util/*"/>
            <include name="com/runservicenet/uwp/util/dataaccess/**"/>
            <include name="com/runservicenet/uwp/util/xml/**"/>
            <include name="com/runservicenet/uwp/util/http/**"/>
            <include name="com/runservicenet/uwp/server/serviceclient/**"/>
            <include name="com/runservicenet/uwp/server/serviceinstanceexecution/**"/>
            <include 
name="com/runservicenet/uwp/server/ServiceExecutionException.java"/>
        </javac>
    </target>

The above classes are being compiled, but I am also getting classes from other 
packages (com.runservicenet.uwp.resource, com.runservicenet.uwp.config, 
com.runservicenet.uwp.factory) being compiled, despite none of my code using classes 
from these additional packages.

What am I doing wrong, or is this a problem with ant 1.5?

In case you are wondering, I am using multiple build files like this to avoid having 
one honking great build file. I am using ant 1.5beta1 because when I tried using ant 
1.4.1, I couldn't get the classpath reference to be passed through to the sub-project 
build files.

Regards,
 
Giles Paterson
 
Runservicenet Limited
Tel: +44 (0)20 8288 8434
Fax: +44 (0)20 8288 8438
Email: [EMAIL PROTECTED]
 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to