-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
28 lines (24 loc) · 1.65 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
GOFLAGS ?= -mod=vendor
PROTO_PACKAGES_GO := serialize state
PROTO_PACKAGES_GW := gateway
PROTO_PACKAGES_CC_WITHSERVICE_PREFIX := extensions
PROTO_PACKAGES_CC := examples
test:
@echo "go test -mod vendor ./..."
@go test ./...
refresh-deps:
@echo "go mod tidy"
@GOFLAGS='' GONOSUMDB=github.com/hyperledger/fabric go mod tidy
@echo "go mod vendor"
@GOFLAGS='' GONOSUMDB=github.com/hyperledger/fabric go mod vendor
proto: clean
@for pkg in $(PROTO_PACKAGES_CC) ;do echo $$pkg && buf generate --template buf.gen.cc.yaml $$pkg -o ./$$(echo $$pkg | cut -d "/" -f1); done
@for pkg in $(PROTO_PACKAGES_CC_WITHSERVICE_PREFIX) ;do echo $$pkg && buf generate --template buf.gen.cc-with-service-prefix.yaml $$pkg -o ./$$(echo $$pkg | cut -d "/" -f1); done
@for pkg in $(PROTO_PACKAGES_GW) ;do echo $$pkg && buf generate --template buf.gen.gw.yaml $$pkg -o ./$$(echo $$pkg | cut -d "/" -f1); done
@for pkg in $(PROTO_PACKAGES_GO) ;do echo $$pkg && buf generate --template buf.gen.go.yaml $$pkg -o ./$$(echo $$pkg | cut -d "/" -f1); done
@go fmt ./...
clean:
@for pkg in $(PROTO_PACKAGES_CC); do find $$pkg \( -name '*.pb.go' -or -name '*.pb.cc.go' -or -name '*.pb.gw.go' -or -name '*.swagger.json' -or -name '*.pb.md' \) -delete;done
@for pkg in $(PROTO_PACKAGES_CC_WITHSERVICE_PREFIX); do find $$pkg \( -name '*.pb.go' -or -name '*.pb.cc.go' -or -name '*.pb.gw.go' -or -name '*.swagger.json' -or -name '*.pb.md' \) -delete;done
@for pkg in $(PROTO_PACKAGES_GW); do find $$pkg \( -name '*.pb.go' -or -name '*.pb.gw.go' -or -name '*.swagger.json' -or -name '*.pb.md' \) -delete;done
@for pkg in $(PROTO_PACKAGES_GO); do find $$pkg \( -name '*.pb.go' -or -name '*.pb.md' \) -delete;done