Giter Club home page Giter Club logo

Comments (7)

pcj avatar pcj commented on June 4, 2024

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.

clanstyles avatar clanstyles commented on June 4, 2024

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.

clanstyles avatar clanstyles commented on June 4, 2024

Gazelle actually deletes the go_library you build to reference the go_proto_library.

from rules_proto.

bufdev avatar bufdev commented on June 4, 2024

I'm writing such a tool as well FYI, but also not exposed.

from rules_proto.

bufdev avatar bufdev commented on June 4, 2024

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.

alexeagle avatar alexeagle commented on June 4, 2024

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.

pcj avatar pcj commented on June 4, 2024

Wow, old issue, this is now implemented on master.

from rules_proto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.