Comments (7)
Meaning, given a repository with proto files, automatically generate BUILD.bazel files for them? I have written such a tool but have not open-sourced it ATM, still pretty rough.
from rules_proto.
Yeah. Basically Gazelle does this for the Go code, you just have to go in and tweak it.
Right now I'm writing some build files for a bunch of ours and it's just taking forever. Most of it is boilerplate.
from rules_proto.
Gazelle actually deletes the go_library
you build to reference the go_proto_library
.
from rules_proto.
I'm writing such a tool as well FYI, but also not exposed.
from rules_proto.
A little update here: I have this up on a branch, but I think I/we should abandon this in favor leaning into Gazelle.
Long:
Here's an example of what I have right now:
https://github.com/uber/prototool/blob/bazel-generate/Makefile#L77
https://github.com/uber/prototool/blob/bazel-generate/example/proto/prototool.yaml#L21
https://github.com/uber/prototool/blob/bazel-generate/example/proto/uber/foo/v1/BUILD.bazel
This was fun to build, however after doing so, I looked more into Gazelle and they just (in the last two months or so) released Language extensions. There is definitely some help we could provide in making this a bit more abstract if the Gazelle maintainers were open to it, but I think it would be preferable if there were a single Bazel rule generation framework that was extensible (IMO, extensible, configurable Bazel rule generation is the missing killer Bazel tool). Instead of us all building our own tooling, it'd be nice to centralize the effort so everyone isn't reinventing the wheel (for example, prototool bazel generate
is just an extremely simplistic framework relative to Gazelle for Bazel rules)
I filed bazelbuild/bazel-gazelle#452 but as I mention there, I think stackb rules would be better done separately. We could have Language
implementation in stackb for Gazelle. An example of an existing one is at https://github.com/achew22/rules_sass Internally, I've found this relatively easy to set up, although it would be nice if there were some plugin mechanism (think protoc, but 2019 edition without some of the cruft) that didn't require building a new binary, or alternatively Gazelle was an abstract Golang library that allowed easy creation of independent binaries.
from rules_proto.
FWIW I know @pcj has written a Gazelle plugin for generating these rules at one client, I think we could open-source
from rules_proto.
Wow, old issue, this is now implemented on master.
from rules_proto.
Related Issues (20)
- Feature Request: Add support for protoc-gen-openapiv2
- proto_compile rule generator sorts "plugins" lexicographically HOT 1
- proto_compiled_sources outputs to the wrong directory HOT 7
- Failing to use rules_js/js_binary as a workable tool for proto_plugin HOT 1
- Failed to compile `proto_go_library()` HOT 2
- `proto_gazelle()` failed to use `config.yaml` HOT 5
- Some deps will not be resolved if run for only a dir HOT 1
- grpc server reflection failed in golang HOT 1
- WorkspaceSnippet is ignored in deps gen HOT 2
- Migrate to new rules_js/aspect_rules_ts? HOT 3
- rules_proto & rules_go problems / general dependency problems HOT 1
- checksum changed for `rules_proto` and dependencies HOT 1
- question: could you pinpoint the protoc version of this repository compared to bazelbuild/rules_proto? HOT 1
- bzlmod support HOT 4
- No such package '@com_github_grpc_grpc// HOT 1
- Bad syntax for proto_repository_tools_srcs.bzl HOT 3
- Publish a new release? HOT 2
- Support for rules_go 0.41.0 and gazelle 0.32.0
- proto_gazelle is not gathering up all data for runfiles
- fatal error: concurrent map read and map write HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_proto.