ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richardson, Steph" <srichard...@litle.com>
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) {
        classpath.setLocation(destDir);
    }
..................




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


Thanks,

Steph



-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Jesse Glick
Sent: Tuesday, April 19, 2005 3:04 PM
To: dev@ant.apache.org
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.

http://www.netbeans.org/source/browse/openide/build.xml?rev=1.187#do-lib
-javac-nolocaldir

(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.

-J.

-- 
jesse.glick@sun.com   x22801   netbeans.org   ant.apache.org
if I had known it was harmless I would have killed it myself


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message