ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Priest <Robert.Pri...@bentley.com>
Subject RE: Entire source compiling EVERY time
Date Fri, 31 May 2002 22:14:48 GMT
Okay, i one more about this topic. The solution you gave me worked for most
of my compiles. but I have two in particular that always seem to get
compiled. This time I am only including the file that I want to compile.

Does anyone know why these gets compiled everytime?
I should say that these files are modifications of files that are included
in jars in my classpath.
Is it an issue with those items there? Specifying this WEB_OUT dir in the
classpath before the jars
that have older versions of them.

Here are the lines:

<javac srcdir="${WEB_SOURCE}" destdir="${WEB_OUT}"
 
includes="patches/tomcat/${env.DMS_TOMCAT_VERSION}/org/apache/ajp/tomcat4/Aj
p13Principal.java"
     listfiles="yes"
     />

<javac srcdir="${WEB_SOURCE}" destdir="${WEB_OUT}"
 
includes="patches/cocoon/${env.DMS_COCOON_VERSION}/org/apache/cocoon/Utils.j
ava"
     listfiles="yes"
     />


-----Original Message-----
From: Robert Priest 
Sent: Wednesday, May 22, 2002 2:56 PM
To: 'Ant Users List'
Subject: RE: Entire source compiling EVERY time


Thanks Jon. I think I understand now.But I have another question (more about
style I guess):

I have a file under "com\projectwise\web\client\base" called
PWClientStarter.java. That is still getting compiled everytime.
Now I changed my target to look like:

<target name="com" depends="prepare">
    <javac srcdir="${WEB_SOURCE}" destdir="${WEB_OUT}"
     includes="com\**"
     excludes="com\projectwise\web\client\pwviewer\**"
     listfiles="yes"
     />
   </target>

which works fine for everything except this one particular file. 
Now that one file does not have a "package" line. 
Is that what causes it to be compiled everytime? 

I was able to rectify it by doing a:

 <target name="com" depends="prepare">
    <javac srcdir="${WEB_SOURCE}" destdir="${WEB_OUT}"
     includes="com\**"
 
excludes="com\projectwise\web\client\pwviewer\**,com\projectwise\web\client\
base\PWClientStarter.java"
     listfiles="yes"
     />
     <javac srcdir="${WEB_SOURCE}\com\projectwise\web\client\base"
destdir="${WEB_OUT}"
     includes="PWClientStarter.java"
     listfiles="yes"
     />
   </target>


Is that the most elegant way of doing this, or is there a better way?



-----Original Message-----
From: Jon Skeet [mailto:jon.skeet@peramon.com]
Sent: Wednesday, May 22, 2002 1:40 PM
To: Ant Users List
Subject: RE: Entire source compiling EVERY time


> Here is my what my target looks like:
> 
>  <target name="compile" depends="prepare">
>     <javac srcdir="${WEB_SOURCE}\com\projectwise\web\common"
> destdir="${WEB_OUT}" />
>     <javac srcdir="${WEB_SOURCE}\com\projectwise\web\server"
> destdir="${WEB_OUT}" />
>     <javac srcdir="${WEB_SOURCE}\com\projectwise\web\client"
> destdir="${WEB_OUT}" 
>      excludes="pwviewer\**"
>      />
>    </target>

That's your problem - you should be using:

<javac srcdir="${WEB_SOURCE}" destdir="${WEB_OUT}" />

and using a filter to get only those directories if that's all you want -
otherwise javac thinks that the srcdir value is the *root* of your package
tree.

Jon

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message