ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richardson, Steph" <>
Subject RE: Re: Suggested change for <javac> classpaths
Date Tue, 26 Apr 2005 00:25:55 GMT
Thanks for the feedback Jesse - but that won't do it :

DefaultCompilerAdapter.getCompileClasspath() adds the output ( destDir
attribute ) to the classpath.
This is NOT documented in the javac task document, and is not the way
Sun's javac behaves.

You can do anything you like with selectors for sourcepaths, and
classpaths, but the DefaultCompilerAdapter is hardcoded to add it :

protected Path getCompileClasspath() {
    Path classpath = new Path(project);

    // add dest dir to classpath so that previously compiled and
    // untouched classes are on classpath

    if (destDir != null) {

So any support for includeDestDir="false|true" that would prevent this
behaviour ? 
Or should I be submitting the patch, and then asking the question ?



-----Original Message-----
From: news [] On Behalf Of Jesse Glick
Sent: Tuesday, April 19, 2005 3:04 PM
Subject: Re: Suggested change for <javac> classpaths

Richardson, Steph wrote:
> The javac task by default, adds the destination directory to the 
> classpath that is being used to compile [...]
> This option would be very useful in projects where explicit
> dependencies between packages are manually specified, and would
> prevent the need for workarounds to this problem - such as convoluted
> tricks like compiling every package in a separate temp folder, or
> compileWithWalls or VerifyDesign from Ant-Contrib.

If you must compile using different classpaths (or other compiler 
options) within a single source root, and you can't break apart your 
sources physically into separate source roots, you can still do it: use 
explicit <src/> subelements, rather than sourcedir, and include a 
<selector>, e.g.

(Too complicated to serve as a very good example - sorry.)

If there are warnings/errors from the compiler, they will be hyperlinked

to the proper sources, unlike the temp dir trick.


--   x22801
if I had known it was harmless I would have killed it myself

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message