1- CMDS =csi-proxy
2- all : build test
1+ all : test
32
43# include release tools for building binary and testing targets
54include release-tools/build.make
@@ -10,42 +9,6 @@ REPO_ROOT = $(CURDIR)
109BUILD_DIR = bin
1110BUILD_TOOLS_DIR = $(BUILD_DIR ) /tools
1211GO_ENV_VARS = GO111MODULE=on GOOS=windows
13- CSI_PROXY_API_GEN = $(BUILD_DIR ) /csi-proxy-api-gen
14-
15- .PHONY : compile-csi-proxy-api-gen
16- compile-csi-proxy-api-gen :
17- GO111MODULE=on go build -o $(CSI_PROXY_API_GEN ) ./cmd/csi-proxy-api-gen
18-
19- .PHONY : generate
20- generate : generate-protobuf generate-csi-proxy-api-gen
21-
22- # using xargs instead of -exec since the latter doesn't propagate exit statuses
23- .PHONY : generate-protobuf
24- generate-protobuf :
25- @ if ! which protoc > /dev/null 2>&1 ; then echo ' Unable to find protoc binary' ; exit 1; fi
26- @ generate_protobuf_for () { \
27- local FILE=" $$ 1" ; \
28- local FILE_DIR=" $$ (dirname " $(GOPATH ) /$$ FILE" )" ; \
29- echo "Generating protobuf file from $$FILE in $$FILE_DIR"; \
30- protoc -I "$(GOPATH ) /src/" -I '$(REPO_ROOT ) /client/api' "$$FILE" --go_out=plugins="grpc :$(GOPATH ) /src"; \
31- } ; \
32- export -f generate_protobuf_for; \
33- find '$(REPO_ROOT)' -not -path './vendor/*' -name '*.proto' | sed -e "s|$(GOPATH)/src/||g" | xargs -n1 '$(SHELL)' -c 'generate_protobuf_for "$$0"'
34-
35- .PHONY : generate-csi-proxy-api-gen
36- generate-csi-proxy-api-gen : compile-csi-proxy-api-gen
37- $(CSI_PROXY_API_GEN ) -i github.com/kubernetes-csi/csi-proxy/client/api,github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/api/dummy --v=8
38-
39- .PHONY : clean
40- clean : clean-protobuf clean-generated
41-
42- .PHONY : clean-protobuf
43- clean-protobuf :
44- find ' $(REPO_ROOT)' -name ' *.proto' -exec ' $(SHELL)' -c ' rm -vf "$$(dirname {})/$$(basename {} .proto).pb.go"' \;
45-
46- .PHONY : clean-generated
47- clean-generated :
48- find ' $(REPO_ROOT)' -name ' *_generated.go' -exec ' $(SHELL)' -c ' [[ "$$(head -n 1 "{}")" == "// Code generated by csi-proxy-api-gen"* ]] && rm -v {}' \;
4912
5013# see https://github.com/golangci/golangci-lint/releases
5114GOLANGCI_LINT_VERSION = v1.21.0
@@ -60,17 +23,14 @@ lint: $(GOLANGCI_LINT)
6023test : test-go
6124test-go :
6225 @ echo ; echo " ### $@ :"
63- # TODO: After issue https://github.com/microsoft/go-winio/pull/169 is resolved, remove the filter on the test path.
64- GO111MODULE=on go test ` find ./internal/server/ -type d -not -name server` ; \
65- cd client && GO111MODULE=on go test `go list ./... | grep -v group` && cd ../
26+ GO111MODULE=on go test ./pkg/...
6627
6728.PHONY : test-vet
6829test : test-vet
6930test-vet :
7031 @ echo ; echo " ### $@ :"
71- # TODO: After issue https://github.com/microsoft/go-winio/pull/169 is resolved, remove the filter on the test path.
72- # GO111MODULE=on go vet `find ./internal/server/ -type d -not -name server`;\
73- cd client && GO111MODULE=on go vet `go list ./... | grep -v group` && cd ../
32+ GO111MODULE=on go vet ./pkg/...
33+
7434# see https://github.com/golangci/golangci-lint#binary-release
7535$(GOLANGCI_LINT ) :
7636curl -sfL https ://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$$(dirname '$(GOLANGCI_LINT ) ' ) " '$(GOLANGCI_LINT_VERSION ) '
0 commit comments