From ab5a546c94aa02e35e93264090cd99a367f5b269 Mon Sep 17 00:00:00 2001 From: Lukas Cardot Date: Mon, 2 Sep 2024 16:10:45 -0400 Subject: [PATCH] set up jvm toolchain to specify Java version --- README.md | 2 +- jcv-db-assertj-db/build.gradle.kts | 11 ++++------- jcv-db-cassandra/build.gradle.kts | 11 ++++------- jcv-db-core/build.gradle.kts | 11 ++++------- jcv-db-jdbc/build.gradle.kts | 12 +++++------- jcv-db-mongo/build.gradle.kts | 10 ++++------ 6 files changed, 22 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 1d04009..9dc6858 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ JCV-DB provides assertions to validate database content against a json file. The ## Prerequisites If you want to test this project locally we must have the following software install: -- Java 11 +- Java 11 (if launching without using Gradle) - Docker - Docker compose diff --git a/jcv-db-assertj-db/build.gradle.kts b/jcv-db-assertj-db/build.gradle.kts index 24e82e5..b5dcee4 100644 --- a/jcv-db-assertj-db/build.gradle.kts +++ b/jcv-db-assertj-db/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { alias(libs.plugins.kotlin.jvm) @@ -30,13 +29,11 @@ java { withSourcesJar() } -tasks { - withType { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } - } +kotlin { + jvmToolchain(11) +} +tasks { withType { useJUnitPlatform() jvmArgs("-Duser.language=en") diff --git a/jcv-db-cassandra/build.gradle.kts b/jcv-db-cassandra/build.gradle.kts index b698eac..917d2c7 100644 --- a/jcv-db-cassandra/build.gradle.kts +++ b/jcv-db-cassandra/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { alias(libs.plugins.kotlin.jvm) @@ -30,13 +29,11 @@ java { withSourcesJar() } -tasks { - withType { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } - } +kotlin { + jvmToolchain(11) +} +tasks { withType { useJUnitPlatform() jvmArgs("-Duser.language=en") diff --git a/jcv-db-core/build.gradle.kts b/jcv-db-core/build.gradle.kts index 1f3f623..0edfb0c 100644 --- a/jcv-db-core/build.gradle.kts +++ b/jcv-db-core/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { alias(libs.plugins.kotlin.jvm) @@ -30,13 +29,11 @@ java { withSourcesJar() } -tasks { - withType { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } - } +kotlin { + jvmToolchain(11) +} +tasks { withType { useJUnitPlatform() jvmArgs("-Duser.language=en") diff --git a/jcv-db-jdbc/build.gradle.kts b/jcv-db-jdbc/build.gradle.kts index 2267fde..14d26dd 100644 --- a/jcv-db-jdbc/build.gradle.kts +++ b/jcv-db-jdbc/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { alias(libs.plugins.kotlin.jvm) @@ -26,17 +25,16 @@ val javadocJar by tasks.registering(Jar::class) { from(layout.buildDirectory.file("dokka")) } + java { withSourcesJar() } -tasks { - withType { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } - } +kotlin { + jvmToolchain(11) +} +tasks { withType { useJUnitPlatform() jvmArgs("-Duser.language=en") diff --git a/jcv-db-mongo/build.gradle.kts b/jcv-db-mongo/build.gradle.kts index 8e0f030..7ae85a7 100644 --- a/jcv-db-mongo/build.gradle.kts +++ b/jcv-db-mongo/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { alias(libs.plugins.kotlin.jvm) @@ -30,12 +29,11 @@ java { withSourcesJar() } +kotlin { + jvmToolchain(11) +} + tasks { - withType { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } - } withType { useJUnitPlatform()