-
Notifications
You must be signed in to change notification settings - Fork 380
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
New proto mode: one proto_library per proto #138
Comments
I think it can/should be detected based on the declared package in the
file, just like the go_library rules will be.
…On Fri, Feb 23, 2018, 11:31 Jay Conrod ***@***.***> wrote:
Based on discussion in bazel-contrib/rules_go#1118
<bazel-contrib/rules_go#1118>
Gazelle should be able to produce a proto_library rule (and corresponding
go_proto_library rule) per .proto file. Currently, the default is to
produce one of these one of these for all the protos in a directory in the
default package. This doesn't make sense for projects that store many proto
files in a common directory.
It's likely that this mode will be opt-in (at least at first) either via a
command line flag (-proto=perfile) or directive # gazelle:proto perfile.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#138>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AA0a0DbTiKqSgsdaC0t5O6WuB_wHOR2Xks5tXufUgaJpZM4SRIpE>
.
|
Yes, though currently it doesn't work in either case correct? |
Correct. |
I think package hygiene in protos is so-so, and wouldn't be surprised if a big chunk of them don't specify a package at all. |
This is fixed now, right? The current release of Gazelle is able to generate multiple targets for .proto sources in the same package and directory, based on the presence of file options like |
@jmillikin-stripe That's right, but to avoid breaking users in the default configuration, this is not on by default. You can use directives (or equivalent command line options) to turn it on:
The first directive switches Gazelle into This isn't quite the same as this feature request though. This is asking for separate |
One |
We're going to work on this soon. github.com/googleapis/googleapis will have one |
Wouldn't each |
@vam-google can comment on the specifics better than I can. Currently we use go_googleapis-gazelle.patch and a few other patches to declare Go build rules for that repository. There are a number of |
@jmillikin-stripe, @jayconrod The google/rpc is a special snowflake, when all the three
|
+1 to this feature - I was beginning to work on it on a branch here, but I think it's more involved than it appears at first glance - this isn't impossible to overcome, but some refactoring would be needed (however I might be missing something).
Example:
|
Based on discussion in bazel-contrib/rules_go#1118
Gazelle should be able to produce a
proto_library
rule (and correspondinggo_proto_library
rule) per .proto file. Currently, the default is to produce one of these one of these for all the protos in a directory in the default package. This doesn't make sense for projects that store many proto files in a common directory.It's likely that this mode will be opt-in (at least at first) either via a command line flag (
-proto=perfile
) or directive# gazelle:proto perfile
.The text was updated successfully, but these errors were encountered: