Skip to content

Commit

Permalink
Forenklet build.gradle med å bruke jvmToolChain (#4)
Browse files Browse the repository at this point in the history
* slettet unødvendig stdlib som tas in automatisk med plugin
  • Loading branch information
blommish authored Aug 25, 2023
1 parent 82e4c31 commit eca30c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
32 changes: 17 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -19,6 +18,12 @@ allprojects {
configure<KtlintExtension> {
version.set("0.50.0")
}

configurations.all {
resolutionStrategy {
failOnNonReproducibleResolution()
}
}
}

subprojects {
Expand All @@ -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<KotlinCompile> {
kotlinOptions.jvmTarget = javaVersion.toString()
}
withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
test {
useJUnitPlatform()
}
tasks.jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

tasks.test {
useJUnitPlatform()
}

java {
Expand Down
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
rootProject.name = "tilleggsstonader-libs"
include("logs")

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

0 comments on commit eca30c0

Please sign in to comment.