You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/08/14 17:46:52 UTC
DO NOT REPLY [Bug 22427] New: -
javac task to compile files independently
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=22427>.
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=22427
javac task to compile files independently
Summary: javac task to compile files independently
Product: Ant
Version: 1.5.3
Platform: All
OS/Version: All
Status: NEW
Severity: Enhancement
Priority: Other
Component: Core tasks
AssignedTo: dev@ant.apache.org
ReportedBy: jtulach@netbeans.org
CC: jesse.glick@netbeans.com
Problem description:
I have a lot of .java files in src/ directory and they form a logical groups
which I would like to compile separately. Of course I could move the files into
group1/src, group2/src, but that would mean that I loose CVS history of each
file (we have horrible relation with our CVS server maintainer). That is why I
decided to convince javac to compile the files separatelly even the sources
share the same root. Surprisingly it is possible - one just does not specify
-sourcepath, only names all the files to compile with full name and javac does
not try to search for files not explicitly enumerated as arguments.
I have tried to do the same with Ant <javac> task, but it seems there is no way
to *not* specify the sourcepath and just enumerate the files (I understand,
there would be no way to check whether the files are already compiled or not).
Let say that I would like to do something like this:
<!-- compile group1 -->
<javac destdir="group1/dest" >
<include name="src/org/group1/**/*.java" />
</javac>
<!-- compile group2 -->
<javac destdir="group2/dest" >
<include name="src/org/group2/**/*.java" />
</javac>
and be sure that if by a chance file in group2 references file in group1 that
the second compilation fails.
Request:
========
I would like the <javac> task to allow compilation without specifying the
sourcepath. Then the above described behaviour of javac could be used and my
separation could work.
Workaround:
Actually there is a workaround of this problem. But it relies on the "srcdirnote":
http://ant.apache.org/manual/CoreTasks/javac.html#srcdirnote
and I am affraid it could be broken with future version of ant. The trick is
based on specification of wrong sourcepath (src/org instead of src) and then
moving the compiled classes at right location. See it at:
http://www.netbeans.org/source/browse/openide/build.xml.diff?r1=1.148.4.16&r2=1.148.4.17
I would be glad if we could remove this hack in some version of ant with
improved <javac>. Regards.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org