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 2006/04/02 19:39:29 UTC

DO NOT REPLY [Bug 39183] New: - Make source attribute of javac mandatory

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183

           Summary: Make source attribute of javac mandatory
           Product: Ant
           Version: 1.6.5
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: mathias.hasselmann@gmx.de


Everytime Sun introduces new Java keywords - let it be "assert" in Java 1.4 or
"enum" in Java 1.5 - there are zillions of Java projects stopping to compile. To
address that issue Sun was that enlightened to give javac this nice "-source"
command line switch. Unfortunatly it is not use that often.

It is my strong believe that the transition to new Java versions would be much
more pleasant, if maintainers of Java projects would be forced to explicitly
express the Java dialect the project targets. To start embracing this good
practice, Ant could make the source attribute of it's javac task mandatory.
Surly this will put some burden on the shoulders of few project maintainers
whoms projects to not compile anymore and who have to incooperate build.xml
patches adding this tiny switch. But in return it takes the burden from much the
larger group of users of those packages, who fiddle with the build.xml files
manually.

If you don't see this problem as an issue, just as a random maintainer of an OS
distributing prebuilt Java packages.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183





------- Additional Comments From stevel@apache.org  2006-04-03 21:24 -------
aah, but <presetdef> changes the type of teh return of
project.createTask("javac"), which could toast any custom task that assumed it
was castable. 

A property would let us fix everything on gump that is broken

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183





------- Additional Comments From alexeys@inventigo.com  2006-04-03 21:43 -------
>aah, but <presetdef> changes the type of teh return of
>project.createTask("javac"), which could toast any custom task that assumed it
>was castable. 

It is <presetdef> problem (or feature) that can be fixed. There is no reason for
<presetdef> to change task implementation class, instead project.createTask()
should set default values (maybe set by external properties or <presetdef>).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183





------- Additional Comments From alexeys@inventigo.com  2006-04-03 15:34 -------
A simple <presetdef> or <presetdef> with <import> (if you do not want to modify
original build file) can solve this issue. All conversation about internal
secret properties is about emulating <presetdef> with property files. I think it
is useful - it would be externally configurable, but a solution is already
available.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183


bodewig@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.7




------- Additional Comments From bodewig@apache.org  2006-04-11 19:20 -------
ant.build.javac.source and ant.build.javac.target are now there

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183


jglick@netbeans.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jglick@netbeans.org




------- Additional Comments From jglick@netbeans.org  2006-04-18 23:26 -------
I agree with Mathias on this. Wouldn't it be preferable to make the source attrs
semimandatory, warning if unset? Maybe you will get a lot of warnings from Gump
- good. To me that just means that we are informing a lot of projects built on
Gump that they forgot to do something important - set this attr, according to
the actual source level of the project being built. Using "1.4" for a 1.5
project is obviously impossible, and using "1.5" for a 1.4 project is in some
cases possible but not reliably - it may turn reasonably common code like

  Enumeration enum = loader.getResources("foo.properties");

from a warning into an error.

To Matt re. adding verbosity to builds for users who "choose to ignore the
documentation's boldface warning" - I doubt most people ever read the manual
very carefully (or at all). They see someone using <javac> somewhere, they copy
it, it seems to work, done. I can't imagine any case where you would
intentionally omit the 'source' attr except out of pure laziness.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183





------- Additional Comments From stevel@apache.org  2006-04-02 20:47 -------
I know this is a problem with building third party libraries, and I'm not happy
with it either.

But we cannot just switch on target= and source= things without breaking so many
build files out there it wouldnt be funny.

So this leaves us two other options
1. select a fixed language version (say java1.4), which is the default unless
something else is asked for.

2. add a back door property like ant._internal.javac.source which can be set to
a source to fix those build files that dont otherwise build on java1.5

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183





------- Additional Comments From gudnabrsam@yahoo.com  2006-04-19 13:57 -------
(In reply to comment #8)
> To Matt re. adding verbosity to builds for users who "choose to ignore the
> documentation's boldface warning" - I doubt most people ever read the manual
> very carefully (or at all). They see someone using <javac> somewhere, they copy
> it, it seems to work, done. I can't imagine any case where you would
> intentionally omit the 'source' attr except out of pure laziness.

Guilty.  ;)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183





------- Additional Comments From mathias.hasselmann@gmx.de  2006-04-03 08:35 -------
Guess this ant._internal.javac.source property could work to get arround all
those broken packages. As I understand this breaking apps issue: What about
issuing a warning, if "source" is not set? Don't care that much about "target"
as it is implied by "source".

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183





------- Additional Comments From gudnabrsam@yahoo.com  2006-04-03 15:22 -------
The source attribute is documented with this (bolded) warning:

Note that the default value depends on the JVM that is running Ant. We highly
recommend to always specify this attribute.

If users choose to ignore this warning in the documentation, I don't know that I
can see the point of noising up builds in addition.  :|  I would be -0 on such a
runtime warning.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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