Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forenklet build.gradle med å bruke jvmToolChain #4

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}