From fbc8369552fb95820879642236f6f662066de3fc Mon Sep 17 00:00:00 2001 From: David Denton Date: Sun, 18 Feb 2024 16:49:59 +0000 Subject: [PATCH] convert some gradle to kotlin --- build.gradle | 6 +++--- bunting4k/{build.gradle => build.gradle.kts} | 0 forkhandles-bom/{build.gradle => build.gradle.kts} | 6 +++--- result4k/core/build.gradle | 6 +++--- values4k/build.gradle | 11 ----------- values4k/build.gradle.kts | 13 +++++++++++++ 6 files changed, 22 insertions(+), 20 deletions(-) rename bunting4k/{build.gradle => build.gradle.kts} (100%) rename forkhandles-bom/{build.gradle => build.gradle.kts} (52%) delete mode 100644 values4k/build.gradle create mode 100644 values4k/build.gradle.kts diff --git a/build.gradle b/build.gradle index b51a6827..fee6f041 100644 --- a/build.gradle +++ b/build.gradle @@ -68,19 +68,19 @@ subprojects { } } - tasks.register('sourcesJar', Jar) { + tasks.register("sourcesJar", Jar) { dependsOn classes archiveClassifier = "sources" from sourceSets.main.allSource } - tasks.register('javadocJar', Jar) { + tasks.register("javadocJar", Jar) { dependsOn javadoc archiveClassifier = "javadoc" from javadoc.destinationDir } - tasks.register('testJar', Jar) { + tasks.register("testJar", Jar) { archiveClassifier = "test" from sourceSets.test.output } diff --git a/bunting4k/build.gradle b/bunting4k/build.gradle.kts similarity index 100% rename from bunting4k/build.gradle rename to bunting4k/build.gradle.kts diff --git a/forkhandles-bom/build.gradle b/forkhandles-bom/build.gradle.kts similarity index 52% rename from forkhandles-bom/build.gradle rename to forkhandles-bom/build.gradle.kts index d0c75d77..bbd9ddb5 100644 --- a/forkhandles-bom/build.gradle +++ b/forkhandles-bom/build.gradle.kts @@ -3,8 +3,8 @@ description = "Fork Handles Bill Of Materials (BOM)" dependencies { constraints { rootProject.subprojects - .findAll { it.name != project.name } - .sort { "$it.name" } - .each { api it } + .filter { it.name != project.name } + .sortedBy { it.name } + .forEach { api(it) } } } diff --git a/result4k/core/build.gradle b/result4k/core/build.gradle index 719c9271..5f67e316 100644 --- a/result4k/core/build.gradle +++ b/result4k/core/build.gradle @@ -1,17 +1,17 @@ plugins { - id "me.champeau.jmh" + id("me.champeau.jmh") } description = "A friendly Kotlin Result type" dependencies { - testApi Kotlin.test + testApi(Kotlin.test) } compileJmhKotlin.kotlinOptions.jvmTarget = "1.8" test { - include "dev/forkhandles/**" + include("dev/forkhandles/**") scanForTestClasses true reports { junitXml.required = true diff --git a/values4k/build.gradle b/values4k/build.gradle deleted file mode 100644 index f64e9e9b..00000000 --- a/values4k/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -description = 'ForkHandles Value-types library' - -dependencies { - implementation(project(":result4k")) -} - -compileTestKotlin { - kotlinOptions { - freeCompilerArgs = ["-Xinline-classes"] - } -} diff --git a/values4k/build.gradle.kts b/values4k/build.gradle.kts new file mode 100644 index 00000000..a21ce9cc --- /dev/null +++ b/values4k/build.gradle.kts @@ -0,0 +1,13 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +description = "ForkHandles Value-types library" + +dependencies { + implementation(project(":result4k")) +} + +tasks.named("compileTestKotlin") { + kotlinOptions { + freeCompilerArgs += listOf("-Xinline-classes") + } +}