move test config to code-quality convention plugin

This commit is contained in:
Adam 2023-05-31 23:10:23 +02:00
parent acfaaec754
commit 671e4c6810
2 changed files with 12 additions and 13 deletions

View file

@ -1,9 +1,5 @@
package buildsrc.conventions
import buildsrc.utils.Rife2TestListener
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
/** common config for all subprojects */
plugins {
@ -20,12 +16,3 @@ tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
tasks.withType<Test>().configureEach {
val testsBadgeApiKey = providers.gradleProperty("testsBadgeApiKey")
addTestListener(Rife2TestListener(testsBadgeApiKey))
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
}

View file

@ -17,6 +17,9 @@
package buildsrc.conventions
import buildsrc.utils.Rife2TestListener
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.sonarqube.gradle.SonarTask
plugins {
@ -39,3 +42,12 @@ sonarqube {
tasks.withType<SonarTask>().configureEach {
dependsOn(tasks.matching { it.name == "koverXmlReport" })
}
tasks.withType<Test>().configureEach {
val testsBadgeApiKey = providers.gradleProperty("testsBadgeApiKey")
addTestListener(Rife2TestListener(testsBadgeApiKey))
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
}