diff --git a/.github/workflows/generate-screenshots.yml b/.github/workflows/generate-screenshots.yml index b79620666..80e791a9b 100644 --- a/.github/workflows/generate-screenshots.yml +++ b/.github/workflows/generate-screenshots.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: temurin - java-version: 17 + java-version: 21 cache: gradle - name: Build OPENRNDR diff --git a/.github/workflows/release-candidate-to-maven-central.yml b/.github/workflows/release-candidate-to-maven-central.yml index 62650b007..0eb21ce15 100644 --- a/.github/workflows/release-candidate-to-maven-central.yml +++ b/.github/workflows/release-candidate-to-maven-central.yml @@ -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 diff --git a/.github/workflows/release-to-maven-central.yml b/.github/workflows/release-to-maven-central.yml index c7fea8ae8..6de50f96d 100644 --- a/.github/workflows/release-to-maven-central.yml +++ b/.github/workflows/release-to-maven-central.yml @@ -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 diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts index 30a64a884..72ae10b5d 100644 --- a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts @@ -57,9 +57,7 @@ dependencies { "demoRuntimeOnly"(libs.slf4j.simple) } -kotlin { - jvmToolchain(libs.versions.jvmTarget.get().toInt()) -} + tasks { @Suppress("UNUSED_VARIABLE") @@ -79,14 +77,19 @@ tasks { } } withType() { + 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") diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts index 8076a777a..07e2cd0e1 100644 --- a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts @@ -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() @@ -28,14 +31,18 @@ repositories { group = "org.openrndr.extra" -tasks.withType() { +tasks.withType> { 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().configureEach { + compilerOptions.jvmTarget.set(JvmTarget.fromTarget(libs.versions.jvmTarget.get())) } kotlin { jvm { - jvmToolchain(libs.versions.jvmTarget.get().toInt()) compilations { val main by getting