-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
Generate new proto rules with gazelle #808
Comments
Some questions:
|
|
Most of the time, it seems like the import is just a path within the current repository, but in examples/proto/grpc/my_svc.proto, there's an import of google/protobuf/any.proto that gets translated into |
That's one of the magical special rules. |
Gazelle now generates proto_library, go_proto_library, and go_grpc_library rules. proto_library will contain .proto files in a directory. go_{proto,grpc}_library are buildable libraries, linked with the proto_library. A go_library rules embeds the go_{proto,grpc}_library and includes an extra .go sources (but .pb.go files are excluded). The new proto rule generation is turned on by default in packages that don't have existing proto rules. If there are existing rules, proto rule generation will either follow previous behavior (if go_proto_library.bzl is loaded) or will be disabled (if go_proto_library is loaded from some other repo). The proto mode can be selected explicitly with the -proto command line flag or with the '# gazelle:proto' directive. Legacy rules can be migrated with 'gazelle fix'. Limitations: * Gazelle still only allows one package per directory. Gazelle infers package name and import path from .proto files. These must match other files in the directory. * Import resolution is fairly crude and is just a guess, based on the import string. * There's no way to import protos from other repositories, except for Well Known Types. Fixes bazel-contrib#808
Gazelle now generates proto_library, go_proto_library, and go_grpc_library rules. proto_library will contain .proto files in a directory. go_{proto,grpc}_library are buildable libraries, linked with the proto_library. A go_library rules embeds the go_{proto,grpc}_library and includes an extra .go sources (but .pb.go files are excluded). The new proto rule generation is turned on by default in packages that don't have existing proto rules. If there are existing rules, proto rule generation will either follow previous behavior (if go_proto_library.bzl is loaded) or will be disabled (if go_proto_library is loaded from some other repo). The proto mode can be selected explicitly with the -proto command line flag or with the '# gazelle:proto' directive. Legacy rules can be migrated with 'gazelle fix'. Limitations: * Gazelle still only allows one package per directory. Gazelle infers package name and import path from .proto files. These must match other files in the directory. * Import resolution is fairly crude and is just a guess, based on the import string. * There's no way to import protos from other repositories, except for Well Known Types. Fixes #808
Needs to generate both proto_library and go_proto_library rules when it sees a proto file.
The text was updated successfully, but these errors were encountered: