Skip to content
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

Add generate_internal_visibility_from_proto_files feature #962

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tylervick
Copy link

Fixes #961

Change
Create a new feature swift.generate_internal_visibility_from_proto_files which will set protoc's swift_opt Visibility from Public to Internal.

Test

  • Create a valid rule for swift_grpc_library or swift_proto_library
    • Verify the generated sources still have the "public" access modifier
  • Add the swift.generate_internal_visibility_from_proto_files to the features attribute for the above rule
    • Verify the generated sources now omit access modifiers (implicitly internal)

Note
The ideal solution would be to make the Public setting opt-in for this feature, thereby mirroring default protoc Swift plugin behavior. Since rules_swift has always defaulted to public visibility this should instead remain the default.

@google-cla
Copy link

google-cla bot commented Jan 4, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Contributor

@mattrobmattrob mattrobmattrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition, @tylervick!

Two things:

  1. Mind adding an example/validation of this flag similar to //examples/xplatform/proto:example_path_to_underscores_proto with features = ["swift. generate_internal_visibility_from_proto_files"] that validates this functionality?
  2. Can you move the //third_party/... formatting changes to a separate PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[swift_proto_library] Generated types are always public
2 participants