Skip to content

Commit

Permalink
anapaya-hackathon: generate connect rpc code with bazel
Browse files Browse the repository at this point in the history
Generate the connect rpc code with bazel to not depend on buf being installed
on the host.
  • Loading branch information
oncilla committed Dec 13, 2023
1 parent a59c920 commit c6109d8
Show file tree
Hide file tree
Showing 50 changed files with 28 additions and 10,301 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ protobuf:
cp -r bazel-bin/pkg/proto/*/*/go_default_library_/github.com/scionproto/scion/pkg/proto/* pkg/proto
chmod 0644 pkg/proto/*/*.pb.go

bazel run @buf//:buf -- generate --output $(PWD) --path proto

mocks:
tools/gomocks.py

Expand Down
8 changes: 8 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ container_pull(
tag = "10",
)

# Buf CLI to generate connect-go
http_archive(
name = "buf",
build_file_content = "exports_files([\"buf\"])",
strip_prefix = "buf/bin",
urls = ["https://github.com/bufbuild/buf/releases/download/v1.28.1/buf-Linux-x86_64.tar.gz"],
)

# protobuf/gRPC
http_archive(
name = "rules_proto_grpc",
Expand Down
5 changes: 1 addition & 4 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
version: v1
plugins:
- plugin: go
out: gen
opt: paths=source_relative
- plugin: connect-go
out: gen
out: pkg
opt: paths=source_relative
12 changes: 0 additions & 12 deletions bufgen/proto/control_plane/experimental/v1/BUILD.bazel

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions bufgen/proto/control_plane/v1/BUILD.bazel

This file was deleted.

Loading

0 comments on commit c6109d8

Please sign in to comment.