jean
09/01/2020, 2:08 PMval packForXcode by tasks.creating(Sync::class) {
val targetDir = File(buildDir, "xcode-frameworks")
/// selecting the right configuration for the iOS
/// framework depending on the environment
/// variables set by Xcode build
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
val framework = kotlin.targets
.getByName<KotlinNativeTarget>("ios")
.binaries.getFramework(mode)
inputs.property("mode", mode)
dependsOn(framework.linkTask)
from({ framework.outputDirectory })
into(targetDir)
/// generate a helpful ./gradlew wrapper with embedded Java path
doLast {
val gradlew = File(targetDir, "gradlew")
gradlew.writeText(
"#!/bin/bash\n"
+ "export 'JAVA_HOME=${System.getProperty("java.home")}'\n"
+ "cd '${rootProject.rootDir}'\n"
+ "./gradlew \$@\n"
)
gradlew.setExecutable(true)
}
}
Which seems to work, I can find it under build > bin > ios > debugFramework > SharedCode.framework
I then go over to xcode Target > Frameworks, Libraries, and Embedded Content > + > Add files (inside the drop box)
then I navigate to SharedCode.framework
and select it.
Xcode does not complain but when I try to build my project I get Framework not found SharedCode
How am I suppose to add it ?mbonnin
09/01/2020, 2:10 PMmbonnin
09/01/2020, 2:13 PMmbonnin
09/01/2020, 2:13 PMmbonnin
09/01/2020, 2:13 PMhttps://i.stack.imgur.com/aidyf.png▾
dazza5000
09/01/2020, 2:15 PMjean
09/01/2020, 2:36 PM$(PROJECT_DIR)
to the search path 😞dazza5000
09/01/2020, 2:38 PMjean
09/01/2020, 2:45 PMEmbed
property from do not embed
to embed without signing
and it works!