Rostislav Utrobin
04/08/2020, 8:37 AMspec.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?magnumrocha
04/08/2020, 8:40 AMsyncFramework
task basically make a copy of the produced framework on your KMP module build folder to the Pod local framework foldermagnumrocha
04/08/2020, 8:41 AMmagnumrocha
04/08/2020, 8:42 AMsyncFramework
task is added as a build step in XCode for the Pod that represents your library....Rostislav Utrobin
04/08/2020, 8:46 AMmagnumrocha
04/08/2020, 8:47 AMsyncFramework
task depends on build
task in gradlemagnumrocha
04/08/2020, 8:48 AMbuild
will runs before the syncFramework
Rostislav Utrobin
04/08/2020, 8:52 AMbuild
task understand that code was changed and it should recompile the framework ?magnumrocha
04/08/2020, 8:54 AMmagnumrocha
04/08/2020, 8:55 AMRostislav Utrobin
04/08/2020, 9:01 AMbuild
task sees the code was changed and recompile it (or just uses existed code if wasn’t changed)magnumrocha
04/08/2020, 9:03 AMXCode build
-> KMP Pod build
-> syncFramework
-> KMP Lib build in gradle
(if not already build)Rostislav Utrobin
04/08/2020, 9:11 AMXcode build
-> KMP Pod build
-> syncFramework
-> KMP Lib build in gradle
(if not already built or my KMP code has any changes since last build)magnumrocha
04/08/2020, 9:17 AM