-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: main
Are you sure you want to change the base?
[Experimental] Initial draft of external dependencies implementation #47
Conversation
): String = """ | ||
// swift-tools-version:5.5 | ||
// swift-tools-version:5.6 | ||
import PackageDescription | ||
|
||
let package = Package( |
There was a problem hiding this comment.
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.
"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, thanks
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IlyaGulya I feel the same way! But at least by providing an option for self-parsing, it adds flexibility, so others won’t need to go through the hassle I did—modifying and locally publishing changes to the plugin code just to make it work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's possible to do some operation on the manifest with the command line see: #37 (comment)
Also, setting the platform in the manifest is a mandatory feature.
For VersionRange, it's not possible to have a specific one We need to try/cacth every swift step and print on the ouput the error, it's important for the user All test are passing except local package The local package need to be done
we can now use local path, some manual update has been done all tests are passing
add new test for building and liking Firebase using triple for specify the build target
you can set multiple product from a dependency like Firebase
update comment in interface
We can now set the toolsVersion from the plugin By default, the command line uses the latest swift version available. By at some cases, it can't work and a specific version need to be set.
It needs to be set at Warning Level or it will be considered as a Error.
set a non null default value for toolsVersion in CompileTask
rollback unwanted commit change
moving all command for updating the manifest to CreatePackageSwift
replace indexOfFirst with contains
move from the CLI to String template toolsVersion is by default in version 5.6 and not the current compiler version The current template has been tested ion 5.6 and could not work in the later/earlier version if specified by the user.
@IlyaGulya I'm going to make another PR based from this current branch about local/remote binary. It's another useful feature. |
@frankois944 sure, it would be awesome 🙂 |
@IlyaGulya What's the remaining work here? I'm willing to contribute to speed things up and get this merged 👀 |
This may be relevant: PaGr0m/kotlin-spm-plugin#7 |
Hi, I tried out the plugin based on the branch named here. When I try to sync Gradle, a FileNotFoundException happens on the
Here's the output of the task it says failed, which lists a warning not an error:
The directory listed in the error doesn't exist, rather this one: This happens even with system dependencies only. No remote package here.
I have Xcode 15.x installed, not 16 (I cannot update the OS to install 16, and I'm not building to submit to Apple App Store). Still, I would appreciate it if you could check this out before merging. I'll see if there's some workaround like symlinking that will help for now. P.S. I'm also on an Intel Mac |
Gradle sync works when I change |
Suppose this is also relevant: https://youtrack.jetbrains.com/issue/KT-53877 |
Hi everyone! |
@IlyaGulya I made an alternative which your repository make me inspiration, but I went far further. Here mine, need a lot of feedback |
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: