Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-2308

Accept ecj warnings

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • warnings-plugin
    • None
    • Platform: All, OS: All

    Description

      Could you please support ecj (the eclipse compiler) warnigns? They are like:

      [javac] Compiling 34 source files to
      D:\Desenvolvimento\hudson\data\jobs\jfg\workspace\build\build\warning
      [javac] ----------
      [javac] 1. WARNING in
      D:\Desenvolvimento\hudson\data\jobs\jfg\workspace\src\jfg\AttributeException.java (at
      line 3)
      [javac] public class AttributeException extends RuntimeException
      [javac] ^^^^^^^^^^^^^^^^^^
      [javac] The serializable class AttributeException does not declare a static
      final serialVersionUID field of type long
      [javac] ----------
      [javac] ----------
      [javac] 2. WARNING in
      D:\Desenvolvimento\hudson\data\jobs\jfg\workspace\src\jfg\gui\swt\SWTTextBuilder.java
      (at line 85)
      [javac] protected void addValidation(Text text, Object type)
      [javac] ^^^^
      [javac] The parameter text is never read
      [javac] ----------
      [javac] 3. WARNING in
      D:\Desenvolvimento\hudson\data\jobs\jfg\workspace\src\jfg\gui\swt\SWTTextBuilder.java
      (at line 85)
      [javac] protected void addValidation(Text text, Object type)
      [javac] ^^^^
      [javac] The parameter type is never read
      [javac] ----------
      [javac] 4. WARNING in
      D:\Desenvolvimento\hudson\data\jobs\jfg\workspace\src\jfg\gui\swt\SWTTextBuilder.java
      (at line 89)
      [javac] protected String convertToString(Text text, Object value, Object type)
      [javac] ^^^^
      [javac] The parameter text is never read
      [javac] ----------
      [javac] 4 problems (4 warnings)

      Thanks

      Attachments

        1. output.txt
          3 kB
          pescuma
        2. output.txt
          0.5 kB
          pescuma

        Activity

          drulli Ulli Hafner added a comment -

          Which version of the Eclipse compiler are you using? (javac indicates SUN
          compiler and not the eclipse compiler?). Do you use the eclipse compiler with
          ant (PDE build) or with maven?

          Could you please attach the log messages as a text file, too. I'm not sure if
          the line breaks are conserved in the textfield (and these are important for the
          parser.).

          drulli Ulli Hafner added a comment - Which version of the Eclipse compiler are you using? (javac indicates SUN compiler and not the eclipse compiler?). Do you use the eclipse compiler with ant (PDE build) or with maven? Could you please attach the log messages as a text file, too. I'm not sure if the line breaks are conserved in the textfield (and these are important for the parser.).
          pescuma pescuma added a comment -

          I'm using it with ant. javac can run "any" compiler. To use eclipse compiler
          with it you have to:
          1. Donwload http://download.eclipse.org/eclipse/downloads/drops/R-3.4-
          200806172000/download.php?dropFile=ecj-3.4.jar and put it in ANT_HOME/lib
          2. In ant xml, use the javac line like
          <javac srcdir="${src}" destdir="${build}"
          compiler="org.eclipse.jdt.core.JDTCompilerAdapter" source="1.5" target="1.5">
          <classpath>
          <fileset dir="${libs.src}">
          <include name="*.jar" />
          </fileset>
          </classpath>
          <compilerarg line="-warn:+unused -warn:+hiding" />
          </javac>

          To see a warning, create a class with an unused variable inside some method.

          Anyway, I'll attach an example output

          pescuma pescuma added a comment - I'm using it with ant. javac can run "any" compiler. To use eclipse compiler with it you have to: 1. Donwload http://download.eclipse.org/eclipse/downloads/drops/R-3.4- 200806172000/download.php?dropFile=ecj-3.4.jar and put it in ANT_HOME/lib 2. In ant xml, use the javac line like <javac srcdir="${src}" destdir="${build}" compiler="org.eclipse.jdt.core.JDTCompilerAdapter" source="1.5" target="1.5"> <classpath> <fileset dir="${libs.src}"> <include name="*.jar" /> </fileset> </classpath> <compilerarg line="-warn:+unused -warn:+hiding" /> </javac> To see a warning, create a class with an unused variable inside some method. Anyway, I'll attach an example output
          pescuma pescuma added a comment -

          Created an attachment (id=369)
          ant output

          pescuma pescuma added a comment - Created an attachment (id=369) ant output
          pescuma pescuma added a comment -

          One more thing: this output was created in a windows machine

          pescuma pescuma added a comment - One more thing: this output was created in a windows machine
          pescuma pescuma added a comment -

          Created an attachment (id=370)
          ant output with a lot of warnings

          pescuma pescuma added a comment - Created an attachment (id=370) ant output with a lot of warnings

          Code changed in hudson
          User: : drulli
          Path:
          trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/AntEclipseParser.java
          trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/HpiCompileParser.java
          trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/MavenParser.java
          trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java
          trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/RegexpParser.java
          trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/AntEclipseParserTest.java
          trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/AntJavacParserTest.java
          trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/ParserRegistryTest.java
          trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/all.txt
          trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/eclipse.txt
          http://fisheye4.cenqua.com/changelog/hudson/?cs=12112
          Log:
          [FIXED JENKINS-2308] Added parser for Eclipse compiler warnings.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : drulli Path: trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/AntEclipseParser.java trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/HpiCompileParser.java trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/MavenParser.java trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/RegexpParser.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/AntEclipseParserTest.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/AntJavacParserTest.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/ParserRegistryTest.java trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/all.txt trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/eclipse.txt http://fisheye4.cenqua.com/changelog/hudson/?cs=12112 Log: [FIXED JENKINS-2308] Added parser for Eclipse compiler warnings.
          pescuma pescuma added a comment -

          Thanks, it works

          pescuma pescuma added a comment - Thanks, it works

          People

            drulli Ulli Hafner
            pescuma pescuma
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: