Umar Ata
10/21/2020, 6:22 PM*cd* "$SRCROOT/.."
./gradlew :shared:packForSimulator -PXCODE_CONFIGURATION=${CONFIGURATION}
shared is the name of my multiplatform module
I am sharing the common code between Android and iOS
so the problem is that whenever I run above command from runScript of XCode it actually builds the framework for Selected device like either iPhone device or iPhone Simulator and it never gives me one framework that runs on both iOS device and simulatorKris Wong
10/21/2020, 6:38 PMUmar Ata
10/21/2020, 6:44 PMKris Wong
10/21/2020, 6:44 PMUmar Ata
10/21/2020, 6:47 PMimplementation project(':shared')
and for iOS I use script to generate xcode-frameworksval packForXCode by tasks.creating(Sync::class) {
group = "build"
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
//val sdkName = System.getenv("SDK_NAME") ?: "iphonesimulator"
val targetName = "iosArm64"//+ if (sdkName.startsWith("iphoneos")) "Arm64" else "X64"
val framework = kotlin.targets.getByName<KotlinNativeTarget>(targetName).binaries.getFramework(mode)
inputs.property("mode", mode)
dependsOn(framework.linkTask)
val targetDir = File(buildDir, "xcode-frameworks")
from({ framework.outputDirectory })
into(targetDir)
}
val packForSimulator by tasks.creating(Sync::class) {
group = "build"
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
val sdkName = /*System.getenv("SDK_NAME") ?: */"iphonesimulator"
val targetName = "ios" +/*+ if (sdkName.startsWith("iphoneos")) "Arm64" else*/ "X64"
val framework = kotlin.targets.getByName<KotlinNativeTarget>(targetName).binaries.getFramework(mode)
inputs.property("mode", mode)
dependsOn(framework.linkTask)
val targetDir = File(buildDir, "xcode-frameworks")
from({ framework.outputDirectory })
into(targetDir)
}
georg
10/21/2020, 7:03 PMKris Wong
10/21/2020, 7:21 PMgeorg
10/21/2020, 7:25 PMKris Wong
10/21/2020, 7:25 PMgeorg
10/21/2020, 7:29 PMUmar Ata
10/21/2020, 7:32 PMgeorg
10/21/2020, 7:37 PMUmar Ata
10/21/2020, 7:38 PM