Warnings Next Generation Plugin with CodeWarrior

51 views
Skip to first unread message

Gavin Nottage

unread,
Mar 1, 2019, 10:47:38 AM3/1/19
to Jenkins Users
I'm trying to get the number of warnings in my CodeWarrior build using the Warnings Next Generation Plugin. Whatever I try I always get 0 warnings, when the project has many.

The setup is Jenkins on a Linux host with a Windows slave node that has CodeWarrior 10.2 installed to build a Freescale Kinetis K20 project. The code is checked out fine and builds using a Windows batch command:

"C:\Freescale\CW MCU v10.2\eclipse\ecd.exe" -build -project C:\jenkins\workspace\PointColourWindowsBuild\project -config BuildConfiguration -cleanBuild

Examples of warnings in the code are:

C:/Freescale/CW MCU v10.2/MCU/ARM_Tools/Command_Line_Tools/mwccarm|Compiler|Warning
(C:\jenkins\workspace\PointColourWindowsBuild\point-colour\Sources\port\mqx\MqxUsbDescriptor.c|432|19|1|16759|1)
=     uint_32 handle,  
>variable / argument 'handle' is not used in function
C
:/Freescale/CW MCU v10.2/MCU/ARM_Tools/Command_Line_Tools/mwccarm|Compiler|Warning
(C:\jenkins\workspace\PointColourWindowsBuild\point-colour\Sources\port\mqx\MqxI2C.c|163|15|1|4665|1)
=  return(error);  
>implicit arithmetic conversion from 'unsigned long' to 'unsigned char'
C
:/Freescale/CW MCU v10.2/MCU/ARM_Tools/Command_Line_Tools/mwccarm|Compiler|Warning
(C:\jenkins\workspace\PointColourWindowsBuild\point-colour\Sources\port\mqx\MqxI2C.c|176|15|1|4977|1)
=  return(error);  
>implicit arithmetic conversion from 'unsigned long' to 'unsigned char'

The output from the Warnings Next Generation Plugin in the log is as follows:

[CodeWarrior] Sleeping for 5 seconds due to JENKINS-32191...
[CodeWarrior] Parsing console log (workspace: 'C:\jenkins\workspace\PointColourWindowsBuild')
[CodeWarrior] Attaching ResultAction with ID 'metrowerks' to run 'PointColourWindowsBuild #15'.
[CodeWarrior] Using reference build 'PointColourWindowsBuild #14' to compute new, fixed, and outstanding issues
[CodeWarrior] Issues delta (vs. reference build): outstanding: 0, new: 0, fixed: 0
[CodeWarrior] No quality gates have been set - skipping
[CodeWarrior] Health report is disabled - skipping
[CodeWarrior] Created analysis result for 0 issues (found 0 new issues, fixed 0 issues)

My Warnings Next Generation Plugin configuration is:
Tool: MetroWerks CodeWarrior
Report File Pattern: <blank>
Report Encoding: <blank>
Custom ID: <blank>
Custom Name: CodeWarrior

What am I doing wrong such that the warnings are not found? Is it possible to run just the Warnings Next Generation Plugin without needing to build the project every time?

Thanks

Ullrich Hafner

unread,
Mar 1, 2019, 5:31:55 PM3/1/19
to Jenkins Users
Seems that your warning output format looks totally different. The tests of the parser use:


Are there options to change the output format?  
signature.asc

Gavin Nottage

unread,
Mar 4, 2019, 12:38:05 PM3/4/19
to Jenkins Users
Thanks for your advice Ullrich.Digging into the project options I have managed to get it to output the warnings in gcc format, which are picked up!

For anyone reading this in the years to come (which could be me, or a member of my team), I needed to define -msgstyle gcc -nowraplines as other flags in the mwccarm compiler and again for the mwldarm linker. This overwrites the default parseable msgstyle in each .args file (which is generated from the project for each source file). This is using the console log rather than a file for reporting.

Ullrich Hafner

unread,
Mar 4, 2019, 4:45:44 PM3/4/19
to Jenkins Users
If you are interested then you could also create a small PR that describes your approach in the help of the parser:

You can use plain text or HTML in the help text, here is an example:

Then it is always visible for users of code warrior.

Am 04.03.2019 um 17:38 schrieb 'Gavin Nottage' via Jenkins Users <jenkins...@googlegroups.com>:

Thanks for your advice Ullrich.Digging into the project options I have managed to get it to output the warnings in gcc format, which are picked up!

For anyone reading this in the years to come (which could be me, or a member of my team), I needed to define -msgstyle gcc -nowraplines as other flags in the mwccarm compiler and again for the mwldarm linker. This overwrites the default parseable msgstyle in each .args file (which is generated from the project for each source file). This is using the console log rather than a file for reporting.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b71f6abc-441a-4bc0-bc0f-4230890becb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc

Gavin Nottage

unread,
Mar 7, 2019, 8:55:16 AM3/7/19
to Jenkins Users
I started to work on adding the help text as suggested, but have got very confused. I'm an embedded C programmer and while Java is mostly understandable, I haven't found a suitable guide for contributing to existing plugins. I have some experience with git, but Maven is all new to me. Whatever I try to do I get errors that mean nothing to me like:

mvn hpi:run
[INFO] Scanning for projects...
[WARNING] The POM for org.jenkins-ci.tools:maven-hpi-plugin:jar:2.7 is missing, no dependency information available
[WARNING] Failed to build parent project for io.jenkins.plugins:warnings-ng:hpi:4.0.0-SNAPSHOT


I think I know the code change to make, but cannot build or test it. The addition I think is needed is as below, and I've attached the complete file. If this is good then it can be added...

Thanks for all the efforts of the developers, if a good webpage could walk though going from nothing to building and testing a plugin, that would be really helpful.

        @Override
        public String getHelp() {
            return "<p><p>Ensure that the output from the CodeWarrior build tools is in the expected format. If there are warnings present, but they are not found, then it is likely that the format is incorrect. The mwccarm compiler and mwldarm linker tools may support a configurable message style. This can be used to enforce the expected output format, which may be different from Metrowerks CodeWarrior (and thus require a different tool). For example the following could be appended to the build flags:</p>"
                    + "<p><code>-msgstyle gcc -nowraplines</code></p></p>";
        }

MetrowerksCodeWarrior.java

Ullrich Hafner

unread,
Mar 7, 2019, 10:20:25 AM3/7/19
to Jenkins Users

Am 07.03.2019 um 13:10 schrieb Gavin Nottage <gavinn...@gmail.com>:

I started to work on adding the help text as suggested, but have got very confused. I'm an embedded C programmer and while Java is mostly understandable, I haven't found a suitable guide for contributing to existing plugins. I have some experience with git, but Maven is all new to me. Whatever I try to do I get errors that mean nothing to me like:

mvn hpi:run
[INFO] Scanning for projects...
[WARNING] The POM for org.jenkins-ci.tools:maven-hpi-plugin:jar:2.7 is missing, no dependency information available
[WARNING] Failed to build parent project for io.jenkins.plugins:warnings-ng:hpi:4.0.0-SNAPSHOT



I’ll add something to the Contributing document. I’m currently preparing a docker-based development environment for my plugin for one of my university courses. Hopefully, this will work for contributors as well.
  

I think I know the code change to make, but cannot build or test it. The addition I think is needed is as below, and I've attached the complete file. If this is good then it can be added...

Thanks for all the efforts of the developers, if a good webpage could walk though going from nothing to building and testing a plugin, that would be really helpful.

        @Override
        public String getHelp() {
            return "<p><p>Ensure that the output from the CodeWarrior build tools is in the expected format. If there are warnings present, but they are not found, then it is likely that the format is incorrect. The mwccarm compiler and mwldarm linker tools may support a configurable message style. This can be used to enforce the expected output format, which may be different from Metrowerks CodeWarrior (and thus require a different tool). For example the following could be appended to the build flags:</p>"
                    + "<p><code>-msgstyle gcc -nowraplines</code></p></p>";
        }



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
<MetrowerksCodeWarrior.java>

Reply all
Reply to author
Forward
0 new messages