2021-05-20 20:57:51 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
2023-05-30 12:48:19 +00:00
|
|
|
ANTLR_VERSION="4.13.0"
|
|
|
|
|
2021-05-20 20:57:51 +00:00
|
|
|
# Run tests
|
|
|
|
test:
|
|
|
|
@go test ./... -cover
|
|
|
|
|
|
|
|
# Pull go dependencies
|
|
|
|
dep:
|
|
|
|
@printf "⇒ Download requirements: "
|
|
|
|
@CGO_ENABLED=0 \
|
|
|
|
go mod download && echo OK
|
|
|
|
@printf "⇒ Tidy requirements: "
|
|
|
|
@CGO_ENABLED=0 \
|
|
|
|
go mod tidy -v && echo OK
|
|
|
|
|
|
|
|
# Run linters
|
|
|
|
lint:
|
|
|
|
@golangci-lint --timeout=5m run
|
|
|
|
|
|
|
|
# Run tests with race detection and produce coverage output
|
|
|
|
cover:
|
|
|
|
@go test -v -race ./... -coverprofile=coverage.txt -covermode=atomic
|
|
|
|
@go tool cover -html=coverage.txt -o coverage.html
|
|
|
|
|
|
|
|
# Reformat code
|
|
|
|
format:
|
|
|
|
@echo "⇒ Processing gofmt check"
|
|
|
|
@gofmt -s -w ./
|
|
|
|
@echo "⇒ Processing goimports check"
|
|
|
|
@goimports -w ./
|
|
|
|
|
2023-05-30 12:48:19 +00:00
|
|
|
policy:
|
|
|
|
@wget -q https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar -O antlr4-tool.jar
|
|
|
|
@java -Xmx500M -cp "`pwd`/antlr4-tool.jar" "org.antlr.v4.Tool" -o `pwd`/netmap/parser/ -Dlanguage=Go -no-listener -visitor `pwd`/netmap/parser/Query.g4 `pwd`/netmap/parser/QueryLexer.g4
|
|
|
|
|
|
|
|
# Run `make %` in truecloudlab/frostfs-sdk-go container(Golang+Java)
|
|
|
|
docker/%:
|
|
|
|
@docker build -t truecloudlab/frostfs-sdk-go --platform linux/amd64 . > /dev/null
|
|
|
|
@docker run --rm -t \
|
|
|
|
-v `pwd`:/work \
|
|
|
|
-u "$$(id -u):$$(id -g)" \
|
|
|
|
--env HOME=/work \
|
|
|
|
truecloudlab/frostfs-sdk-go make $*
|
|
|
|
|
2021-05-20 20:57:51 +00:00
|
|
|
# Show this help prompt
|
|
|
|
help:
|
|
|
|
@echo ' Usage:'
|
|
|
|
@echo ''
|
|
|
|
@echo ' make <target>'
|
|
|
|
@echo ''
|
|
|
|
@echo ' Targets:'
|
|
|
|
@echo ''
|
2023-03-03 09:29:33 +00:00
|
|
|
@awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort -u
|