touchlab / KMMBridge

KMMBridge is a set of Gradle tooling that facilitates publishing and consuming pre-built KMM (Kotlin Multiplatform Mobile) Xcode Framework binaries. See https://kmmbridge.touchlab.co/docs to get started.
https://kmmbridge.touchlab.co/
Apache License 2.0
341 stars 20 forks source link

Bundling resources with Swift Package #122

Open surajsau opened 1 year ago

surajsau commented 1 year ago

Trying to publish a module with shared string resource over moko-resources. Internally moko-resources generates Resource files for iOS. However, upon running on device it throws Uncaught Kotlin exception: kotlin.IllegalArgumentException: bundle with identifier xx.xx.MR not found.

Moko resources suggest adding a command to copy over resources in build phase.

Would be nice to add resources field also added in Package.swift when doing spmDevBuild (Bundling resources with Swift Package)

russhwolf commented 1 year ago

Is this an issue just for local builds with spmDevBuild, or also for binary builds? Can toggling between static and dynamic frameworks help?

surajsau commented 1 year ago

I haven't tried it on binary builds but the issue was there for spmDevBuild.

russhwolf commented 1 year ago

We have other priorities at the moment so probably won't get to this soon. But it should be possible to grab the updatePackageSwift task, call doLast {} or similar, and make edits manually.

dalewking commented 8 months ago

Just to be clear here, I think all that needs to happen is that there needs to be a way to bundle some resource files into the generated package. The command that copies them over in a monorepo build is just copying the contents of a directory into the target. That consists of some .lproj directories with Strings files, an Assests.xcassets directory and a files directory