hadiyarajesh / flower

Flower simplifies networking and database caching on Android/Multiplatform.
Apache License 2.0
289 stars 27 forks source link

iOS support in multiplatform #43

Open lmbotero opened 3 months ago

lmbotero commented 3 months ago

Hi, I'm trying to add Flower to my multiplatform project (JVM, Android, and iOS). Everything seems to work well if I only declare the Android and JVM source sets in Gradle, but if I add the following configuration I get an error syncing Gradle (Everything works well if I remove the iOS SourceSets or the flower dependency)

    val iosX64Main by getting
    val iosArm64Main by getting
    val iosSimulatorArm64Main by getting
    val iosMain by creating {
        dependsOn(commonMain)
        iosX64Main.dependsOn(this)
        iosArm64Main.dependsOn(this)
        iosSimulatorArm64Main.dependsOn(this)
        ...
    }

Execution failed for task ':composeApp:transformIosMainCInteropDependenciesMetadataForIde'.

Could not resolve all files for configuration ':composeApp:iosX64CompilationDependenciesMetadata'. Could not find io.github.hadiyarajesh.flower-ktorfit:flower-ktorfit-iosx64:3.1.0. Searched in the following locations:

Possible solution:

More than an issue I want to know if is there currently supporting iOS in multiplatform projects.

Thanks!

hadiyarajesh commented 3 months ago

@DatL4g can you check on this?

DatL4g commented 3 months ago

The project is configured correctly, that means iOS targets are setup up to build and publish.

@hadiyarajesh The publish workflow however does not support building for iOS and macOS.
Simply change https://github.com/hadiyarajesh/flower/blob/master/.github/workflows/publish-release.yml#L15 this to macos-latest (This supports all targets, even linux, windows, etc...).

Additionally the Ktorfit module needs to be updated, I have no time to do this but the migration should not be that difficult.