[#78] Fix build on Apple Silicon
This commit is contained in:
parent
99c237f196
commit
0ba504fac1
|
@ -3,11 +3,23 @@ import org.gradle.jvm.toolchain.JavaToolchainSpec
|
||||||
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
|
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
|
||||||
extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.apply {
|
extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.apply {
|
||||||
jvmToolchain {
|
jvmToolchain {
|
||||||
val javaVersion = JavaVersion.toVersion(project.property("ANDROID_JVM_TARGET").toString())
|
val javaVersion = JavaVersion.toVersion(project.property("JVM_TOOLCHAIN").toString())
|
||||||
val javaLanguageVersion = JavaLanguageVersion.of(javaVersion.majorVersion)
|
val javaLanguageVersion = JavaLanguageVersion.of(javaVersion.majorVersion)
|
||||||
(this as JavaToolchainSpec).languageVersion.set(javaLanguageVersion)
|
(this as JavaToolchainSpec).languageVersion.set(javaLanguageVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
targets.matching { it.platformType.name == "jvm" }.all {
|
||||||
|
(this as org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget).apply {
|
||||||
|
val javaTargetVersion = project.property("ANDROID_JVM_TARGET").toString()
|
||||||
|
|
||||||
|
compilations.all {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = javaTargetVersion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
targets.all {
|
targets.all {
|
||||||
compilations.all {
|
compilations.all {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
|
|
@ -72,5 +72,10 @@ KOTLINX_COROUTINES_VERSION=1.5.2
|
||||||
KOTLIN_VERSION=1.5.31
|
KOTLIN_VERSION=1.5.31
|
||||||
ZCASH_SDK_VERSION=1.3.0-beta18
|
ZCASH_SDK_VERSION=1.3.0-beta18
|
||||||
|
|
||||||
|
# Toolchain is the Java version used to build the application, which is separate from the
|
||||||
|
# Java version used to run the application. Android requires a minimum of 11. Apple Silicon
|
||||||
|
# requires a newer toolchain. Kotlin won't support Java 17 until Kotlin 1.6
|
||||||
|
JVM_TOOLCHAIN=16
|
||||||
|
|
||||||
# This shouldn't be changed, as Android doesn't support targets beyond Java 8
|
# This shouldn't be changed, as Android doesn't support targets beyond Java 8
|
||||||
ANDROID_JVM_TARGET=1.8
|
ANDROID_JVM_TARGET=1.8
|
Loading…
Reference in New Issue