Skip to content

Commit

Permalink
feat: support JVM 8+ and compile with Java 21 & use Parsek core 1.0.0…
Browse files Browse the repository at this point in the history
…-beta.3
  • Loading branch information
duruer committed Dec 13, 2024
1 parent 7680781 commit 65d2d01
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 28 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("jvm") version "1.9.20"
kotlin("kapt") version "1.9.20"
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}

tasks.withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}

0 comments on commit 65d2d01

Please sign in to comment.