ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Bondarenko" <ente...@gmail.com>
Subject Re: javac task problem in Java 6
Date Tue, 04 Nov 2008 14:21:46 GMT
Well, I tried javac:

javac -sourcepath A.java -classpath b.jar A.java
It works properly in both JDK 5 and 6.

But Ant's javac task with "includes" and "excludes" does not work with JDK
6.

So I am not sure that problem is in javac compiler. It looks like there is a
problem in javac Ant task.
Could anybody please check it?
Is there any way to look at exact javac invocation string that is produced
for the build script?

Regards,
Sergey Bondarenko.


2008/11/4 Jess Holle <jessh@ptc.com>

> I am rather certain this is a javac bug -- though it would be good to
> /prove /that from a javac command line so as to get some focus on the real
> issue here.
>
> I believe Sun should take this particular issue seriously.  We've seen this
> before where A depends on B which /internally/ depends upon C and then
> suddenly one has to have C around to compile A.  That extends compilation
> dependencies across decoupling points one designs in and breaks library
> opacity / encapsulation.  This whole issue needs to be taken seriously and
> nailed by Sun.  It impacts Ant, of course, but this in turn impacts
> NetBeans.  It also impacts everything that uses their compiler rather than
> JDT.  Overall this issue should not be tolerated.
>
> --
> Jess Holle
>
>
> Stefan Bodewig wrote:
>
>> On Tue, 4 Nov 2008, Sergey Bondarenko <enterit@gmail.com> wrote:
>>
>>
>>
>>> Regarding compilation issue, it looks like Ant javac task does not
>>> handle "includes" and "excludes" attributes correctly when it is
>>> used with JDK 6.  But it works properly with JDK 5.
>>>
>>>
>>
>> Uhm, no.
>>
>> includes/excludes controls which source files are being sent to
>> javac's command line.  If javac decides that it needs to compile
>> additional classes that it can find inside the source path, then there
>> is nothing that Ant can do.
>>
>> Inside the manual page for the javac task you will find (under
>> examples):
>>
>> ,----
>> | If you wish to compile only files explicitly specified and disable
>> | javac's default searching mechanism then you can unset the sourcepath
>> | attribute:
>> | |   <javac sourcepath="" srcdir="${src}"
>> |          destdir="${build}" >
>> |     <include name="**/*.java"/>
>> |     <exclude name="**/Example.java"/>
>> |   </javac>
>> | | That way the javac will compile all java source files under "${src}"
>> | directory but skip the examples. The compiler will even produce errors
>> | if some of the non-example files refers to them.
>> `----
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>>
>>
>>
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message