Skip to content

Commit

Permalink
Update build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
syxc committed Jun 22, 2024
1 parent 7c1c4ab commit 0605ad8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@file:Suppress("UnstableApiUsage")

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework
Expand Down Expand Up @@ -108,14 +107,17 @@ private fun Project.configureCommonKotlin() {
// We set the JVM target (the bytecode version) above for all Kotlin-based Java bytecode
// compilations, but we also need to set the JDK API version for the Kotlin JVM targets to
// prevent linking against newer JDK APIs (the Android targets link against the android.jar).
@OptIn(ExperimentalKotlinGradlePluginApi::class)
kotlin.targets.withType(KotlinJvmTarget::class.java) {
compilerOptions {
freeCompilerArgs.set(
freeCompilerArgs.getOrElse(emptyList()) + listOf(
"-Xjdk-release=${Versions.javaVersion}"
)
)
compilations.configureEach {
compileTaskProvider.configure {
compilerOptions {
freeCompilerArgs.set(
freeCompilerArgs.getOrElse(emptyList()) + listOf(
"-Xjdk-release=${Versions.javaVersion}"
)
)
}
}
}
}

Expand Down

0 comments on commit 0605ad8

Please sign in to comment.