github.com/itscaro/cli@v0.0.0-20190705081621-c9db0fe93829/Makefile (about) 1 # 2 # github.com/docker/cli 3 # 4 all: binary 5 6 7 _:=$(shell ./scripts/warn-outside-container $(MAKECMDGOALS)) 8 9 .PHONY: clean 10 clean: ## remove build artifacts 11 rm -rf ./build/* cli/winresources/rsrc_* ./man/man[1-9] docs/yaml/gen 12 13 .PHONY: test-unit 14 test-unit: ## run unit tests, to change the output format use: GOTESTSUM_FORMAT=(dots|short|standard-quiet|short-verbose|standard-verbose) make test-unit 15 gotestsum $(TESTFLAGS) -- $${TESTDIRS:-$(shell go list ./... | grep -vE '/vendor/|/e2e/')} 16 17 .PHONY: test 18 test: test-unit ## run tests 19 20 .PHONY: test-coverage 21 test-coverage: ## run test coverage 22 gotestsum -- -coverprofile=coverage.txt $(shell go list ./... | grep -vE '/vendor/|/e2e/') 23 24 .PHONY: fmt 25 fmt: 26 go list -f {{.Dir}} ./... | xargs gofmt -w -s -d 27 28 .PHONY: lint 29 lint: ## run all the lint tools 30 gometalinter --config gometalinter.json ./... 31 32 .PHONY: binary 33 binary: ## build executable for Linux 34 @echo "WARNING: binary creates a Linux executable. Use cross for macOS or Windows." 35 ./scripts/build/binary 36 37 .PHONY: plugins 38 plugins: ## build example CLI plugins 39 ./scripts/build/plugins 40 41 .PHONY: cross 42 cross: ## build executable for macOS and Windows 43 ./scripts/build/cross 44 45 .PHONY: binary-windows 46 binary-windows: ## build executable for Windows 47 ./scripts/build/windows 48 49 .PHONY: plugins-windows 50 plugins-windows: ## build example CLI plugins for Windows 51 ./scripts/build/plugins-windows 52 53 .PHONY: binary-osx 54 binary-osx: ## build executable for macOS 55 ./scripts/build/osx 56 57 .PHONY: plugins-osx 58 plugins-osx: ## build example CLI plugins for macOS 59 ./scripts/build/plugins-osx 60 61 .PHONY: dynbinary 62 dynbinary: ## build dynamically linked binary 63 ./scripts/build/dynbinary 64 65 vendor: vendor.conf ## check that vendor matches vendor.conf 66 rm -rf vendor 67 bash -c 'vndr |& grep -v -i clone' 68 scripts/validate/check-git-diff vendor 69 70 .PHONY: authors 71 authors: ## generate AUTHORS file from git history 72 scripts/docs/generate-authors.sh 73 74 .PHONY: manpages 75 manpages: ## generate man pages from go source and markdown 76 scripts/docs/generate-man.sh 77 78 .PHONY: yamldocs 79 yamldocs: ## generate documentation YAML files consumed by docs repo 80 scripts/docs/generate-yaml.sh 81 82 .PHONY: shellcheck 83 shellcheck: ## run shellcheck validation 84 scripts/validate/shellcheck 85 86 .PHONY: help 87 help: ## print this help 88 @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) 89 90 91 cli/compose/schema/bindata.go: cli/compose/schema/data/*.json 92 go generate github.com/docker/cli/cli/compose/schema 93 94 compose-jsonschema: cli/compose/schema/bindata.go 95 scripts/validate/check-git-diff cli/compose/schema/bindata.go 96 97 .PHONY: ci-validate 98 ci-validate: 99 time make -B vendor 100 time make -B compose-jsonschema 101 time make manpages 102 time make yamldocs