upgrade to jvm 21 and kotlin 2.0

Sun, 28 Jul 2024 12:16:19 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 28 Jul 2024 12:16:19 +0200
changeset 302
a27af2669825
parent 301
f849eeee37de
child 303
4c5342255263

upgrade to jvm 21 and kotlin 2.0

issue #401

build.gradle.kts file | annotate | diff | comparison | revisions
--- a/build.gradle.kts	Sun Jul 28 12:15:57 2024 +0200
+++ b/build.gradle.kts	Sun Jul 28 12:16:19 2024 +0200
@@ -1,22 +1,18 @@
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+import org.jetbrains.kotlin.gradle.dsl.JvmTarget
 
 plugins {
-    kotlin("jvm") version "1.9.0"
+    kotlin("jvm") version "2.0.0"
     war
 }
 group = "de.uapcore"
-version = "1.2.2"
+version = "1.3.0"
 
 repositories {
     mavenCentral()
 }
 
-tasks.withType<KotlinCompile>().configureEach {
-    kotlinOptions.jvmTarget = "11"
-}
-
 tasks.withType<JavaCompile>().configureEach {
-    targetCompatibility = "11"
+    targetCompatibility = "21"
 }
 
 tasks.test {
@@ -35,13 +31,17 @@
 
 val libsAreProvided = true
 kotlin {
+    compilerOptions {
+        jvmTarget.set(JvmTarget.JVM_21)
+    }
+
     sourceSets {
         val main by getting {
             dependencies {
                 arrayOf(
                     "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:3.0.0",
                     "org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1",
-                    "org.postgresql:postgresql:42.7.1"
+                    "org.postgresql:postgresql:42.7.3"
                 ).forEach {
                     if (libsAreProvided) compileOnly(it) else implementation(it)
                 }
@@ -57,7 +57,7 @@
         val test by getting {
             dependencies {
                 implementation("org.jetbrains.kotlin:kotlin-test-junit5")
-                runtimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.0")
+                runtimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.3")
             }
         }
     }

mercurial