Merge pull request #119 from kirmanak/coverage-modules
Fix test coverage report for submodules
This commit is contained in:
@@ -38,10 +38,6 @@ android {
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
getByName("debug") {
|
||||
enableUnitTestCoverage = true
|
||||
enableAndroidTestCoverage = true
|
||||
}
|
||||
getByName("release") {
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
|
||||
@@ -5,11 +5,7 @@ package gq.kirmanak.mealient
|
||||
import com.android.build.api.dsl.CommonExtension
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.ExtensionAware
|
||||
import org.gradle.api.tasks.testing.Test
|
||||
import org.gradle.kotlin.dsl.configure
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
import org.gradle.testing.jacoco.plugins.JacocoTaskExtension
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
|
||||
|
||||
internal fun Project.configureKotlinAndroid(
|
||||
@@ -62,17 +58,16 @@ internal fun Project.configureKotlinAndroid(
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
getByName("debug") {
|
||||
enableUnitTestCoverage = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
add("coreLibraryDesugaring", libs.findLibrary("android-tools-desugar").get())
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
configure<JacocoTaskExtension> {
|
||||
isIncludeNoLocationClasses = true
|
||||
excludes = listOf("jdk.internal.*")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun CommonExtension<*, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
|
||||
|
||||
@@ -24,8 +24,21 @@ sonarqube {
|
||||
property("sonar.projectKey", "kirmanak_Mealient")
|
||||
property("sonar.organization", "kirmanak")
|
||||
property("sonar.host.url", "https://sonarcloud.io")
|
||||
property("sonar.androidLint.reportPaths", "build/reports/lint-results-debug.xml")
|
||||
property("sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco.xml")
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
sonarqube {
|
||||
properties {
|
||||
property(
|
||||
"sonar.androidLint.reportPaths",
|
||||
"${projectDir.path}/build/reports/lint-results-debug.xml"
|
||||
)
|
||||
property(
|
||||
"sonar.coverage.jacoco.xmlReportPaths",
|
||||
"${projectDir.path}/build/reports/jacoco.xml"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user