From 109da32fd153f72ab4cd2f9ddc0696286d4afa63 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Tue, 10 Feb 2026 15:10:37 +0000 Subject: [PATCH] add Kotlin --- build.gradle.kts | 25 +- gradle/verification-metadata.xml | 499 ++++++++++++++++++++++--------- 2 files changed, 375 insertions(+), 149 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5403c4e..e035af3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,6 +16,8 @@ repositories { plugins { id("java") + id("org.jetbrains.kotlin.jvm") version "2.1.0" + id("org.jetbrains.kotlin.plugin.serialization") version "2.1.0" id("com.github.johnrengelman.shadow") version "8.1.1" id("net.nemerosa.versioning") version "3.1.0" id("com.cmgapps.licenses") version "4.8.0" @@ -27,6 +29,13 @@ java { } } +kotlin { + jvmToolchain(17) + compilerOptions { + freeCompilerArgs.add("-Xjvm-default=all") + } +} + dependencies { implementation(platform("org.lwjgl:lwjgl-bom:3.3.3")) @@ -100,6 +109,11 @@ dependencies { implementation(files("lib/org.eclipse.equinox.common-3.6.0.jar")) implementation("org.ahocorasick:ahocorasick:0.6.3") + + // Kotlin + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.9.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3") } @@ -126,11 +140,14 @@ tasks { } val compileApp = register("compileApp") { - source = fileTree("src/main/java") + source = fileTree("src/main/java") { + include("**/*.java") + } destinationDirectory.set(appBuildDir.get().asFile) - classpath = sourceSets.main.get().compileClasspath // use the default classpath + classpath = sourceSets.main.get().compileClasspath + files(layout.buildDirectory.dir("classes/kotlin/main")) options.release.set(17) options.compilerArgs.add("-Xlint:deprecation") + dependsOn("compileKotlin") } val jarApp = register("jarApp") { @@ -139,13 +156,13 @@ tasks { manifest { attributes["Main-Class"] = appMain } - from(appBuildDir) + from(appBuildDir, layout.buildDirectory.dir("classes/kotlin/main")) } shadowJar { dependsOn(jarBoot, jarApp) - from(bootBuildDir, appBuildDir) + from(bootBuildDir, appBuildDir, layout.buildDirectory.dir("classes/kotlin/main")) mergeServiceFiles("META-INF/spring.*") exclude("META-INF/*.SF") diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 7e783a5..4a48b59 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -6,8 +6,7 @@ - - + @@ -62,9 +61,6 @@ - - - @@ -73,9 +69,6 @@ - - - @@ -84,9 +77,6 @@ - - - @@ -146,11 +136,24 @@ + + + + + + + + + + + + + @@ -159,19 +162,6 @@ - - - - - - - - - - - - - @@ -254,22 +244,6 @@ - - - - - - - - - - - - - - - - @@ -287,9 +261,6 @@ - - - @@ -565,11 +536,6 @@ - - - - - @@ -583,14 +549,6 @@ - - - - - - - - @@ -599,11 +557,6 @@ - - - - - @@ -701,24 +654,235 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + + + + + + + + + @@ -729,75 +893,112 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - + + + - - + + - - - + + + + + + - - - + + + + + + - - - + + + - - - + + + - - + + + + + + + - - - + + + - - + + + + + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -805,11 +1006,24 @@ + + + + + + + + + + + + + @@ -818,11 +1032,27 @@ + + + + + + + + + + + + + + + + @@ -831,42 +1061,35 @@ - - - + + + + + + + + - - - - - - - - - - - - @@ -1017,14 +1240,6 @@ - - - - - - - - @@ -1120,17 +1335,11 @@ - - - - - - -- 2.51.2