ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sdeva <d...@india.triviumsys.com>
Subject java and corresponding class files comparsion before build.
Date Wed, 30 Aug 2000 14:46:19 GMT
Consider the following target,

<target name="mypackage\exception" depends="prepare">
    <javac srcdir="mypackage\exception"
     includesfile="mypackage\exception\sourcefiles"
     destdir="${build}"/>
</target>

with build set to c:\temp and basedir set to c:\test

Here I am trying to compile java files in mypackage\exception from c:\test
into c:\temp  and the sourcefiles contain the list of sources to be
compiled.  When Ant is run for the first time on this target, it picks files
from sourcefiles and compiles them fine. C:\temp\mypackage\exception\*.class
contains all the classes I need. But, next time I run ant (without cleaning
my build area), I expected ant to do nothing as the targets are already
up-to-date. But, what happened is ant rebulild the targets again. 

I suspect that the comparison is happening without including the package of
the java file. Something like c:\test\mypackage\exception\A.java with
c:\temp\A.class. If I change my target to the one below everything works
fine ( I hope, I have not tested it yet),

<target name="mypackage\exception" depends="prepare">
    <javac srcdir="." includes="mypackage\exception\*.java"
     includesfile="mypackage\exception\sourcefiles"
     destdir="${build}"/>
</target>

But the catch here, is the sourcefiles should contain files listed with
package name. For example, A.java should be listed as
mypackage\exception\A.java in sourcefiles.  I have to go and change around
30 modules in my project to contain package names in their list of sources
in sourcefiles. 

Is this the only way or  is there some other way to hint ant for correct
comparsions including package names.

Any thoughts,

-Deva.

Srinivas Devarakonda.
http://www.triviumsys.com

Mime
View raw message