diff --git a/gradle-plugin/src/main/kotlin/com/alecstrong/cocoapods/gradle/plugin/CocoapodsCompileTask.kt b/gradle-plugin/src/main/kotlin/com/alecstrong/cocoapods/gradle/plugin/CocoapodsCompileTask.kt index b0598c9..838b1c8 100644 --- a/gradle-plugin/src/main/kotlin/com/alecstrong/cocoapods/gradle/plugin/CocoapodsCompileTask.kt +++ b/gradle-plugin/src/main/kotlin/com/alecstrong/cocoapods/gradle/plugin/CocoapodsCompileTask.kt @@ -97,19 +97,11 @@ open class CocoapodsCompileTask : DefaultTask() { exec.args = listOf("-c", "Delete :CFBundleSupportedPlatforms:0", plistPath) }.rethrowFailure().assertNormalExitValue() - compilations.map { it.binary.target.konanTarget.supportedPlatform() }.distinct() - .forEachIndexed { index, platform -> - project.exec { exec -> - exec.executable = "/usr/libexec/PlistBuddy" - exec.args = listOf("-c", "Add :CFBundleSupportedPlatforms:$index string $platform", plistPath) - }.rethrowFailure().assertNormalExitValue() - } + // only add iPhoneOS as supported platform + project.exec { exec -> + exec.executable = "/usr/libexec/PlistBuddy" + exec.args = listOf("-c", "Add :CFBundleSupportedPlatforms:0 string iPhoneOS", plistPath) + }.rethrowFailure().assertNormalExitValue() } } - - private fun KonanTarget.supportedPlatform(): String = when (this) { - IOS_X64 -> "iPhoneOS" - IOS_ARM64, IOS_ARM32 -> "iPhoneSimulator" - else -> throw AssertionError() - } } \ No newline at end of file diff --git a/gradle-plugin/src/test/kotlin/com/alecstrong/cocoapods/gradle/plugin/PluginTest.kt b/gradle-plugin/src/test/kotlin/com/alecstrong/cocoapods/gradle/plugin/PluginTest.kt index 2c9c975..cf41dfb 100644 --- a/gradle-plugin/src/test/kotlin/com/alecstrong/cocoapods/gradle/plugin/PluginTest.kt +++ b/gradle-plugin/src/test/kotlin/com/alecstrong/cocoapods/gradle/plugin/PluginTest.kt @@ -67,7 +67,6 @@ class PluginTest { assertThat(plist.exists()).isTrue() assertThat(plist.readText()).apply { - contains("iPhoneSimulator") contains("iPhoneOS") } @@ -96,7 +95,6 @@ class PluginTest { assertThat(plist.exists()).isTrue() assertThat(plist.readText()).apply { - contains("iPhoneSimulator") contains("iPhoneOS") doesNotContain("UIRequiredDeviceCapabilities") }