Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: change Java toolchain to 21 (LTS) from 23 #228

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- uses: "actions/setup-java@v4"
with:
distribution: "temurin"
java-version: 23
java-version: 21
- uses: "gradle/actions/setup-gradle@v4"
with:
build-scan-publish: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- uses: "actions/setup-java@v4"
with:
distribution: "temurin"
java-version: 23
java-version: 21
- uses: "gradle/actions/dependency-submission@v4"
with:
build-scan-publish: true
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ repositories {
google()
}

kotlin { jvmToolchain(21) }

dependencies {
pluginImplementation(libs.plugins.android.application)
pluginImplementation(libs.plugins.android.library)
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/library-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ group = "dev.sargunv.maplibre-compose"
kotlin {
explicitApi()

jvmToolchain(properties["jvmToolchain"]!!.toString().toInt())

compilerOptions {
allWarningsAsErrors = true
freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xconsistent-data-class-copy-visibility")
Expand Down
7 changes: 7 additions & 0 deletions buildSrc/src/main/kotlin/util.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

fun Project.getJvmTarget(): JvmTarget {
val target = properties["jvmTarget"]!!.toString().toInt()
return JvmTarget.valueOf("JVM_$target")
}
11 changes: 2 additions & 9 deletions demo-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.jetbrains.compose.ExperimentalComposeLibrary
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree

plugins {
Expand Down Expand Up @@ -40,19 +39,13 @@ android {

kotlin {
androidTarget {
compilerOptions {
jvmTarget.set(JvmTarget.valueOf(project.properties["jvmTarget"]!!.toString()))
}
compilerOptions { jvmTarget = project.getJvmTarget() }
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
}
iosArm64()
iosSimulatorArm64()
iosX64()
jvm("desktop") {
compilerOptions {
jvmTarget.set(JvmTarget.valueOf(project.properties["jvmTarget"]!!.toString()))
}
}
jvm("desktop") { compilerOptions { jvmTarget = project.getJvmTarget() } }
js(IR) {
browser { commonWebpackConfig { outputFileName = "app.js" } }
binaries.executable()
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ androidMinSdk=23
androidCompileSdk=35
androidTargetSdk=35
iosDeploymentTarget=12.0
jvmTarget=JVM_11
jvmToolchain=21
jvmTarget=11
kotlin.code.style=official
kotlin.daemon.jvmargs=-Xmx2048M
kotlin.incremental.wasm=true
Expand Down
11 changes: 2 additions & 9 deletions lib/maplibre-compose-expressions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree

plugins {
Expand All @@ -27,20 +26,14 @@ mavenPublishing {

kotlin {
androidTarget {
compilerOptions {
jvmTarget.set(JvmTarget.valueOf(project.properties["jvmTarget"]!!.toString()))
}
compilerOptions { jvmTarget = project.getJvmTarget() }
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
publishLibraryVariants("release", "debug")
}
iosArm64()
iosSimulatorArm64()
iosX64()
jvm("desktop") {
compilerOptions {
jvmTarget.set(JvmTarget.valueOf(project.properties["jvmTarget"]!!.toString()))
}
}
jvm("desktop") { compilerOptions { jvmTarget = project.getJvmTarget() } }
js(IR) { browser() }
wasmJs { browser() }

Expand Down
11 changes: 2 additions & 9 deletions lib/maplibre-compose-material3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.jetbrains.compose.ExperimentalComposeLibrary
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree

plugins {
Expand All @@ -28,20 +27,14 @@ mavenPublishing {

kotlin {
androidTarget {
compilerOptions {
jvmTarget.set(JvmTarget.valueOf(project.properties["jvmTarget"]!!.toString()))
}
compilerOptions { jvmTarget = project.getJvmTarget() }
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
publishLibraryVariants("release", "debug")
}
iosArm64()
iosSimulatorArm64()
iosX64()
jvm("desktop") {
compilerOptions {
jvmTarget.set(JvmTarget.valueOf(project.properties["jvmTarget"]!!.toString()))
}
}
jvm("desktop") { compilerOptions { jvmTarget = project.getJvmTarget() } }
js(IR) { browser() }

cocoapods {
Expand Down
11 changes: 2 additions & 9 deletions lib/maplibre-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.jetbrains.compose.ExperimentalComposeLibrary
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree

plugins {
Expand Down Expand Up @@ -47,20 +46,14 @@ val copyDesktopResources by

kotlin {
androidTarget {
compilerOptions {
jvmTarget.set(JvmTarget.valueOf(project.properties["jvmTarget"]!!.toString()))
}
compilerOptions { jvmTarget = project.getJvmTarget() }
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
publishLibraryVariants("release", "debug")
}
iosArm64()
iosSimulatorArm64()
iosX64()
jvm("desktop") {
compilerOptions {
jvmTarget.set(JvmTarget.valueOf(project.properties["jvmTarget"]!!.toString()))
}
}
jvm("desktop") { compilerOptions { jvmTarget = project.getJvmTarget() } }
js(IR) { browser() }

cocoapods {
Expand Down
Loading