From eca30c033f0dfe10a8674768c38a5b0e4afcd686 Mon Sep 17 00:00:00 2001 From: Johan Blomgren Date: Fri, 25 Aug 2023 11:30:54 +0200 Subject: [PATCH] =?UTF-8?q?Forenklet=20build.gradle=20med=20=C3=A5=20bruke?= =?UTF-8?q?=20jvmToolChain=20(#4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * slettet unødvendig stdlib som tas in automatisk med plugin --- build.gradle.kts | 32 +++++++++++++++++--------------- settings.gradle.kts | 4 ++++ 2 files changed, 21 insertions(+), 15 deletions(-) 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" +}