Michal Klimczak
10/18/2024, 3:27 PMembedAndSignAppleFrameworkForXcode
and for release assembleSharedReleaseXCFramework
. The building part is easy, I just conditionally run one gradle task or the other. Things get messy when the framework needs to be embedded.
I can't use the Embed Frameworks build phase to embed shared.xcframework, because it will also require the xcframework for debug builds. There is no conditonal setting there. And I tried to embed it manually via xcconfig or another script the copies and signs the framework, but I always end up with "No such module 'shared'" in xcode.
Do you have a similar setup? Or maybe I am trying to do something completely useless? My idea was that for debug builds I want the faster method but for release I need xcframework.François
10/18/2024, 4:11 PMMichal Klimczak
10/18/2024, 4:12 PMFrançois
10/18/2024, 4:38 PMFrançois
10/18/2024, 4:41 PMMichal Klimczak
10/18/2024, 4:42 PMFrançois
10/18/2024, 4:42 PMFrançois
10/18/2024, 4:43 PMFrançois
10/18/2024, 4:44 PM-framework NameOfYouFramework
Michal Klimczak
10/18/2024, 4:44 PMFRAMEWORK_SEARCH_PATHS = $(inherited) $(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)
OTHER_LDFLAGS = -framework shared
Release.xcconfig
FRAMEWORK_SEARCH_PATHS = $(inherited) $(SRCROOT)/../shared/build/XCFrameworks/release
OTHER_LDFLAGS = -framework shared
(and of course i reference those xcconfigs properly, they are used in the build process, i checked that)Michal Klimczak
10/18/2024, 4:44 PMFrançois
10/18/2024, 4:46 PMMichal Klimczak
10/18/2024, 4:47 PMRun script build phase 'Build the framework' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
and then it's just the error
/Users/.../iosApp/iosApp/iOSApp.swift:2:8: No such module 'shared'
François
10/18/2024, 4:48 PMFrançois
10/18/2024, 4:54 PMMichal Klimczak
10/18/2024, 4:56 PMFrançois
10/18/2024, 4:59 PMPablichjenkov
10/19/2024, 3:20 AMframework
integration the other with the xcframework
integration and using SPM. The down side is that I had to keep rebasing all the time.Pablichjenkov
10/19/2024, 3:22 AMMichal Klimczak
10/19/2024, 6:55 AMembedAndSignAppleFrameworkForXcode
does under the hood, maybe it's worth checking out (leaving it here mostly for myself to find it later https://github.com/JetBrains/kotlin/blob/dcb77235383a76e8915fe6cba5b093287ab8de5e/[…]org/jetbrains/kotlin/gradle/plugin/mpp/apple/AppleXcodeTasks.kt)Michal Klimczak
10/20/2024, 9:16 AMembedAndSign..
. task. It generates more than one architecture for production build in a form of a fat framework. Although maybe the fat framework is not an ideal choice in the long run...