Don't embed bitcode for ios simulator
This commit is contained in:
+14
-2
@@ -948,7 +948,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
|||||||
if (HostManager.hostIsMac) {
|
if (HostManager.hostIsMac) {
|
||||||
|
|
||||||
// Check dependency exporting and bitcode embedding in frameworks.
|
// Check dependency exporting and bitcode embedding in frameworks.
|
||||||
// For release builds
|
// For release builds.
|
||||||
build("linkReleaseFrameworkIos") {
|
build("linkReleaseFrameworkIos") {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertFileExists("build/bin/ios/releaseFramework/native_binary.framework")
|
assertFileExists("build/bin/ios/releaseFramework/native_binary.framework")
|
||||||
@@ -961,7 +961,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// For debug builds
|
// For debug builds.
|
||||||
build("linkDebugFrameworkIos") {
|
build("linkDebugFrameworkIos") {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertFileExists("build/bin/ios/debugFramework/native_binary.framework")
|
assertFileExists("build/bin/ios/debugFramework/native_binary.framework")
|
||||||
@@ -985,6 +985,18 @@ class NewMultiplatformIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check that bitcode is disabled for iOS simulator.
|
||||||
|
build("linkReleaseFrameworkIosSim", "linkDebugFrameworkIosSim") {
|
||||||
|
assertSuccessful()
|
||||||
|
assertFileExists("build/bin/iosSim/releaseFramework/native-binary.framework")
|
||||||
|
assertFileExists("build/bin/iosSim/debugFramework/native-binary.framework")
|
||||||
|
checkFrameworkCompilationCommandLine {
|
||||||
|
assertFalse(it.contains("-Xembed-bitcode"))
|
||||||
|
assertFalse(it.contains("-Xembed-bitcode-marker"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check that plugin doesn't allow exporting dependencies not added in the API configuration.
|
// Check that plugin doesn't allow exporting dependencies not added in the API configuration.
|
||||||
val buildFile = listOf("build.gradle", "build.gradle.kts").map { projectDir.resolve(it) }.single { it.exists() }
|
val buildFile = listOf("build.gradle", "build.gradle.kts").map { projectDir.resolve(it) }.single { it.exists() }
|
||||||
buildFile.modify {
|
buildFile.modify {
|
||||||
|
|||||||
+5
@@ -81,5 +81,10 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
iosX64("iosSim") {
|
||||||
|
binaries {
|
||||||
|
framework()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -73,4 +73,10 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iosX64("iosSim") {
|
||||||
|
binaries {
|
||||||
|
framework()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-5
@@ -207,11 +207,12 @@ class Framework(
|
|||||||
/**
|
/**
|
||||||
* Embed bitcode for the framework or not. See [BitcodeEmbeddingMode].
|
* Embed bitcode for the framework or not. See [BitcodeEmbeddingMode].
|
||||||
*/
|
*/
|
||||||
var embedBitcode: BitcodeEmbeddingMode = if (target.konanTarget.family == Family.IOS) {
|
var embedBitcode: BitcodeEmbeddingMode =
|
||||||
buildType.iosEmbedBitcode
|
if (target.konanTarget == KonanTarget.IOS_ARM64 || target.konanTarget == KonanTarget.IOS_ARM32) {
|
||||||
} else {
|
buildType.iosEmbedBitcode
|
||||||
BitcodeEmbeddingMode.DISABLE
|
} else {
|
||||||
}
|
BitcodeEmbeddingMode.DISABLE
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable embedding bitcode for the framework. See [BitcodeEmbeddingMode].
|
* Enable or disable embedding bitcode for the framework. See [BitcodeEmbeddingMode].
|
||||||
|
|||||||
+4
-3
@@ -1,6 +1,7 @@
|
|||||||
package org.jetbrains.kotlin.gradle.plugin.mpp
|
package org.jetbrains.kotlin.gradle.plugin.mpp
|
||||||
|
|
||||||
import org.gradle.api.Named
|
import org.gradle.api.Named
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework.BitcodeEmbeddingMode
|
||||||
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
||||||
import org.jetbrains.kotlin.konan.target.Family
|
import org.jetbrains.kotlin.konan.target.Family
|
||||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||||
@@ -8,10 +9,10 @@ import org.jetbrains.kotlin.konan.target.KonanTarget
|
|||||||
enum class NativeBuildType(
|
enum class NativeBuildType(
|
||||||
val optimized: Boolean,
|
val optimized: Boolean,
|
||||||
val debuggable: Boolean,
|
val debuggable: Boolean,
|
||||||
internal val iosEmbedBitcode: Framework.BitcodeEmbeddingMode
|
internal val iosEmbedBitcode: BitcodeEmbeddingMode
|
||||||
) : Named {
|
) : Named {
|
||||||
RELEASE(true, false, Framework.BitcodeEmbeddingMode.BITCODE),
|
RELEASE(true, false, BitcodeEmbeddingMode.BITCODE),
|
||||||
DEBUG(false, true, Framework.BitcodeEmbeddingMode.MARKER);
|
DEBUG(false, true, BitcodeEmbeddingMode.MARKER);
|
||||||
|
|
||||||
override fun getName(): String = name.toLowerCase()
|
override fun getName(): String = name.toLowerCase()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user