luca992 / multiplatform-swiftpackage

Gradle plugin that generates a Swift Package Manager manifest and an XCFramework to distribute a Kotlin Multiplatform library for Apple platforms.
Apache License 2.0
77 stars 13 forks source link

Include compose resources in SPM #19

Open checoalejandro opened 3 months ago

checoalejandro commented 3 months ago

How can I achive to include Jetbrains compose resources to be part of the generated SPM in a KMP project with composeResources/files folder, just like described here: Raw files.

When using same project as a pod, resources are passed as expected.

I would expect package to have Resources folder, and Package.swift to also detail as such.

Thanks.

multiplatform-swiftpackage version 2.2.2 kotlin 1.9.23 Compose 1.6.1

luca992 commented 3 months ago

I've never played around with exporting resource files in a swift package. Do you know of any example swift projects that do that for reference? But fyi, I don't really have time to try and implement that right now, but prs are welcome.

checoalejandro commented 3 months ago

I understand this is rare, we need to have a local server running for both platforms using ktor-server and some responses are part from a resource list. I will try to get a pr.

Thanks.

dmikots commented 2 months ago

@checoalejandro Do you have some news about Resources?

checoalejandro commented 2 months ago

@checoalejandro Do you have some news about Resources?

Yes, I used moko-resources as it's based and those resources were included as expected in the SPM.

I also implemented an actual/expect to retrieve the content of the files based in file name, different from what moko resources does by using an object class. That last is more of a tip.

dmikots commented 2 months ago

@checoalejandro can you provide a sample project? this is a very important thing for us. I want to use compose multiplatform resources or another library. using only xcframework. without using cocoapods. The project needs fonts and pictures