-
-
Notifications
You must be signed in to change notification settings - Fork 624
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
[Suggestion] Add support for the new SPM build plugins #1023
Comments
@BrentMifsud until they support r-Path rewrites you can't build Sourcery properly with SPM only |
Is this possible now (after changes in #1037) ? 🤔 |
yeah it should be possible now, anyone wants to contribute that integration? 😉 |
+1 would love to see this as a feature with apple's new plugin build tool system |
I would love to work on this and might be very interesting in my project at work. It would be my first time contributing. Any tips before I start? |
@doozMen 🙇 shouldn't require anything special given Sourcery now builds purely with SPM. The 2 WWDC sessions about plugins cover everything I think, but if you run into issues you can report here and I can get Apple folks to look at it if we can't figure it out ourselves |
I got this working locally in my own package by wrapping the sourcery-1.8.1-macos executable inside the new(ish) swift artifact bundles for both build commands and command tools (https://theswiftdev.com/introduction-to-spm-artifact-bundles/). @doozMen would happily switch over to plugins provided by the sourcery package instead, or if you want, I can take a shot at it unless you want to first! |
I was trying out building a Command Plugin using Sourcery as a dependency. But I get the following error when the Packages are resolved:
My Package File looks like this:
Any ideas what could be the issue and how to fix it? |
I see SwiftLint also uses static swift syntax release workaround, but not sure how the 2 are related, we don't need SwiftLint in this project, I wonder if it's any related dependency, are you brining in SwiftLint in that project @pkurzok ? |
In the Plugin I'm building Sourcery is literaly the only dependency I'm using. In the project where I'm using the plugin, there is also no direct SwiftLint dependency also dont see it in the package list. I'm wondering where it comes from. Although I have it installed on my machine. But that shouldn't make any difference, does it? |
@pkurzok it shouldn't, I wonder if any of the dependencies of Sourcery has SwiftLint added to it's package |
Found it: stencilswiftkit depends on komondor and they depend on swiftlint. Nice tool for that: https://swift-dependency-graph.opticalaberration.com |
I will follow up on this later cool you guys picked this up already. Will have more time end of July. |
I have found a workable solution for using swiftgen which uses sourcery too I guess. It relies on providing a build artifact. This is very nice explained in SwiftGen/SwiftGen#926. Making sourcery available in a simular way would be a good way to do it. The problem happens when you do not expose it as a build artefact that if you apply it to a target for iOS, which a lot will do, then it will try to build sourcery for a simulator target 🥴 which you do not want. I do not have the time now to make sourcery build into a build artifact nor do I know if somebody did already attempt this kind of thing? |
yeah so @pol-piella is taking this over, and this is superseded by #1090 |
Apple just announced that the new SPM build commands is going to be available in the next version of xcode. Its currently in beta, but adding support for this feature would be an awesome addition to Sourcery
The text was updated successfully, but these errors were encountered: