Skip to content
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

would it be possible to avoid vendoring "third_party/googleapis/" #572

Closed
ensonic opened this issue Mar 13, 2018 · 1 comment
Closed

would it be possible to avoid vendoring "third_party/googleapis/" #572

ensonic opened this issue Mar 13, 2018 · 1 comment

Comments

@ensonic
Copy link
Contributor

ensonic commented Mar 13, 2018

I am currently trying to find ways to actually use protoc-gen-swagger from bazel. the build tools can't manage the way the vendored protos are used, see
bazelbuild/rules_go#1322 (comment)

FYI, my untested build rule looks like this:

load("@com_google_protobuf//:protobuf.bzl", "proto_gen")

def swagger_proto_library(
        name,
        srcs=[],
        deps=[],
        include=None,
        protoc="@com_google_protobuf//:protoc",
        protoc_gen_swagger = "@github_com_grpc_ecosystem_grpc_gateway//protoc-gen-swagger:protoc-gen-swagger",
        internal_bootstrap_hack=False,
        use_grpc_plugin=False,
        default_runtime="@com_google_protobuf//:protobuf",
        **kargs):
  includes = []
  if include != None:
    includes = [include]

  proto_gen(
      name=name,
      srcs=srcs,
      deps=deps,
      includes=includes,
      protoc=protoc,
      plugin=protoc_gen_swagger,
      outs=[s[:-len(".proto")] + ".yaml" for s in srcs],
      visibility=["//visibility:public"],
  )
@ensonic
Copy link
Contributor Author

ensonic commented Apr 27, 2018

Whatever changed, I can now build it! Thanks!

@ensonic ensonic closed this as completed Apr 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant