diff --git a/all/build.gradle b/all/build.gradle index 060a8d0ae2..fad1a175f0 100644 --- a/all/build.gradle +++ b/all/build.gradle @@ -60,15 +60,11 @@ jacocoTestReport { html.enabled = true } - additionalSourceDirs.from(files(subprojects.sourceSets.main.allSource.srcDirs)) - sourceDirectories.from(files(subprojects.sourceSets.main.allSource.srcDirs)) - classDirectories.from(files(subprojects.sourceSets.main.output).collect { - fileTree(dir: it, - exclude: [ - '**/io/grpc/internal/testing/**', - '**/io/grpc/okhttp/internal/**', - ]) - }) + subprojects.each { subproject -> + additionalSourceDirs.from(subproject.jacocoTestReport.additionalSourceDirs) + sourceDirectories.from(subproject.jacocoTestReport.sourceDirectories) + classDirectories.from(subproject.jacocoTestReport.classDirectories) + } } coveralls { diff --git a/okhttp/build.gradle b/okhttp/build.gradle index 1f0e4eaf70..b594600c2d 100644 --- a/okhttp/build.gradle +++ b/okhttp/build.gradle @@ -36,3 +36,12 @@ checkstyleMain.exclude '**/io/grpc/okhttp/internal/**' javadoc.exclude 'io/grpc/okhttp/internal/**' javadoc.options.links 'http://square.github.io/okhttp/2.x/okhttp/' + +jacocoTestReport { + classDirectories.from = sourceSets.main.output.collect { + fileTree(dir: it, + exclude: [ + '**/io/grpc/okhttp/internal/**', + ]) + } +} diff --git a/testing/build.gradle b/testing/build.gradle index 7365d7d53f..54c9dff6d0 100644 --- a/testing/build.gradle +++ b/testing/build.gradle @@ -33,3 +33,12 @@ dependencies { } javadoc { exclude 'io/grpc/internal/**' } + +jacocoTestReport { + classDirectories.from = sourceSets.main.output.collect { + fileTree(dir: it, + exclude: [ + '**/io/grpc/internal/testing/**', + ]) + } +}