From 65d2d014e423a0a3913da438c55797c394fc1c22 Mon Sep 17 00:00:00 2001 From: kahverengi Date: Fri, 13 Dec 2024 15:26:01 +0300 Subject: [PATCH] feat: support JVM 8+ and compile with Java 21 & use Parsek core 1.0.0-beta.3 --- .github/workflows/release.yml | 2 +- build.gradle.kts | 29 ++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 866ec79..53cf4a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: temurin - java-version: 8 + java-version: 21 - name: Build with Gradle uses: gradle/actions/setup-gradle@v3 diff --git a/build.gradle.kts b/build.gradle.kts index 633ae6b..2217cfe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { kotlin("jvm") version "1.9.20" kotlin("kapt") version "1.9.20" @@ -26,7 +28,7 @@ dependencies { if (bootstrap) { compileOnly(project(mapOf("path" to ":Parsek"))) } else { - compileOnly("com.github.StatuParsek:Parsek:2.1.0") + compileOnly("com.github.StatuParsek:Parsek:v1.0.0-beta.3") } compileOnly(kotlin("stdlib-jdk8")) @@ -122,4 +124,29 @@ publishing { } } } +} + +java { + withJavadocJar() + withSourcesJar() + + // Use Java 21 for compilation + toolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } +} + +kotlin { + jvmToolchain(21) // Ensure Kotlin uses the Java 21 toolchain +} + +tasks.withType { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + } +} + +tasks.withType { + sourceCompatibility = "1.8" + targetCompatibility = "1.8" } \ No newline at end of file