Skip to content

Commit

Permalink
Add jacocoFullReport task
Browse files Browse the repository at this point in the history
  • Loading branch information
ekigamba committed Jul 29, 2022
1 parent ecb5a89 commit a1ca3cc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
39 changes: 29 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.10.2'
classpath 'gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.12.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
//classpath 'com.palantir:jacoco-coverage:0.4.0'
// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -24,6 +24,7 @@ buildscript {
//apply plugin: 'com.palantir.jacoco-full-report'
apply plugin: 'com.github.kt3k.coveralls'


allprojects {
repositories {
google()
Expand All @@ -43,10 +44,13 @@ allprojects {
}*/
}
}

/*
task clean(type: Delete) {
delete rootProject.buildDir
}
*/

apply plugin: 'java'

ext {
supportVersion = '1.0.0'
Expand All @@ -59,22 +63,37 @@ ext {
mapboxAnnotationPluginVersion = "0.6.0"
}

/*
coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoFullReport/jacocoFullReport.xml"
sourceDirs += ["utils/src/main/java"
, "library/src/main/java"
, "sample/src/main/java"
, "wrapper/src/main/java"]
}
*/

subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.getkeepsafe.relinker') {
details.useVersion "1.2.2"
task jacocoFullReport(type: JacocoReport, group: 'Coverage reports') {
description = 'Generates an aggregate report from all subprojects'

additionalSourceDirs.from = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(subprojects.sourceSets.main.output)

List<File> executionDataPaths = new ArrayList<>()
for (subModule in subprojects) {
def jacocoTestReportTask = subModule.getTasksByName("jacocoTestReport", false)
jacocoTestReportTask.forEach({task ->
if (task instanceof JacocoReport) {
System.out.println("This is a JacocoReport task: " + task.name)
executionDataPaths.addAll((task as JacocoReport).executionData.getFiles())
}
}
})
}

executionData.from = executionDataPaths

reports {
html.enabled true
xml.enabled true
}
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.ona.kujaku.downloaders;

import android.app.Instrumentation;
import android.content.Context;

import com.mapbox.mapboxsdk.Mapbox;
Expand Down

0 comments on commit a1ca3cc

Please sign in to comment.