danger / swift

⚠️ Stop saying "you forgot to …" in code review
https://danger.systems/swift/
MIT License
1.04k stars 135 forks source link

Create example approach to Danger framework with module stability #579

Open DavidBrunow opened 1 year ago

DavidBrunow commented 1 year ago

This pull request shows an example implementation of changes that could be made to enable module stability for the Danger dependency used by Dangerfile.swift. It also builds a universal binary for danger-swift.

All credit for the idea goes to @bobergj, I saw this comment, needed to implement it for a fork used internally at work, and thought I'd share it in case it is useful: https://github.com/danger/swift/issues/476#issuecomment-984248497

Drawbacks to this approach in general (as mentioned in that issue):

This specific implementation also has this very large problem:

I've added a script that shows how danger-swift and the Danger.framework can be built.

rarias84 commented 1 year ago

how I can use this approach?

DavidBrunow commented 1 year ago

how I can use this approach?

If you are using GitHub then you cannot use the current state of this because more work would need to be done to wrap the OctoKit dependency.

If you are using a different tool, like BitBucket or GitLab, you can run the build_runner_and_framework.sh script which will create a danger_swift binary and a Danger.framework framework. I've only experimented with those being in the same directory when running Danger Swift but theoretically you could place both somewhere in your path and things would "just work".