Skip to content

Commit

Permalink
Fix JaCoCo configuration for Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
vgaidarji committed Dec 4, 2023
1 parent 502aa94 commit bf11045
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
//apply from: 'config/quality.gradle'
//apply from: 'config/jacoco.gradle'
apply from: 'config/jacoco.gradle'
//apply from: 'config/coveralls.gradle'

def versionMajor = 1
Expand Down Expand Up @@ -49,9 +49,6 @@ android {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
testCoverageEnabled = true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
Expand Down
10 changes: 5 additions & 5 deletions app/config/jacoco.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ ext {
}

jacoco {
toolVersion = "0.7.5.201505241946"
reportsDir = file("$buildDir/reports")
toolVersion = "0.8.11"
reportsDirectory = file("$buildDir/reports")
}

task jacocoTestReport(type:JacocoReport, dependsOn: "testDebugUnitTest") {
group = "Reporting"
description = "Generate Jacoco coverage reports for Debug build"
classDirectories = fileTree(
dir: "$buildDir/intermediates/classes/debug",
dir: "$buildDir/tmp/kotlin-classes/debug",
excludes: ['**/R.class',
'**/R$*.class',
'**/*$ViewBinder*.*',
Expand All @@ -30,8 +30,8 @@ task jacocoTestReport(type:JacocoReport, dependsOn: "testDebugUnitTest") {
println '##teamcity[jacocoReport dataPath=\'app/build/jacoco/testDebugUnitTest.exec\' includes=\'com.vgaidarji.cimatters.*\' excludes=\'com.vgaidarji.cimatters.test.* **/*R*.* **/*Injector*.* **/*Activity*.* .*R .*CiMattersApplication .*BuildConfig .*Activity .*Test \']'
}
reports {
xml.enabled = true
html.enabled = true
xml.required = true
html.required = true
}
additionalSourceDirs = files(coverageSourceDirs)
sourceDirectories = files(coverageSourceDirs)
Expand Down

0 comments on commit bf11045

Please sign in to comment.