From 671e4c68106905f1cc288091b3a6cd874c488db7 Mon Sep 17 00:00:00 2001 From: Adam <897017+aSemy@users.noreply.github.com> Date: Wed, 31 May 2023 23:10:23 +0200 Subject: [PATCH] move test config to `code-quality` convention plugin --- .../kotlin/buildsrc/conventions/base.gradle.kts | 13 ------------- .../buildsrc/conventions/code-quality.gradle.kts | 12 ++++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/buildSrc/src/main/kotlin/buildsrc/conventions/base.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/conventions/base.gradle.kts index 7404066..59e3a56 100644 --- a/buildSrc/src/main/kotlin/buildsrc/conventions/base.gradle.kts +++ b/buildSrc/src/main/kotlin/buildsrc/conventions/base.gradle.kts @@ -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().configureEach { isPreserveFileTimestamps = false isReproducibleFileOrder = true } - -tasks.withType().configureEach { - val testsBadgeApiKey = providers.gradleProperty("testsBadgeApiKey") - addTestListener(Rife2TestListener(testsBadgeApiKey)) - testLogging { - exceptionFormat = TestExceptionFormat.FULL - events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED) - } -} diff --git a/buildSrc/src/main/kotlin/buildsrc/conventions/code-quality.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/conventions/code-quality.gradle.kts index a81b982..f9c3d13 100644 --- a/buildSrc/src/main/kotlin/buildsrc/conventions/code-quality.gradle.kts +++ b/buildSrc/src/main/kotlin/buildsrc/conventions/code-quality.gradle.kts @@ -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().configureEach { dependsOn(tasks.matching { it.name == "koverXmlReport" }) } + +tasks.withType().configureEach { + val testsBadgeApiKey = providers.gradleProperty("testsBadgeApiKey") + addTestListener(Rife2TestListener(testsBadgeApiKey)) + testLogging { + exceptionFormat = TestExceptionFormat.FULL + events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED) + } +}