Building KMP Library with resources for iOS

We have a project, where we use compose multiplatform with the multiplatform resources library. The library will be distributed as both a Cocoapods dependency and Swift Package Manager dependency. This inherently means that the project our shared code will be used in doesn’t reside in the same repo. We’re experiencing differences when building through XCode (from the sample project inside the library repo) and from the command line. For example when running podPublishDebugXCFramework the build/compose/ios/<name>/compose-resources directory is missing. The generated podspec within the build folder has the resources directory specified, but since the dir is missing, this leads to MissingResource crashes

# the directory doesn't exist when running podPublishDebugXCFrameworkspec.resources = ['build/compose/ios/KMPPaymentCards/compose-resources'] 

When building through AS or XC (where the gradle syncFrameworks command is hooked as an XC build phase with some mysterious parameters) we have everything we need and the code runs without crashes, showing the expected images. Is there a way to build the library through the command line?

P.s: I know moko-resources have been used a lot, but the library hasn’t been updated recently, there are a lot of open issues on GitHub so I figured it’s safer to stick with the official lib (if possible).

submitted by /u/dephinera_bck
[link] [comments]