-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Proposal: Revised plugin system #139
Comments
Personally, I use minor plugins that I create myself sometimes, so having some kind of plugin system is preferable. One aspect of this is that many CI services are smart about caching bundled gems, npm packages, etc so installing them is very fast. Unfortunately, SPM is not big enough for CI services to optimize for yet, and probably won’t be soon. |
Yeah, good point on the build caching ( I just added it to this repo ) Looks like my idea of moving your dependencies to be owned by the project won't work, because SwiftPM uses urls for resolving dependencies, it can't know that |
I personally think that put all in danger has two downsides:
Today there is not a big number of plugins, I agree, but some potential plugins could be
Then i suppose that would be more future proof allow people to integrate the plugin they want. |
I don't mean to deprecate plugins completely, just to make them normal packages though SwiftPM instead of as special magic dependencies added at runtime. Then to also move the most common ones into Danger so that they are available by default, without needing the plugin system. I now also realized that it'd just be in danger-swift where the above would be an issue, so that still makes it feasible. |
Yeah, I think Danger Swift should follow the example of Cocoa architecture: common things should be easy, and uncommon things should be possible. Orta's clarification in the above comment fits that paradigm really well, and I think would be a good step forward for Danger Swift. |
OK: so, what I think could work.
// swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "Eigen",
products: [
.library(name: "Danger", type: .dynamic, targets: ["Danger"]),
],
dependencies: [
.package(url: "https://github.com/danger/swift.git", from: "1.0.0"),
.package(url: "https://github.com/orta/danger-plugin-swiftformat.git", from: "1.0.0")
],
targets: [
.target(name: "Danger", dependencies: ["Danger", "DangerSwiftFormat"], path: "Artsy", sources: ["Stringify.swift"]),
]
)
Advantages:
Downsides:
|
I really like the idea of moving the plugins as SPM package - it seems like a smart move to me and will also allow CI providers to provide better caching to these artifacts at a later phase |
I personally like the idea of using SPM, the file in the danger target could be the |
So, the current idea of plugins is great until we got it working out in prod for a while.
Roughly how it is now:
This is fine, but it's actually not. It takes forever to clone and build all of those dependencies and causes #97
So, instead I have two proposals:
Because Swift's tooling set is so much smaller, we could take SwiftLint and SwiftFormat and move them into Danger for Swift
Roughly deprecate the need for using plugins anyway, if everyone is gonna use the same ones anyway. It's a tighter eco-system, so maybe Danger can be more focused? I'm open to change.
Move then idea of plugins from being owned by Danger to being owned by SwiftPM
This is aiming to save build time, by not re-cloning, and re-building danger etc. We'd need to figure out how to make local library dependencies available to the runtime Dangerfile, but I don't think that's too tricky in my head. I've just not put enough thought into how that can actually work.
The text was updated successfully, but these errors were encountered: