-
Notifications
You must be signed in to change notification settings - Fork 45
feat: Add directive to control set of GRPC flavors generated by gazelle plugin #650
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
feat: Add directive to control set of GRPC flavors generated by gazelle plugin #650
Conversation
cgrindel
left a comment
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.
Overall, LGTM. Just a couple of questions about some print statements.
|
@cgrindel okay I cleaned up the print statements and also added a second directive to control the proto library generation. Now if you add: to your BUILD file, no swift proto libraries or grpc libraries will be generated. I verified this by deleting the generated BUILD files in the grpc_example and regenerating them with those directives. I then added back: and verified it regenerated the targets as expected. This is also the default behavior to preserve the existing functionality for any users who might have started relying on this already. |
cgrindel
left a comment
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.
LGTM
|
@AttilaTheFun It looks like the GRPC examples are failing and we may need to run |
Head branch was pushed to by a user without write access
…#220) [](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | rules_swift_package_manager | bazel_dep | minor | `0.14.0` -> `0.15.0` | | [rules_swift_package_manager](https://togithub.com/cgrindel/rules_swift_package_manager) | http_archive | minor | `v0.14.0` -> `v0.15.0` | --- ### Release Notes <details> <summary>cgrindel/rules_swift_package_manager (rules_swift_package_manager)</summary> ### [`v0.15.0`](https://togithub.com/cgrindel/rules_swift_package_manager/releases/tag/v0.15.0) [Compare Source](https://togithub.com/cgrindel/rules_swift_package_manager/compare/v0.14.0...v0.15.0) #### What's Changed - chore: update README.md for v0.14.0 by [@​cgrindel-app-token-generator](https://togithub.com/cgrindel-app-token-generator) in [https://github.com/cgrindel/rules_swift_package_manager/pull/648](https://togithub.com/cgrindel/rules_swift_package_manager/pull/648) - chore(deps): update dependency vapor/vapor to v4.84.4 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/646](https://togithub.com/cgrindel/rules_swift_package_manager/pull/646) - chore(deps): update dependency rules_xcodeproj to v1.12.1 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/642](https://togithub.com/cgrindel/rules_swift_package_manager/pull/642) - chore(deps): update dependency nicklockwood/swiftformat to from: "0.52.7" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/649](https://togithub.com/cgrindel/rules_swift_package_manager/pull/649) - chore(deps): update dependency stripe/stripe-ios to from: "23.17.1" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/651](https://togithub.com/cgrindel/rules_swift_package_manager/pull/651) - fix: enable `nimble_example` by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/654](https://togithub.com/cgrindel/rules_swift_package_manager/pull/654) - chore(deps): update dependency vapor/vapor to v4.84.6 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/653](https://togithub.com/cgrindel/rules_swift_package_manager/pull/653) - chore(deps): update dependency cgrindel_bazel_starlib to v0.18.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/656](https://togithub.com/cgrindel/rules_swift_package_manager/pull/656) - chore(deps): update dependency rules_swift to v1.12.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/657](https://togithub.com/cgrindel/rules_swift_package_manager/pull/657) - chore(deps): update dependency quick/nimble to v13 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/655](https://togithub.com/cgrindel/rules_swift_package_manager/pull/655) - feat: Add directive to control set of GRPC flavors generated by gazelle plugin by [@​AttilaTheFun](https://togithub.com/AttilaTheFun) in [https://github.com/cgrindel/rules_swift_package_manager/pull/650](https://togithub.com/cgrindel/rules_swift_package_manager/pull/650) **Full Changelog**: cgrindel/rules_swift_package_manager@v0.14.0...v0.15.0 #### Bazel Module Snippet ```python bazel_dep(name = "rules_swift_package_manager", version = "0.15.0") ``` #### Workspace Snippet ```python load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_swift_package_manager", sha256 = "b55c6a626d358bdc80dd61a18f5da87b7c71ec1f54f12f16ab4a1b18d19fe2ca", urls = [ "https://github.com/cgrindel/rules_swift_package_manager/releases/download/v0.15.0/rules_swift_package_manager.v0.15.0.tar.gz", ], ) load("@​rules_swift_package_manager//:deps.bzl", "swift_bazel_dependencies") swift_bazel_dependencies() load("@​cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies") bazel_starlib_dependencies() ### MARK: - Gazelle ### gazelle:repo bazel_gazelle load("@​bazel_gazelle//:deps.bzl", "gazelle_dependencies") load("@​rules_swift_package_manager//:go_deps.bzl", "swift_bazel_go_dependencies") load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") ### Declare Go dependencies before calling go_rules_dependencies. swift_bazel_go_dependencies() go_rules_dependencies() go_register_toolchains(version = "1.19.1") gazelle_dependencies() ### MARK: - Swift Toolchain http_archive( name = "build_bazel_rules_swift", ### Populate with your preferred release ### https://github.com/bazelbuild/rules_swift/releases ) load( "@​build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies", ) load("//:swift_deps.bzl", "swift_dependencies") ### gazelle:repository_macro swift_deps.bzl%swift_dependencies swift_dependencies() swift_rules_dependencies() load( "@​build_bazel_rules_swift//swift:extras.bzl", "swift_rules_extra_dependencies", ) swift_rules_extra_dependencies() ``` </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/bazel-contrib/rules_bazel_integration_test). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44LjEiLCJ1cGRhdGVkSW5WZXIiOiIzNy44LjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR addresses #509 by introducing a new directive to control the set of GRPC flavors for which the gazelle plugin should generate targets. Currently it generates all three (client, client_stubs and server) but this is probably unnecessary for most people. In my case, I'm using Go on the server and Swift on the client and I don't use the client stubs so I really only need the client targets.
To test, I tried deleting the grpc_example generated BUILD file and regenerating it with just client,server and verified it only included those targets. I then added back client_stubs and verified it added that too. (That's why the order of the targets is now swapped in the BUILD file.)