Skip to content

Commit eca30c0

Browse files
authored
Forenklet build.gradle med å bruke jvmToolChain (#4)
* slettet unødvendig stdlib som tas in automatisk med plugin
1 parent 82e4c31 commit eca30c0

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

build.gradle.kts

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
21
import org.jlleitschuh.gradle.ktlint.KtlintExtension
32

4-
val javaVersion = JavaVersion.VERSION_17
3+
val javaVersion = JavaLanguageVersion.of(17)
54

65
plugins {
76
kotlin("jvm") version "1.9.10"
@@ -19,6 +18,12 @@ allprojects {
1918
configure<KtlintExtension> {
2019
version.set("0.50.0")
2120
}
21+
22+
configurations.all {
23+
resolutionStrategy {
24+
failOnNonReproducibleResolution()
25+
}
26+
}
2227
}
2328

2429
subprojects {
@@ -28,25 +33,22 @@ subprojects {
2833
apply(plugin = "maven-publish")
2934
apply(plugin = "java-library")
3035

36+
kotlin {
37+
jvmToolchain(javaVersion.asInt())
38+
}
39+
3140
dependencies {
32-
// Align versions of all Kotlin components
33-
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
34-
implementation(kotlin("stdlib"))
3541
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.1.3"))
3642
testImplementation("org.junit.jupiter:junit-jupiter")
3743
testImplementation("org.assertj:assertj-core")
3844
}
3945

40-
tasks {
41-
withType<KotlinCompile> {
42-
kotlinOptions.jvmTarget = javaVersion.toString()
43-
}
44-
withType<Jar> {
45-
duplicatesStrategy = DuplicatesStrategy.INCLUDE
46-
}
47-
test {
48-
useJUnitPlatform()
49-
}
46+
tasks.jar {
47+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
48+
}
49+
50+
tasks.test {
51+
useJUnitPlatform()
5052
}
5153

5254
java {

settings.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
rootProject.name = "tilleggsstonader-libs"
22
include("logs")
3+
4+
plugins {
5+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
6+
}

0 commit comments

Comments
 (0)