Skip to content

Commit

Permalink
Remove Jvm toolchain from conventions, upgrade Github workflow Jdk to 21
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinRNDR committed Mar 23, 2024
1 parent 62a4cbd commit 04814e6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
cache: gradle

- name: Build OPENRNDR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-candidate-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
- name: Build ORX
run: ./gradlew -Prelease.useLastTag=true build
- name: Decode
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
- name: Build ORX
run: ./gradlew -Prelease.useLastTag=true build
- name: Decode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ dependencies {
"demoRuntimeOnly"(libs.slf4j.simple)
}

kotlin {
jvmToolchain(libs.versions.jvmTarget.get().toInt())
}


tasks {
@Suppress("UNUSED_VARIABLE")
Expand All @@ -79,14 +77,19 @@ tasks {
}
}
withType<KotlinCompile>() {
kotlinOptions.jvmTarget = libs.versions.jvmTarget.get()
kotlinOptions.apiVersion = libs.versions.kotlinApi.get()
kotlinOptions.languageVersion = libs.versions.kotlinLanguage.get()
kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes"
kotlinOptions.freeCompilerArgs += "-Xjdk-release=${libs.versions.jvmTarget.get()}"
}
}

java {
withJavadocJar()
withSourcesJar()
targetCompatibility = JavaVersion.valueOf("VERSION_${libs.versions.jvmTarget.get()}")
sourceCompatibility = JavaVersion.valueOf("VERSION_${libs.versions.jvmTarget.get()}")
}

val isReleaseVersion = !(version.toString()).endsWith("SNAPSHOT")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import CollectScreenshotsTask
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile


val libs = the<LibrariesForLibs>()

Expand All @@ -28,14 +31,18 @@ repositories {

group = "org.openrndr.extra"

tasks.withType<KotlinCompile>() {
tasks.withType<KotlinCompile<*>> {
kotlinOptions.apiVersion = libs.versions.kotlinApi.get()
kotlinOptions.languageVersion = libs.versions.kotlinLanguage.get()
kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes"
kotlinOptions.freeCompilerArgs += "-Xjdk-release=${libs.versions.jvmTarget.get()}"
}
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions.jvmTarget.set(JvmTarget.fromTarget(libs.versions.jvmTarget.get()))
}

kotlin {
jvm {
jvmToolchain(libs.versions.jvmTarget.get().toInt())
compilations {
val main by getting

Expand Down

0 comments on commit 04814e6

Please sign in to comment.