I changed the instrumentation metaDataFilePath to a central location so all
of the subproject's metadata goes into one single coverage.em, instead of a
bunch of individual sub-project metadata.emma files. This coverage.em is
the file I'm trying to push into Sonar.
I'm able to get debug info using the -d option on the command line, but
there are no errors. I see messages like these, but nothing else
interesting.
INFO system.out - metadata merged into [/work/bzr/components/
hc.co/coverage/coverage.em] {in 52 ms}
INFO system.out - EMMA: runtime coverage data merged into
[/work/bzr/components/hc.co/hc-impl/coverage.ec] {in 40 ms}
...
INFO system.out - writing [html] report to [/work/bzr/components/
hc.co/coverage/coverage.html] ...
INFO system.out - writing [xml] report to [/work/bzr/components/
hc.co/coverage/coverage.xml] ...
INFO system.out - writing [txt] report to [/work/bzr/components/
hc.co/coverage/coverage.txt] ...
On Wed, Oct 20, 2010 at 9:22 AM, Rene Groeschke <[email protected]> wrote:
> Hi,
>
> Am Mi, 20.10.2010, 01:32, schrieb Thomas Carlier:
> > Hi Rene:
> >
> >
> > I tried a whole bunch renaming schemes without success.
> >
> >
> > The closest I got to making this work was renaming the metadata file:
> > metadata.emma -> coverage.em. The file uploads successfully (mvn
> > sonar:sonar), but the Sonar server shows "0%" coverage for every
> > package/class that I have unit tests for. The coverage field is blank
> for
> > packages with no unit tests, so It does seem to at least partially read
> > the file.
>
> According to the emma faq (http://emma.sourceforge.net/faq.html) you're
> right, that the convention for metadata file is using an ending like ec or
> em. so the metadata file is the file sonar needs. If you create a report
> file from this metadata file, is the code coverage in this created report
> 0 too?
>
> Another thing to try: Could you try to set the verbosityLevel to "debug"
> to see some more output on your console.
>
>
> regards,
> René
>
>
> >
> > There are no options that I can see in Sonar for setting the emma file
> > type.
> >
> > --- Tom C.
> >
> >
> > On Tue, Oct 19, 2010 at 4:02 PM, Rene Groeschke <[email protected]>
> > wrote:
> >
> >
> >> Hi thomas,
> >> It seems, that the sonar emma plugin expects the emma report in a file
> >> called "coverage.em". I'm not sure about the content type, but I would
> >> try to rename the output file of the xml report to coverage.em instead
> >> of coverage.xml and see if this fits sonars needs.
> >>
> >> regards, René
> >>
> >>
> >> Am 19.10.10 20:59, schrieb Thomas Carlier:
> >>
> >>> The emma.gradle plugin seems to be producing different kinds of
> >>> coverage files than Sonar is expecting.
> >>>
> >>> I'm getting this error:
> >>>
> >>>
> >>> Embedded error: java.io.IOException: input file does not exist:
> >>> [/work/bzr/components/hc.co/coverage/coverage.em]
> >>>
> >>>
> >>> with this in build.gradle to create the report files
> >>>
> >>> ant.emma(enabled:"true"){
> >>> report(sourcepathref:"src.path"){
> >>> fileset(dir:"."){
> >>> include(name:"**/metadata.emma")
> >>> }
> >>> fileset(dir:"."){
> >>> include(name:"**/coverage.ec")
> >>> }
> >>> html(outfile:"coverage.html")
> >>> xml(outfile:"coverage/coverage.xml")
> >>> txt(outfile:"coverage/coverage.txt")
> >>> }
> >>> }
> >>>
> >>>
> >>> and this in my pom.xml
> >>>
> >>> <properties>
> >>> <sonar.phase>generate-sources</sonar.phase>
> >>> <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
> >>> <sonar.surefire.reportsPath></sonar.surefire.reportsPath>
> >>> <sonar.core.codeCoveragePlugin>emma</sonar.core.codeCoveragePlugin>
> >>> <sonar.emma.reportPath>coverage</sonar.emma.reportPath>
> >>> </properties>
> >>>
> >>>
> >>> any ideas?
> >>>
> >>> --- Tom C.
> >>>
> >>>
> >>>
> >>> On Mon, Oct 18, 2010 at 11:37 PM, Rene Groeschke <[email protected]
> >>> wrote:
> >>>
> >>>
> >>>> Hi,
> >>>>
> >>>>
> >>>> the more elegant way to customize your pom file is to use the maven
> >>>> polyglot groovy builder: ________________________
> >>>> apply plugin:'java' apply plugin:'maven'
> >>>>
> >>>> group = 'org.acme' version = '0.1-SNAPSHOT'
> >>>>
> >>>> task exportPom << { pom { project { properties{
> 'sonar.dynamicAnalysis'
> >>>> 'false'
> >>>> }
> >>>> }
> >>>> }.writeTo("pom.xml")
> >>>> }
> >>>> ________________________
> >>>>
> >>>>
> >>>> some people report some problems while using this builder (e.g: see
> >>>>
> >>>>
> >>>>
> >> http://gradle.markmail.org/search/?q=withXml#query:withXml+page:1+mid:r
> >> q3xbbvi32glmi4v+state:results
> >>
> >>>> )
> >>>>
> >>>>
> >>>> but with the withXml hook you have full control of the created xml
> >> output.
> >>>>
> >>>> regards, René
> >>>>
> >>>>
> >>>> Am Mo, 18.10.2010, 22:30, schrieb Rene Groeschke:
> >>>>
> >>>>> Hi Thomas,
> >>>>> according to the description at
> >>>>> http://docs.codehaus.org/display/SONAR/Analyzing+Java+Projects
> >>>>> you definitely need a pom.xml to get sonar working.
> >>>>>
> >>>>> exporting and manipulating a pom.xml with gradle is easy. you can
> >>>>> start with this snippet:
> >>>>>
> >>>>> --------------
> >>>>> apply plugin:'java' apply plugin:'maven'
> >>>>>
> >>>>> group = 'org.acme' version = '0.1-SNAPSHOT'
> >>>>>
> >>>>>
> >>>>> def SONAR_PROP_DYN_ALIAS = """\ <properties>
> >>>>> <sonar.dynamicAnalysis>false</sonar.dynamicAnalysis>
> >>>>> </properties>
> >>>>> """
> >>>>>
> >>>>>
> >>>>>
> >>>>> task exportPom << { pom { withXml { xmlProvider -> def xml =
> >>>>> xmlProvider.asString() xml.insert(xml.lastIndexOf('</project>'),
> >>>>> SONAR_PROP_DYN_ALIAS)
> >>>>> }
> >>>>> }.writeTo("pom.xml")
> >>>>> }
> >>>>> --------------
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> regards, René
> >>>>>
> >>>>>
> >>>>> ps.: I had a look on the sonar mvn plugin. maybe we could port it
> >>>>> to support gradle more nativly. any volunteers?
> >>>>>
> >>>>> bye bye
> >>>>>
> >>>>>
> >>>>>
> >>>>> Am 18.10.10 20:26, schrieb Thomas Carlier:
> >>>>>
> >>>>>
> >>>>>> Hi Rene:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> That's what I've found out so far. I've been hoping to find a
> >>>>>> gradle plugin that would make the necessary maven calls to
> >>>>>> Sonar. Otherwise,
> >>>>>> I'm thinking
> >>>>>> it would be nice to have an 'export to pom.xml' command within
> >>>>>> gradle
> >> so
> >>>>>> we wouldn't have to maintain 2 configuration files, just to use
> >>>>>> Sonar.
> >>>>>> (yes,
> >>>>>> we really want to use Sonar *and* stay with gradle).
> >>>>>>
> >>>>>> I hope someone can help me find my way through the maze of
> >>>>>> (what seems
> >>>>>> to be) disconnected technologies.
> >>>>>>
> >>>>>> Thanks,
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --- Tom C.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Sat, Oct 16, 2010 at 5:26 AM, Rene Groeschke
> >>>>>> <[email protected]>
> >>>>>> wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>> Hi Tom,
> >>>>>>> sorry, I've mixed up Sonar and Nexus by Sonartype. I think you
> >>>>>>> mean http://www.sonarsource.org/. I can't find an API
> >>>>>>> description on how to deploy your measures to Sonar. It seems
> >>>>>>> to be hardly wired with maven.
> >>>>>>>
> >>>>>>> regards, René
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> Am 16.10.10 13:29, schrieb Thomas Carlier:
> >>>>>>>
> >>>>>>>
> >>>>>>>> Hi Rene:
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Sonar is not an artifact repository. It's an open source
> >>>>>>>> quality
> >>>>>>>>
> >>>>>>> management
> >>>>>>>> platform, dedicated to continuously analyze and measure
> >>>>>>>> technical
> >>>>>>> quality,
> >>>>>>>> from the project portfolio to the class method.
> >>>>>>>>
> >>>>>>>> I'd like to use it for tracking the emma code coverage
> >>>>>>>> trends over time
> >>>>>>> (and
> >>>>>>>
> >>>>>>>
> >>>>>>>> other code health metrics).
> >>>>>>>>
> >>>>>>>> --- Tom C.
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On Thu, Oct 14, 2010 at 8:26 PM, Rene Groeschke
> >>>>>>>> <[email protected]>
> >>>>>>>>
> >>>>>>>>
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>>>> Hi Thomas,
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> there was a discussion on how to do handle/upload a
> >>>>>>>>> custom produced file (DLL in this example) with gradle and
> >>>>>>>>> artifactory on this mailinglist. Take a look at
> >>>>>>>>> http://markmail.org/message/niseybxbjynckr2c
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> regards, René
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Am 15.10.10 02:40, schrieb Thomas Carlier:
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>> I have my gradle build producing emma code coverage
> >>>>>>>>>> reports and I'd
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>> like
> >>>>>>>>> to
> >>>>>>>>>> upload them to a Sonar server.
> >>>>>>>>>>
> >>>>>>>>>> Can anyone help me understand the syntax for this?
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> Thanks,
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> --- Tom C.
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>> --
> >>>>>>>>> ------------------------------------
> >>>>>>>>> Rene Groeschke
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> [email protected] http://www.breskeby.com
> >>>>>>>>> http://twitter.com/breskeby
> >>>>>>>>> ------------------------------------
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> ---------------------------------------------------------
> >>>>>>>>> --------
> >>>>>>>>> ----
> >>>>>>>>> To unsubscribe from this list, please visit:
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> http://xircles.codehaus.org/manage_email
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>> --
> >>>>>>> ------------------------------------
> >>>>>>> Rene Groeschke
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> [email protected] http://www.breskeby.com
> >>>>>>> http://twitter.com/breskeby
> >>>>>>> ------------------------------------
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> -------------------------------------------------------------
> >>>>>>> --------
> >>>>>>> To unsubscribe from this list, please visit:
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> http://xircles.codehaus.org/manage_email
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>
> >>>>> --
> >>>>> ------------------------------------
> >>>>> Rene Groeschke
> >>>>>
> >>>>>
> >>>>>
> >>>>> [email protected] http://www.breskeby.com
> >>>>> http://twitter.com/breskeby
> >>>>> ------------------------------------
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> -----------------------------------------------------------------
> >>>>> ----
> >>>>> To unsubscribe from this list, please visit:
> >>>>>
> >>>>>
> >>>>>
> >>>>> http://xircles.codehaus.org/manage_email
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------
> >>>> --
> >>>> To unsubscribe from this list, please visit:
> >>>>
> >>>>
> >>>> http://xircles.codehaus.org/manage_email
> >>>>
> >>>>
> >>>>
> >>>>
> >>
> >>
> >> --
> >> ------------------------------------
> >> Rene Groeschke
> >>
> >>
> >> [email protected] http://www.breskeby.com
> >> http://twitter.com/breskeby
> >> ------------------------------------
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>
> >> http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >>
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>