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=34231>.
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=34231

           Summary: options in compilerarg silently overridden by defaults
                    or ignored.
           Product: Ant
           Version: 1.6.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


If compilerarg is used to specify an argument that ant supports within the task
then the argument is overridden by that default and no warning is given of this
behavior.  In this case, the argument was completely ignored.

Here is my javac task:
    <javac
        debug="${java.debug.option}"
        srcdir="${src.dir}"
        destdir="${classes.dir}">
        <classpath>
            <path refid="project.class.path"/>
        </classpath>
        <compilerarg value="-Xlint:-unchecked -target 1.4" compiler="java1.5"/>
    </javac>

Here is the ant -verbose output:

    [javac] sbc\text\parse\Extractor.java added as
sbc/text/parse/Extractor.class doesn't exist.
    [javac] sbc\text\parse\ParseEventListener.java added as
sbc/text/parse/ParseEventListener.class doesn't exist.
    [javac] sbc\text\parse\Parser.java added as sbc/text/parse/Parser.class
doesn't exist.
    [javac] sbc\text\parse\TextStreamParser.java added as
sbc/text/parse/TextStreamParser.class doesn't exist.
    [javac] Compiling 4 source files to
C:\Projects\LDTOOLS\tts\components\parse\build\classes
    [javac] Using modern compiler
dropping
C:\Projects\LDTOOLS\tts\components\parse\ProgramFilesjunit3.8.1junit.jar from
path as it doesn't exist
dropping
c:\Projects\LDTOOLS\tts\components\parse\C:\Projects\LDTOOLS\tts\components\parse\ProgramFilesjunit3.8.1junit.jar
from path as it doesn't exist
    [javac] Compilation arguments:
    [javac] '-d'
    [javac] 'C:\Projects\LDTOOLS\tts\components\parse\build\classes'
    [javac] '-classpath'
    [javac]
'C:\Projects\LDTOOLS\tts\components\parse\build\classes;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-launcher.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-antlr.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-apache-bcel.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-apache-bsf.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-apache-log4j.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-apache-oro.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-apache-regexp.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-apache-resolver.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-commons-logging.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-commons-net.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-icontract.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-jai.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-javamail.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-jdepend.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-jmf.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-jsch.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-junit.jar;C:\
 
ProgramFiles\apache-ant-1.6.2\lib\ant-netrexx.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-nodeps.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-starteam.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-stylebook.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-swing.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-trax.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-vaj.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-weblogic.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-xalan1.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant-xslp.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\ant.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\junit.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\xercesImpl.jar;C:\ProgramFiles\apache-ant-1.6.2\lib\xml-apis.jar;C:\jdk1.5.0_02\lib\tools.jar;C:\ProgramFiles\junit3.8.1\junit.jar;C:\ProgramFiles\retroweaver-1.1\release\retroweaver.jar'
    [javac] '-sourcepath'
    [javac] 'C:\Projects\LDTOOLS\tts\components\parse\src\java'
    [javac] '-g'
    [javac]
    [javac] The ' characters around the executable and arguments are
    [javac] not part of the command.
    [javac] Files to be compiled:
    [javac]    
C:\Projects\LDTOOLS\tts\components\parse\src\java\sbc\text\parse\Extractor.java
    [javac]    
C:\Projects\LDTOOLS\tts\components\parse\src\java\sbc\text\parse\ParseEventListener.java
    [javac]    
C:\Projects\LDTOOLS\tts\components\parse\src\java\sbc\text\parse\Parser.java
    [javac]    
C:\Projects\LDTOOLS\tts\components\parse\src\java\sbc\text\parse\TextStreamParser.java

Java version:
java -fullversion
java full version "1.5.0_02-b09"

If I add target="1.4" to the javac task it will compile it correctly.  I read
bug#21011 which has some similiarities.  However, this would be a bug because it
ignores your directives (overrides them perhaps) and doesn't tell you that it is
doing so, making it not function correctly or as advertised.

The solution should be to warn when an argument specified in compilerarg (or
anywhere else for that matter) is ignored, overridden or otherwise not carried
out or carried out in a manner other than specified.

This could certainly also be caused by a few other options like the
compiler="java1.5" not working correctly or some other artifact causing the
compilerarg to be ignored.

Daniel

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to