summaryrefslogtreecommitdiff
path: root/buildSrc/src/main/kotlin/kotlin-jvm.gradle.kts
diff options
context:
space:
mode:
authorEdoardo La Greca2025-08-18 21:09:11 +0200
committerEdoardo La Greca2025-08-18 21:09:11 +0200
commit7341ead2aade10ea1b833e94275277658741883a (patch)
tree46495f24c54278d50aa0da5046822fbe502f3f14 /buildSrc/src/main/kotlin/kotlin-jvm.gradle.kts
parent1e50cf9c224d03896f176f3718ff80ef1659e9c2 (diff)
switch to multi-module project structure
Diffstat (limited to 'buildSrc/src/main/kotlin/kotlin-jvm.gradle.kts')
-rw-r--r--buildSrc/src/main/kotlin/kotlin-jvm.gradle.kts29
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
+ )
+ }
+}