ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 4372] - Javac task always generates optional -sourcepath switch
Date Thu, 20 Dec 2001 17:38:49 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4372>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4372

Javac task always generates optional -sourcepath switch





------- Additional Comments From jwinshell@bearriver.com  2001-12-20 09:38 -------
Previous comment re-entered due to lack of line breaks?

Jose/Diane,

First, thank you for the civilized answers to this bug report and the
agreement that this is in fact a bug.   I would go a little farther in
saying the content of a -sourcepath parameter should not be implicitly
derived from the source matches below either a srcdir attribute or
<src> element.   This is because there still may be sources in the
classpath you want implicitly complied.    I believe Jose's suggestion
was that I make sure that srcdir includes all directories that contain
sources that I might need to get through a compile is excessive, and
not entirely correct under all circumstances.  I'll explain.

Suppose I have two projects, A and B.    Project A depends on SOME of
the classes of project B, but not all.   I don't want to encode
specific knowledge of those dependencies into build.xml of A.   The
references of B classes by A classes already encode the dependency. 
And  SOME classes in B that are unused by A that depend on C.   If in
order to compile the Java sources of A I were to put the ProjectA/src
and ProjectB/src into a srcdir or <src> elements of a <javac>, then
the compiler would try to compile ALL the classes of projectB/src
whether classes of projectA/src referenced them or not.  Without
specifying excludes for certain sources of projectB, we would not get
through the compile of certain classes of B on C.   Assuming that
<javac> generation of -sourcepath is gone, then simply having
projectB/src in the classpath would do the trick.   If in the process
of compiling a class of projectA a reference to a class of projectB is
found it will be compiled implicitly.   Hopefully projectA correctly
refers to only those classes of B that don't depend on C (development
error).

I suppose there are other ways of structuring inter-project
dependencies, but the point is that the <javac> task should not treat
with with equivalance the set of directories corresponding to explicit
source directories (compile these files please) to those classpath
directories which can be searched for implicitly located sources when
a *.class is missing/out-of-date.   If the sun javac's behavior was to
augment implicitly found sources in the classpath with those found in
-sourcepath the generation of sourcepath would be appropriate.   But
as it stands the use of sourcepath turns off the classpath search
behavior.   Because of the this mutually exclusive behavior
-sourcepath should never generated, even if <src> elements are used
instead of srcdir.

As it stands, I've had to apply my own private patch to the ant 1.4
jar file.   Can we get this fixed soon ( NO MORE -sourcepath
generation).

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


Mime
View raw message