Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ internal inline fun <reified Ext : CommonExtension<*, *, *, *, *, *>> Project.co
all(Test::configureTestLogging)
}
}

// Add Kotlin source directories to Android source sets. Useful, for example, for letting
// them being picked up in Sonar analyses.
sourceSets { all { java.srcDir("src/$name/kotlin") } }
}

tasks.withType<JavaCompile>().configureEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private fun Project.configureSonar(extension: StreamProjectExtension) {
property(
"sonar.coverage.jacoco.xmlReportPaths",
layout.buildDirectory
.file("/reports/kover/report${KoverConstants.VARIANT_SUFFIX}.xml")
.file("reports/kover/report${KoverConstants.VARIANT_SUFFIX}.xml")
.get(),
)
}
Expand All @@ -103,13 +103,14 @@ private fun Project.setupKoverDependencyOnModules(includedModules: Set<String>)
internal fun Project.configureCoverageModule() {
val coverageOptions = requireStreamProjectExtension().coverage

pluginManager.apply("org.sonarqube")

// Only configure coverage for included modules
if (name !in coverageOptions.includedModules.get()) {
extensions.configure<SonarExtension> { isSkipProject = true }
return
}

pluginManager.apply("org.sonarqube")

// Configure Android test coverage if this is an Android module
pluginManager.withPlugin("com.android.library") { configureAndroid<LibraryExtension>() }
pluginManager.withPlugin("com.android.application") { configureAndroid<ApplicationExtension>() }
Expand Down
Loading