Hi,

the Jenkins plugin is a separate project. Please see documentation what is included by the JaCoCo project:

http://eclemma.org/jacoco/trunk/doc/integrations.html

You'll find the links to the other projects maintaining the respective integrations.

Regards,
-marc

On 05.03.16 01:28, [email protected] wrote:
I am using the following script for jacoco code coverage. HTML reports display 
correct results, where as the exec files show 0% coverage. I am using JUnit 
testing, and my Unit tests are located at app/src/test/. I am trying to use 
this jacoco.exec in jenkins to display my results. My jenkins is setup using 
amtrix project plugin. What am I doing wrong?

apply plugin: 'jacoco'

jacoco {
     toolVersion = "0.7.5.201505241946"
}

project.afterEvaluate {
     // Grab all build types and product flavors
     def buildTypes = android.buildTypes.collect { type -> type.name }
     def productFlavors = android.productFlavors.collect { flavor -> 
flavor.name }

     // When no product flavors defined, use empty
     if (!productFlavors) productFlavors.add('')

     productFlavors.each { productFlavorName ->
         buildTypes.each { buildTypeName ->
             def sourceName, sourcePath
             if (!productFlavorName) {
                 sourceName = sourcePath = "${buildTypeName}"
             } else {
                 sourceName = 
"${productFlavorName}${buildTypeName.capitalize()}"
                 sourcePath = "${productFlavorName}/${buildTypeName}"
             }
             def testTaskName = "test${sourceName.capitalize()}UnitTest"

             // Create coverage task of form 'testFlavorTypeCoverage' depending 
on 'testFlavorTypeUnitTest'
             task "${testTaskName}Coverage" (type:JacocoReport, dependsOn: 
"$testTaskName") {
                 group = "Reporting"
                 description = "Generate Jacoco coverage reports on the 
${sourceName.capitalize()} build."

                 classDirectories = fileTree(
                         dir: 
"${project.buildDir}/intermediates/classes/${sourcePath}",
                         excludes: ['**/R.class',
                                    '**/R$*.class',
                                    '**/*$ViewInjector*.*',
                                    '**/*$ViewBinder*.*',
                                    '**/BuildConfig.*',
                                    '**/Manifest*.*']
                 )

                 def coverageSourceDirs = [
                         "src/main/java",
                         "src/$productFlavorName/java",
                         "src/$buildTypeName/java"
                 ]
                 additionalSourceDirs = files(coverageSourceDirs)
                 sourceDirectories = files(coverageSourceDirs)
                 executionData = 
files("${project.buildDir}/jacoco/${testTaskName}.exec")

                 reports {
                     xml.enabled = true
                     html.enabled = true
                                        html.destination = 
"${System.getenv('View_Root')}/_Build/Jacoco"
                 }
             }
         }
     }
}



--
You received this message because you are subscribed to the Google Groups "JaCoCo 
and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/56DDD479.3080301%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to