Skip to content

Is there any native support for rules_proto_grpc rule to work with bazel-gazelle? #220

Description

@teabuff

Description

Hi,

I am using bazel-gazelle to automate the BUILD file generator and dependency management. But it seems gazelle does not natively work with the rules_proto_grpc. E.g. I have an example.proto which defines a simple the grpc service and runs gazelle by default generate the following BUILD file:

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")

proto_library(
    name = "example_proto",
    srcs = ["example.proto"],
)

go_proto_library(
    name = "example_go_proto",
    compilers = ["@io_bazel_rules_go//proto:go_grpc"],
    importpath = "github.com/<account>/<repo>/samples/proto/example",
    proto = ":example_proto",
)

go_library(
    name = "example",
    embed = [":example_go_proto"],
    importpath = "github.com/<account>/<repo>/samples/proto/example",
)

Looks like it is using the rules_proto rule instead of those rules defined in the rules_proto_grpc. Is there any support similar to https://github.com/stackb/rules_proto#gazelle-configuration that instruct gazelle to use the rules_proto_grpc correctly like the following:

load("@rules_proto_grpc//go:defs.bzl", "go_grpc_library")

go_grpc_library(
    name = "example_go_grpc",
    importpath = "github.com/<account>/<repo>/samples/proto/example",
    protos = [":example_proto"],
)

Thank you so much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions