Gradle plugin that integrates JaCoCo is not developed by JaCoCo Team, but 
by Gradle, so you'd better seek help from Gradle community - they by 
definition should know more about this integration.



On Wednesday, February 15, 2017 at 11:28:48 AM UTC+1, puvspra...@gmail.com 
wrote:
>
> On Wednesday, 15 February 2017 12:45:23 UTC+5:30, puvsp...@gmail.com 
>  wrote:
> > Hi,
> > 
> > Am new to jacoco and in learning phase.
> > Am unable to exclude some packages which i don't want it under code 
> coverage.
> > Using grade only.
> > 
> > Please find my jacoco.gradle file below. Am applying this jacoco.gradle 
> file in build.gradle with apply from:  'jacoco.gradle'
> > 
> > apply plugin: 'jacoco'
> > 
> > jacoco {
> >     toolVersion = "0.7.6.201602180812"
> > }
> > 
> > android {
> >     testOptions {
> >         unitTests.all {
> >             jacoco {
> >                 //includeNoLocationClasses = true
> >             }
> >         }
> >     }
> > }
> > 
> > project.afterEvaluate {
> > 
> >     android.applicationVariants.all { variant ->
> >         def name = variant.name
> >         def testTaskName = "test${name.capitalize()}UnitTest"
> > 
> >         tasks.create(name: "${testTaskName}Coverage", type: 
> JacocoReport, dependsOn: "$testTaskName") {
> >             group = "Reporting"
> >             description = "Generate Jacoco coverage reports for the 
> ${name.capitalize()} build."
> > 
> >             classDirectories = fileTree(
> >                     dir: 
> "${project.buildDir}/intermediates/classes/${name}",
> >                     excludes: ['**/R.class',
> >                                '**/R$*.class',
> >                                '**/*$ViewInjector*.*',
> >                                '**/ui/**',   // -->would like to exclude 
> this package and should not be considered.
> >                                '**/*$ViewBinder*.*',
> >                                '**/BuildConfig.*',
> >                                '**/Manifest*.*']
> >             )
> > 
> >             sourceDirectories = 
> files(['src/main/java'].plus(android.sourceSets[name].java.srcDirs))
> >             executionData = 
> files("${project.buildDir}/jacoco/${testTaskName}.exec")
> > 
> >             reports {
> >                 xml.enabled = true
> >                 html.enabled = true
> >             }
> >         }
> >     }
> > }
> > 
> > Tried with the options provided in google, no luck out of it.
> > If am not going in the right way for exclusion of packages, please 
> suggest how to exclude so that i can get accurate code coverage.
> > Not only the specified package and would like to exclude other packages 
> like interfaces, singleton and private methods too. Request you to please 
> please help me in this regard.
> > 
> > Thanks and Regards,
> > Satya Prasad.
>

-- 
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 jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/198851e3-fcec-47a2-a053-180086e5a3e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to