Skip to content

Commit

Permalink
update Makefile targets (#10)
Browse files Browse the repository at this point in the history
* update Makefile targets
* tidy
* go mod tidy
  • Loading branch information
ashleywang1 authored Feb 3, 2021
1 parent 2d5adc2 commit aa84714
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 27 deletions.
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PACKAGE_PATH:=github.com/solo-io/anyvendor
OUTPUT_DIR ?= $(ROOTDIR)/_output
SOURCES := $(shell find . -name "*.go" | grep -v test.go)
VERSION ?= $(shell git describe --tags)
DEPSGOBIN=$(shell pwd)/.bin

#----------------------------------------------------------------------------------
# Repo init
Expand All @@ -23,12 +24,13 @@ init:

.PHONY: update-deps
update-deps: mod-download
GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports
GO111MODULE=off go get -u github.com/golang/protobuf/protoc-gen-go
GO111MODULE=off go get -u github.com/envoyproxy/protoc-gen-validate
GO111MODULE=off go install github.com/envoyproxy/protoc-gen-validate
GO111MODULE=off go get -u github.com/golang/mock/gomock
GO111MODULE=off go install github.com/golang/mock/mockgen
mkdir -p $(DEPSGOBIN)
PATH=$(DEPSGOBIN):$$PATH go get -u golang.org/x/tools/cmd/goimports
PATH=$(DEPSGOBIN):$$PATH go get -u github.com/golang/protobuf/protoc-gen-go
PATH=$(DEPSGOBIN):$$PATH go get -u github.com/envoyproxy/protoc-gen-validate
PATH=$(DEPSGOBIN):$$PATH go install github.com/envoyproxy/protoc-gen-validate
PATH=$(DEPSGOBIN):$$PATH go get -u github.com/golang/mock/gomock
PATH=$(DEPSGOBIN):$$PATH go install github.com/golang/mock/mockgen


.PHONY: mod-download
Expand All @@ -44,7 +46,8 @@ generated-code: $(OUTPUT_DIR)/.generated-code

SUBDIRS:=pkg anyvendor
$(OUTPUT_DIR)/.generated-code:
mkdir -p ${OUTPUT_DIR}
$(GO_BUILD_FLAGS) go generate ./...
goimports -w $(SUBDIRS)
touch $@
PATH=$(DEPSGOBIN):$$PATH mkdir -p ${OUTPUT_DIR}
PATH=$(DEPSGOBIN):$$PATH $(GO_BUILD_FLAGS) go generate ./...
PATH=$(DEPSGOBIN):$$PATH goimports -w $(SUBDIRS)
PATH=$(DEPSGOBIN):$$PATH go mod tidy
PATH=$(DEPSGOBIN):$$PATH touch $@
4 changes: 2 additions & 2 deletions ci/check-code-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ PATH=/workspace/gopath/bin:$PATH

set +e

make generated-code -B
make update-deps generated-code -B
if [[ $? -ne 0 ]]; then
echo "Code generation failed"
exit 1;
fi
if [[ $(git status --porcelain | wc -l) -ne 0 ]]; then
echo "Generating code produced a non-empty diff."
echo "Try running 'dep ensure && make install-codegen-deps generated-code -B' then re-pushing."
echo "Try running 'make update-deps generated-code -B' then re-pushing."
git status --porcelain
git diff | cat
exit 1;
Expand Down
19 changes: 12 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ module github.com/solo-io/anyvendor
go 1.13

require (
github.com/envoyproxy/protoc-gen-validate v0.1.0
github.com/golang/mock v1.3.1
github.com/golang/protobuf v1.3.2
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 // indirect
github.com/lyft/protoc-gen-star v0.4.14 // indirect
github.com/envoyproxy/protoc-gen-validate v0.4.1
github.com/golang/mock v1.4.4
github.com/golang/protobuf v1.4.3
github.com/iancoleman/strcase v0.1.3 // indirect
github.com/lyft/protoc-gen-star v0.5.2 // indirect
github.com/mattn/go-zglob v0.0.3
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.8.1
github.com/rotisserie/eris v0.1.1
github.com/spf13/afero v1.2.2
github.com/stretchr/testify v1.6.1 // indirect
github.com/spf13/afero v1.5.1
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
golang.org/x/mod v0.4.1 // indirect
golang.org/x/net v0.0.0-20210119194325-5f4716e94777 // indirect
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
golang.org/x/text v0.3.5 // indirect
golang.org/x/tools v0.1.0 // indirect
)
Loading

0 comments on commit aa84714

Please sign in to comment.