ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steffen Euch <...@ep-ag.com>
Subject javac task compiles missing files automatically
Date Mon, 16 Jul 2001 12:54:43 GMT
Hi!

I don't want Ant to search missing source files automatically.

${PRJ_SOURCE} is the parent directory of "com", the root of our packet
structure: U:\foo\java\src
The patternset, which is passed to this generic target below, lists all
the directories, that java files should be compiled. But if one of these
files uses a class that isn't in this directories javac compiles it 
anyhow. I want such a javac job to fail.

Why: The java files of our modules aren't allowed to use classes of all 
other modules. They should use only those, which they are allowed to.
These allowed classes are available as jar files.
Usages of classes of a forbidden module should be detected by a failed 
javac job.

This is the code I use:

<target name="genericCompileAndCopy">
   <javac srcdir="${PRJ_SOURCE}"
       destdir="${PRJ_CLASSES}"
       classpath="."
       debug="on"
       deprecation="off"
       optimize="off"
       failonerror="yes"
       includeantruntime="no"
       depend="no"
       verbose="yes"
   >
     <patternset refid="${generic.patternset}"/>
   </javac>
...
</target>

This is the output in vebose mode of ant:
     [javac] Using modern compiler
     [javac] Compilation args: -d D:\test\classes -classpath
D:\test\classes -sourcepath U:\foo\java\src -g -verbose

Can somebody tell me how to solve this problem?
And is it the right way to place the "allowed" jar files as nested <src> 
elements into the <javac> task?

Thanks in advance,

Steffen


Mime
View raw message