diff --git a/build.gradle.kts b/build.gradle.kts index 50e8dbb..94627b4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,6 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jlleitschuh.gradle.ktlint.KtlintExtension -val javaVersion = JavaVersion.VERSION_17 +val javaVersion = JavaLanguageVersion.of(17) plugins { kotlin("jvm") version "1.9.10" @@ -19,6 +18,12 @@ allprojects { configure { version.set("0.50.0") } + + configurations.all { + resolutionStrategy { + failOnNonReproducibleResolution() + } + } } subprojects { @@ -28,25 +33,22 @@ subprojects { apply(plugin = "maven-publish") apply(plugin = "java-library") + kotlin { + jvmToolchain(javaVersion.asInt()) + } + dependencies { - // Align versions of all Kotlin components - implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - implementation(kotlin("stdlib")) implementation(platform("org.springframework.boot:spring-boot-dependencies:3.1.3")) testImplementation("org.junit.jupiter:junit-jupiter") testImplementation("org.assertj:assertj-core") } - tasks { - withType { - kotlinOptions.jvmTarget = javaVersion.toString() - } - withType { - duplicatesStrategy = DuplicatesStrategy.INCLUDE - } - test { - useJUnitPlatform() - } + tasks.jar { + duplicatesStrategy = DuplicatesStrategy.INCLUDE + } + + tasks.test { + useJUnitPlatform() } java { diff --git a/settings.gradle.kts b/settings.gradle.kts index fb2dcaf..5b3f7e3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,2 +1,6 @@ rootProject.name = "tilleggsstonader-libs" include("logs") + +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" +}