Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Experimental] Initial draft of external dependencies implementation #47

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

IlyaGulya
Copy link
Collaborator

This PR contains my first thoughts on how external dependencies might be added to swiftklib project.
Currently there's just experimental public API for simplest case - single KMP module.
Also, there's tests for this new API.

What to do next:

  1. Support sharing SPM dependency configurations between gradle modules
  2. Provide APIs to configure publication of libraries using swiftklib plugin?
  3. ???

): String = """
// swift-tools-version:5.5
// swift-tools-version:5.6
import PackageDescription

let package = Package(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add options to set "platforms" too in the Package.
Pls take a quick look -> https://github.com/wh173d3v11/swift-klib-plugin/blob/2286d680ddfdc057e077e9306ad9e11cb54806f2/plugin/src/main/kotlin/io/github/ttypic/swiftklib/gradle/templates/CreatePackageSwift.kt#L11
Example - platforms: [.iOS(.v13), .macOS(.v11)]

Because, in some cases we need to set the minimum version. So, if i not add this line in my usecase, i got error like
"the library 'iosOnnx' requires macos 10.13, but depends on the product 'onnxruntime' which requires macos 11.0; consider changing the library 'iosOnnx' to require macos 11.0 or later, or the product 'onnxruntime' to require macos 10.13 or earlier.
"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure about this whole Package.swift generation, tbh.
but another approach is even worse - parsing Package.swift ourselves 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants