1
- CMDS =csi-proxy
2
- all : build test
1
+ all : test
3
2
4
3
# include release tools for building binary and testing targets
5
4
include release-tools/build.make
@@ -10,42 +9,6 @@ REPO_ROOT = $(CURDIR)
10
9
BUILD_DIR = bin
11
10
BUILD_TOOLS_DIR = $(BUILD_DIR ) /tools
12
11
GO_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 {}' \;
49
12
50
13
# see https://github.com/golangci/golangci-lint/releases
51
14
GOLANGCI_LINT_VERSION = v1.21.0
@@ -60,17 +23,14 @@ lint: $(GOLANGCI_LINT)
60
23
test : test-go
61
24
test-go :
62
25
@ 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/...
66
27
67
28
.PHONY : test-vet
68
29
test : test-vet
69
30
test-vet :
70
31
@ 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
+
74
34
# see https://github.com/golangci/golangci-lint#binary-release
75
35
$(GOLANGCI_LINT ) :
76
36
curl -sfL https ://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$$(dirname '$(GOLANGCI_LINT ) ' ) " '$(GOLANGCI_LINT_VERSION ) '
0 commit comments