Hi there! I use kotlin.cocoapods plugin to import my shared code into my ios project (as described here
https://github.com/JetBrains/kotlin-native/blob/master/COCOAPODS.md). My script_phases section in .podspec file:
spec.script_phases = [
{
:name => 'Build multiplatform',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
set -ev
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" :multiplatform:syncFramework \
-Pkotlin.native.cocoapods.target=$KOTLIN_TARGET \
-Pkotlin.native.cocoapods.configuration=RELEASE \
-Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" \
-Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \
-Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
SCRIPT
}
]
When I build my ios project it runs
syncFramework
task and I don’t understand how syncFramework works.
Here are few examples:
1. I add some
println("")
inside a SharedCode function and when I build ios project the
syncFramework
does nothing. (I don’t see my println at runtime)
2. I change some function name
fun test()
->
fun myTest()
then Xcode says
test()
func isn’t exist and if I change it to
myTest()
it compiles and crushes at runtime with
unrecognized selector sent to instance
For now the only way to rebuild all the project it to delete the
build folder from SharedCode and run Xcode build again.
Does it work as expected?