Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ SYFT_VERSION ?= v0.87.0
GORELEASER := $(BIN_DIR)/goreleaser
GORELEASER_VERSION ?= v1.20.0

PROTOC_GO := $(BIN_DIR)/protoc-gen-go
PROTOC_GO_VERSION ?= v1.35.2

PROTOC_GO_GRPC := $(BIN_DIR)/protoc-gen-go-grpc
PROTOC_GO_GRPC_VERSION ?= v1.5.1

RSTCHECK := $(shell command -v rstcheck)
MARKDOWNLINT := $(shell command -v mdl)

Expand Down Expand Up @@ -74,11 +80,11 @@ showcoverage: test
$(GO) tool cover -html=profile.out

.PHONY: generate
generate: keyservice/keyservice.pb.go
generate: install-protoc-go install-protoc-go-grpc keyservice/keyservice.pb.go
$(GO) generate

%.pb.go: %.proto
protoc --go_out=plugins=grpc:. $<
protoc --plugin gen-go=$(PROTOC_GO) --plugin gen-go-grpc=$(PLUGIN_GO_GRPC) --go-grpc_opt=require_unimplemented_servers=false --go-grpc_out=. --go_out=. $<

.PHONY: functional-tests
functional-tests:
Expand Down Expand Up @@ -112,6 +118,14 @@ install-goreleaser:
install-syft:
$(call go-install-tool,$(SYFT),github.com/anchore/syft/cmd/syft@$(SYFT_VERSION),$(SYFT_VERSION))

.PHONY: install-protoc-go
install-protoc-go:
$(call go-install-tool,$(PROTOC_GO),google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GO_VERSION),$(PROTOC_GO_VERSION))

.PHONY: install-protoc-go-grpc
install-protoc-go-grpc:
$(call go-install-tool,$(PROTOC_GO_GRPC),google.golang.org/grpc/cmd/protoc-gen-go-grpc@$(PROTOC_GO_GRPC_VERSION),$(PROTOC_GO_GRPC_VERSION))

# go-install-tool will 'go install' any package $2 and install it to $1.
define go-install-tool
@[ -f $(1)-$(3) ] || { \
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ require (
github.com/blang/semver v3.5.1+incompatible
github.com/fatih/color v1.18.0
github.com/getsops/gopgagent v0.0.0-20240527072608-0c14999532fe
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.6.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/goware/prefixer v0.0.0-20160118172347-395022866408
Expand Down
Loading
Loading