diff options
Diffstat (limited to 'buildSrc/src')
-rw-r--r-- | buildSrc/src/main/kotlin/kotlin-jvm.gradle.kts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/buildSrc/src/main/kotlin/kotlin-jvm.gradle.kts b/buildSrc/src/main/kotlin/kotlin-jvm.gradle.kts new file mode 100644 index 0000000..d11bbb9 --- /dev/null +++ b/buildSrc/src/main/kotlin/kotlin-jvm.gradle.kts @@ -0,0 +1,29 @@ +// The code in this file is a convention plugin - a Gradle mechanism for sharing reusable build logic. +// `buildSrc` is a Gradle-recognized directory and every plugin there will be easily available in the rest of the build. +package buildsrc.convention + +import org.gradle.api.tasks.testing.logging.TestLogEvent + +plugins { + // Apply the Kotlin JVM plugin to add support for Kotlin in JVM projects. + kotlin("jvm") +} + +kotlin { + // Use a specific Java version to make it easier to work in different environments. + jvmToolchain(21) +} + +tasks.withType<Test>().configureEach { + // Configure all test Gradle tasks to use JUnitPlatform. + useJUnitPlatform() + + // Log information about all test results, not only the failed ones. + testLogging { + events( + TestLogEvent.FAILED, + TestLogEvent.PASSED, + TestLogEvent.SKIPPED + ) + } +} |