Skip to content

Instantly share code, notes, and snippets.

@hoc081098
Created April 12, 2023 10:50
Show Gist options
  • Save hoc081098/483ddf84697b90edb98acb932a02e4f8 to your computer and use it in GitHub Desktop.
Save hoc081098/483ddf84697b90edb98acb932a02e4f8 to your computer and use it in GitHub Desktop.
kover
subprojects {
apply<KoverPlugin>()
afterEvaluate {
tasks.withType<Test> {
testLogging {
showExceptions = true
showCauses = true
showStackTraces = true
showStandardStreams = true
events = EnumSet.of(
TestLogEvent.PASSED,
TestLogEvent.FAILED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT,
TestLogEvent.STANDARD_ERROR
)
exceptionFormat = TestExceptionFormat.FULL
}
}
}
afterEvaluate {
val project = this
extensions.findByType<com.android.build.api.dsl.LibraryExtension>()?.run {
println("$project: config for project")
testOptions {
unitTests {
isReturnDefaultValues = true
all { test ->
println("$project: test ${test.name} ")
test.extensions.configure<kotlinx.kover.api.KoverTaskExtension> {
isDisabled.set(test.name != "testDebugUnitTest")
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment