You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Brooks Duncan <BD...@sideware.com> on 2001/03/15 20:38:30 UTC

Ant not building all files

Hi there,

I have a situation where we have a bunch of Java files in packages, and to
compile for our jar file, we would do something like this:

javac com\blah\blah\Blah.java , and that will compile Blah.java and any
source files under it that Blah.java references (obviously).

However, when I use Ant with this in my buildfile:

<javac srcdir="." destdir="${myBuildDir}">
   <classpath>
    <pathelement path="." />
    <pathelement path="${Env.EIS_HOME}/lib/jsdt.jar" />
   </classpath>
     <include name="com\blah\blah\Blah.java" /> 
    </javac>

It will ONLY compile Blah.java .. it doesn't seem to be compiling all the
other files "under it", or if it is it's not moving them to the destdir.

Can anyone give me an idea on how to do what I want?  Compiling just the
srcdir to force it to compile EVERYTHING isn't an option, because there are
other files under com/blah/blah that are not used for this particular JAR
file.

Brooks Duncan 

Re: Ant not building all files

Posted by Stefan Bodewig <bo...@apache.org>.
Brooks Duncan <BD...@sideware.com> wrote:

> <javac srcdir="." destdir="${myBuildDir}">
>    <classpath>
>     <pathelement path="." />
>     <pathelement path="${Env.EIS_HOME}/lib/jsdt.jar" />
>    </classpath>
>      <include name="com\blah\blah\Blah.java" /> 
>     </javac>
> 
> It will ONLY compile Blah.java .. it doesn't seem to be compiling
> all the other files "under it", or if it is it's not moving them to
> the destdir.

[where "under it" means, the classes Blah depends upon]

Seems as if the classes Blah needs are in your CLASSPATH - so javac
can find - and won't (re)compile  - them.

Does depend="on" help here? Not available when using the modern
compiler, as Sun has dropped this feature.

Stefan