Skip to content

Commit 6c92592

Browse files
committed
protobuild: replace protobuild command
To make the protobuild tool broadly useful, it has been broken out into a separate project. This PR replaces the command with a configuration file. Signed-off-by: Stephen J Day <stephen.day@docker.com>
1 parent 31324e5 commit 6c92592

File tree

3 files changed

+33
-263
lines changed

3 files changed

+33
-263
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ INTEGRATION_PACKAGE=${PKG}
2828
TEST_REQUIRES_ROOT_PACKAGES=$(shell for f in $$(git grep -l testutil.RequiresRoot | grep -v Makefile);do echo "${PKG}/$$(dirname $$f)"; done)
2929

3030
# Project binaries.
31-
COMMANDS=ctr containerd protoc-gen-gogoctrd dist ctrd-protobuild
31+
COMMANDS=ctr containerd protoc-gen-gogoctrd dist
3232
ifneq ("$(GOOS)", "windows")
3333
COMMANDS += containerd-shim
3434
endif
@@ -61,14 +61,15 @@ setup: ## install dependencies
6161
@go get -u github.com/golang/lint/golint
6262
#@go get -u github.com/kisielk/errcheck
6363
@go get -u github.com/gordonklaus/ineffassign
64+
@go get -u github.com/stevvooe/protobuild
6465

6566
generate: protos
6667
@echo "$(WHALE) $@"
6768
@PATH=${ROOTDIR}/bin:${PATH} go generate -x ${PACKAGES}
6869

69-
protos: bin/protoc-gen-gogoctrd bin/ctrd-protobuild ## generate protobuf
70+
protos: bin/protoc-gen-gogoctrd ## generate protobuf
7071
@echo "$(WHALE) $@"
71-
@PATH=${ROOTDIR}/bin:${PATH} ctrd-protobuild ${PACKAGES}
72+
@PATH=${ROOTDIR}/bin:${PATH} protobuild ${PACKAGES}
7273

7374
checkprotos: protos ## check if protobufs needs to be generated again
7475
@echo "$(WHALE) $@"

Protobuild.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version = "unstable"
2+
generator = "gogoctrd"
3+
plugins = ["grpc"]
4+
5+
# Control protoc include paths. Below are usually some good defaults, but feel
6+
# free to try it without them if it works for your project.
7+
[includes]
8+
# Include paths that will be added before all others. Typically, you want to
9+
# treat the root of the project as an include, but this may not be necessary.
10+
before = ["."]
11+
12+
# Paths that should be treated as include roots in relation to the vendor
13+
# directory. These will be calculated with the vendor directory nearest the
14+
# target package.
15+
vendored = ["github.com/gogo/protobuf"]
16+
17+
# Paths that will be added untouched to the end of the includes. We use
18+
# `/usr/local/include` to pickup the common install location of protobuf.
19+
# This is the default.
20+
after = ["/usr/local/include"]
21+
22+
# This section let's us map protobuf imports to Go packages. These will become
23+
# `-M` directives in the call to the go protobuf generator.
24+
[packages]
25+
"gogoproto/gogo.proto" = "github.com/gogo/protobuf/gogoproto"
26+
"google/protobuf/any.proto" = "github.com/gogo/protobuf/types"
27+
"google/protobuf/descriptor.proto" = "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
28+
"google/protobuf/field_mask.proto" = "github.com/gogo/protobuf/types"
29+
"google/protobuf/timestamp.proto" = "github.com/gogo/protobuf/types"

cmd/ctrd-protobuild/main.go

Lines changed: 0 additions & 260 deletions
This file was deleted.

0 commit comments

Comments
 (0)