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

Example of working with Bazel #2140

Closed
mikeamosov opened this issue May 13, 2021 · 4 comments
Closed

Example of working with Bazel #2140

mikeamosov opened this issue May 13, 2021 · 4 comments
Labels

Comments

@mikeamosov
Copy link

mikeamosov commented May 13, 2021

📚 Documentation

Hello. Where can I find an example of how to use the library with Bazel.

  1. I tried the examples from examples/internal, but didn't understand how to generate Go and Swagger files. In the example, these files are already there, when I try to collect them from myself, I just have the Go files collected in the Bazel cache.
    Is there an example of an echo server with automatic generation of these files?

  2. How to use ' grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ' together with Bazel?
    I get the following error:

ERROR: /example/BUILD.bazel:5:14: no such package 'protoc-gen-openapiv2/options': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /protoc-gen-openapiv2/options and referenced by '//example:example_proto'
  1. How do I get the generated files to the folder with the .proto file? I don't understand how you can write code in the IDE without it. As I understand it, only write a script that will take files out of the assembly?
@videlanicolas
Copy link

There's no documentation on how to get started with this using bazel. I have a bazel setup + gazelle and I'm still getting errors while building a simple example.

I'll post the work that I'm doing in order to have something submitted to this codebase.

@johanbrandhorst
Copy link
Collaborator

Sorry for the radio silence here, you're right that the bazel documentation is definitely lacking. I'm not personally very experience with its use so I would appreciate any contributions that could help newcomers use our bazel tooling.

@pbsf
Copy link

pbsf commented Jul 21, 2021

I just created a dummy repository that uses bazel to import grpc-gateway and generate the openapiv2 documentation from a proto file: https://github.com/pbsf/protoc-gen-openapi-bazel-example. I hope that helps.

The protobuffer, go and gazelle versions are important, so are the commands order on the WORKSPACE.

@stale
Copy link

stale bot commented Sep 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 19, 2021
@stale stale bot closed this as completed Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants