-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build) automate proto make and detect out of sync with Kong (#129)
- Loading branch information
1 parent
afb8672
commit 5775452
Showing
5 changed files
with
1,204 additions
and
818 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
proto_def = ./server/kong_plugin_protocol/pluginsocket.proto | ||
proto_def_compiled = ./server/kong_plugin_protocol/pluginsocket.pb.go | ||
|
||
.PHONY: lint | ||
lint: | ||
.PHONY: lint test dep sync_with_kong | ||
lint: $(proto_def_compiled) | ||
golangci-lint run --exclude composites | ||
|
||
.PHONY: dep | ||
dep: | ||
dep: $(proto_def_compiled) | ||
go get -v | ||
go mod tidy | ||
|
||
.PHONY: test | ||
test: | ||
go test -v -race ./... | ||
test: dep | ||
go test -v -race ./... | ||
|
||
sync_with_kong: clean $(proto_def_compiled) | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf $(proto_def) | ||
rm -rf $(proto_def_compiled) | ||
|
||
|
||
$(proto_def): | ||
wget https://raw.githubusercontent.com/Kong/kong/master/kong/include/kong/pluginsocket.proto -P $(shell dirname $@) | ||
|
||
$(proto_def_compiled): $(proto_def) | ||
mkdir -p server/kong_plugin_protocol | ||
protoc -I . $^ --go_out=. --go_opt=paths=source_relative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.