ge-org / 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
333 stars 49 forks source link

Does not work with KMP 1.4.20 #8

Closed sebarthel89 closed 3 years ago

sebarthel89 commented 3 years ago

Hi,

thanks for this plugin, it looks exactly what I am looking for.

Unfortunately, I can't get the tasks run successfully with a fresh KMP project version 1.4.20.

My settings:

multiplatformSwiftPackage {
    swiftToolsVersion("5.3")
    targetPlatforms {
        iOS { v("13") }
    }
}

I get 2 errros:

  1. Package name is invalid: null
* What went wrong:
A problem occurred configuring root project 'centralized-key-value-library'.
> Could not create task ':createXCFramework'.
   > * Package name is invalid: null
       Either declare the base name of your frameworks or use a non-empty package name.

I can fix this by setting it manually:

multiplatformSwiftPackage {
    swiftToolsVersion("5.3")
    targetPlatforms {
        iOS { v("13") }
    }
    packageName(project.name)
}
  1. at least one framework or library must be specified.
> Task :createXCFramework FAILED
error: at least one framework or library must be specified

I could not fix this one on my own. Maybe some internal structure has been changed?

ge-org commented 3 years ago

Hi @sebarthel89,

could you share the entire build.gradle file? Or at least the parts where the KMP project is configured?

sebarthel89 commented 3 years ago

Sure, here is a minimal example: https://github.com/sebarthel89/example-kmp-swift-package

ge-org commented 3 years ago

Hey @sebarthel89,

thanks again for the bug report and the sample project.

I published version 2.0.2 which contains a fix. This should also allow you to get rid of the packageName(project.name) config.

It will take a couple of hours for the release to show up on Maven Central. In the meantime you can use version 2.0.2-SNAPSHOT.

sebarthel89 commented 3 years ago

Works, very cool, thank you!

I will create another issue to target a fat framework issue.