Skip to content

Commit

Permalink
Merge pull request #39 from syxc/kotlin-2.0
Browse files Browse the repository at this point in the history
Update build.gradle.kts
  • Loading branch information
syxc authored Jun 22, 2024
2 parents b2f5247 + 0605ad8 commit df2bab8
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 df2bab8

Please sign in to comment.