You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 18 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. # Copyright 2023 OpenIMSDK. All rights reserved.
  2. # Use of this source code is governed by a MIT style
  3. # license that can be found in the LICENSE file.
  4. ###################################=> common commands <=#############################################
  5. # ========================== Capture Environment ===============================
  6. # get the repo root and output path
  7. ROOT_PACKAGE=github.com/OpenIMSDK/OpenKF
  8. OUT_DIR=$(REPO_ROOT)/_output
  9. # ==============================================================================
  10. # define the default goal
  11. #
  12. SHELL := /bin/bash
  13. DIRS=$(shell ls)
  14. GO=go
  15. .DEFAULT_GOAL := help
  16. # include the common makefile
  17. COMMON_SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
  18. # ROOT_DIR: root directory of the code base
  19. ifeq ($(origin ROOT_DIR),undefined)
  20. ROOT_DIR := $(abspath $(shell cd $(COMMON_SELF_DIR)/. && pwd -P))
  21. endif
  22. # OUTPUT_DIR: The directory where the build output is stored.
  23. ifeq ($(origin OUTPUT_DIR),undefined)
  24. OUTPUT_DIR := $(ROOT_DIR)/_output
  25. $(shell mkdir -p $(OUTPUT_DIR))
  26. endif
  27. # BIN_DIR: The directory where the build output is stored.
  28. ifeq ($(origin BIN_DIR),undefined)
  29. BIN_DIR := $(OUTPUT_DIR)/bin
  30. $(shell mkdir -p $(BIN_DIR))
  31. endif
  32. ifeq ($(origin TOOLS_DIR),undefined)
  33. TOOLS_DIR := $(OUTPUT_DIR)/tools
  34. $(shell mkdir -p $(TOOLS_DIR))
  35. endif
  36. ifeq ($(origin TMP_DIR),undefined)
  37. TMP_DIR := $(OUTPUT_DIR)/tmp
  38. $(shell mkdir -p $(TMP_DIR))
  39. endif
  40. ifeq ($(origin VERSION), undefined)
  41. VERSION := $(shell git describe --tags --always --match="v*" --dirty | sed 's/-/./g') #v2.3.3.631.g00abdc9b.dirty
  42. endif
  43. # Check if the tree is dirty. default to dirty(maybe u should commit?)
  44. GIT_TREE_STATE:="dirty"
  45. ifeq (, $(shell git status --porcelain 2>/dev/null))
  46. GIT_TREE_STATE="clean"
  47. endif
  48. GIT_COMMIT:=$(shell git rev-parse HEAD)
  49. IMG ?= ghcr.io/OpenIMSDK/OpenKF:latest
  50. BUILDFILE = "./main.go"
  51. BUILDAPP = "$(OUTPUT_DIR)/"
  52. # Define the directory you want to copyright
  53. CODE_DIRS := $(ROOT_DIR)/.github $(ROOT_DIR)/server $(ROOT_DIR)/scripts $(ROOT_DIR)/build $(ROOT_DIR)/web $(ROOT_DIR)/kf_plugins
  54. FINDS := find $(CODE_DIRS)
  55. ifndef V
  56. MAKEFLAGS += --no-print-directory
  57. endif
  58. # The OS must be linux when building docker images
  59. PLATFORMS ?= linux_amd64 linux_arm64
  60. # The OS can be linux/windows/darwin when building binaries
  61. # PLATFORMS ?= darwin_amd64 windows_amd64 linux_amd64 linux_arm64
  62. # Set a specific PLATFORM
  63. ifeq ($(origin PLATFORM), undefined)
  64. ifeq ($(origin GOOS), undefined)
  65. GOOS := $(shell go env GOOS)
  66. endif
  67. ifeq ($(origin GOARCH), undefined)
  68. GOARCH := $(shell go env GOARCH)
  69. endif
  70. PLATFORM := $(GOOS)_$(GOARCH)
  71. # Use linux as the default OS when building images
  72. IMAGE_PLAT := linux_$(GOARCH)
  73. else
  74. GOOS := $(word 1, $(subst _, ,$(PLATFORM)))
  75. GOARCH := $(word 2, $(subst _, ,$(PLATFORM)))
  76. IMAGE_PLAT := $(PLATFORM)
  77. endif
  78. # Copy githook scripts when execute makefile
  79. # TODO! GIT_FILE_SIZE_LIMIT=42000000 git commit -m "This commit is allowed file sizes up to 42MB"
  80. COPY_GITHOOK:=$(shell cp -f scripts/githooks/* .git/hooks/; chmod +x .git/hooks/*)
  81. # Linux command settings
  82. FIND := find . ! -path './image/*' ! -path './vendor/*' ! -path './bin/*'
  83. XARGS := xargs -r
  84. # ==============================================================================
  85. # TODO: License selection
  86. # LICENSE_TEMPLATE ?= $(ROOT_DIR)/scripts/LICENSE/license_templates.txt # MIT License
  87. LICENSE_TEMPLATE ?= $(ROOT_DIR)/scripts/LICENSE/LICENSE_TEMPLATES # Apache License
  88. # COMMA: Concatenate multiple strings to form a list of strings
  89. COMMA := ,
  90. # SPACE: Used to separate strings
  91. SPACE :=
  92. # SPACE: Replace multiple consecutive Spaces with a single space
  93. SPACE +=
  94. # ==============================================================================
  95. # Build definition
  96. GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20
  97. GO_LDFLAGS += -X $(VERSION_PACKAGE).GitVersion=$(VERSION) \
  98. -X $(VERSION_PACKAGE).GitCommit=$(GIT_COMMIT) \
  99. -X $(VERSION_PACKAGE).GitTreeState=$(GIT_TREE_STATE) \
  100. -X $(VERSION_PACKAGE).BuildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
  101. ifneq ($(DLV),)
  102. GO_BUILD_FLAGS += -gcflags "all=-N -l"
  103. LDFLAGS = ""
  104. endif
  105. GO_BUILD_FLAGS += -ldflags "$(GO_LDFLAGS)"
  106. # The use of make for Windows is not recommended
  107. ifeq ($(GOOS),windows)
  108. GO_OUT_EXT := .exe
  109. endif
  110. ifeq ($(ROOT_PACKAGE),)
  111. $(error the variable ROOT_PACKAGE must be set prior to including golang.mk)
  112. endif
  113. GOPATH := $(shell go env GOPATH)
  114. ifeq ($(origin GOBIN), undefined)
  115. GOBIN := $(GOPATH)/bin
  116. endif
  117. COMMANDS ?= $(filter-out %.md, $(wildcard ${ROOT_DIR}/server/cmd/*))
  118. BINS ?= $(foreach cmd,${COMMANDS},$(notdir ${cmd}))
  119. ifeq (${COMMANDS},)
  120. $(error Could not determine COMMANDS, set ROOT_DIR or run in source dir)
  121. endif
  122. ifeq (${BINS},)
  123. $(error Could not determine BINS, set ROOT_DIR or run in source dir)
  124. endif
  125. EXCLUDE_TESTS=github.com/OpenIMSDK/OpenKF/test
  126. # ==============================================================================
  127. # Build
  128. ## all: Build all the necessary targets.
  129. .PHONY: all
  130. all: copyright-verify tidy lint cover build
  131. ## build: Build binaries by default.
  132. .PHONY: build
  133. build: # go.build.verify $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS)))
  134. @echo "===========> Building binary $(BUILDAPP) *[Git Info]: $(VERSION)-$(GIT_COMMIT)"
  135. @cd $(SERVER_DIR) && CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o $(BIN_DIR)/platforms/openkf $(ROOT_DIR)/server/main.go
  136. .PHONY: build.%
  137. build.%:
  138. @echo "$(shell go version)"
  139. @echo "===========> Building binary $(BUILDAPP) *[Git Info]: $(VERSION)-$(GIT_COMMIT)"
  140. @export CGO_ENABLED=0 && GOOS=linux go build -o $(BUILDAPP)/$*/ -ldflags '-s -w' $*/example/$(BUILDFILE)
  141. .PHONY: go.build.verify
  142. go.build.verify:
  143. ifneq ($(shell $(GO) version | grep -q -E '\bgo($(GO_SUPPORTED_VERSIONS))\b' && echo 0 || echo 1), 0)
  144. $(error unsupported go version. Please make install one of the following supported version: '$(GO_SUPPORTED_VERSIONS)')
  145. endif
  146. ## go.build: Build the binary file of the specified platform.
  147. .PHONY: go.build.%
  148. go.build.%:
  149. $(eval COMMAND := $(word 2,$(subst ., ,$*)))
  150. $(eval PLATFORM := $(word 1,$(subst ., ,$*)))
  151. $(eval OS := $(word 1,$(subst _, ,$(PLATFORM))))
  152. $(eval ARCH := $(word 2,$(subst _, ,$(PLATFORM))))
  153. @echo "=====> COMMAND=$(COMMAND)"
  154. @echo "=====> PLATFORM=$(PLATFORM)"
  155. @echo "=====> BIN_DIR=$(BIN_DIR)"
  156. @echo "===========> Building binary $(COMMAND) $(VERSION) for $(OS)_$(ARCH)"
  157. @mkdir -p $(BIN_DIR)/platforms/$(OS)/$(ARCH)
  158. @CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o $(BIN_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_PACKAGE)/cmd/$(COMMAND)
  159. ## build-multiarch: Build binaries for multiple platforms.
  160. .PHONY: build-multiarch
  161. build-multiarch: go.build.verify $(foreach p,$(PLATFORMS),$(addprefix go.build., $(addprefix $(p)., $(BINS))))
  162. .PHONY: test.junit-report
  163. test.junit-report: tools.verify.go-junit-report
  164. @touch $(TMP_DIR)/coverage.out
  165. @echo "===========> Run unit test > $(TMP_DIR)/report.xml"
  166. # @$(GO) test -v -coverprofile=$(TMP_DIR)/coverage.out 2>&1 $(GO_BUILD_FLAGS) ./... | $(TOOLS_DIR)/go-junit-report -set-exit-code > $(TMP_DIR)/report.xml
  167. @$(GO) test -v -coverprofile=$(TMP_DIR)/coverage.out 2>&1 ./... | $(TOOLS_DIR)/go-junit-report -set-exit-code > $(TMP_DIR)/report.xml
  168. @sed -i '/mock_.*.go/d' $(TMP_DIR)/coverage.out
  169. @echo "===========> Test coverage of Go code is reported to $(TMP_DIR)/coverage.html by generating HTML"
  170. @$(GO) tool cover -html=$(TMP_DIR)/coverage.out -o $(TMP_DIR)/coverage.html
  171. # ==============================================================================
  172. # Targets
  173. SERVER_DIR := server
  174. ## tidy: tidy go.mod
  175. .PHONY: tidy
  176. tidy:
  177. @cd $(SERVER_DIR) && $(GO) mod tidy
  178. ## style: Code style -> fmt,vet,lint
  179. .PHONY: style
  180. style: fmt vet lint
  181. ## fmt: Run go fmt against code.
  182. .PHONY: fmt
  183. fmt:
  184. @cd $(SERVER_DIR) && $(GO) fmt ./...
  185. ## vet: Run go vet against code.
  186. .PHONY: vet
  187. vet:
  188. @cd $(SERVER_DIR) && $(GO) vet ./...
  189. ## generate: Run go generate against code and docs.
  190. .PHONY: generate
  191. generate:
  192. @cd $(SERVER_DIR) && $(GO) generate ./...
  193. ## lint: Run go lint against code.
  194. .PHONY: lint
  195. lint: tools.verify.golangci-lint
  196. @echo "===========> Run golangci to lint source codes"
  197. @cd $(SERVER_DIR) && $(TOOLS_DIR)/golangci-lint run -c $(ROOT_DIR)/.golangci.yml $(ROOT_DIR)/server/...
  198. ## format: Run unit test and format codes
  199. .PHONY: format
  200. format: tools.verify.golines tools.verify.goimports
  201. @echo "===========> Formating codes"
  202. @$(FIND) -type f -name '*.go' | $(XARGS) gofmt -s -w
  203. @$(FIND) -type f -name '*.go' | $(XARGS) $(TOOLS_DIR)/goimports -w -local $(ROOT_PACKAGE)
  204. @$(FIND) -type f -name '*.go' | $(XARGS) $(TOOLS_DIR)/golines -w --max-len=120 --reformat-tags --shorten-comments --ignore-generated .
  205. @cd $(SERVER_DIR) && $(GO) mod edit -fmt
  206. ## updates: Check for updates to go.mod dependencies
  207. .PHONY: updates
  208. updates: tools.verify.go-mod-outdated
  209. @cd $(SERVER_DIR) && $(GO) list -u -m -json all | $(TOOLS_DIR)/go-mod-outdated -update -direct
  210. ## test: Run unit test
  211. .PHONY: test
  212. test:
  213. @cd $(SERVER_DIR) && go test ./...
  214. ## cover: Run unit test with coverage.
  215. .PHONY: cover
  216. cover: test.junit-report
  217. @cd $(SERVER_DIR) && $(GO) tool cover -func=$(TMP_DIR)/coverage.out | \
  218. awk -v target=$(COVERAGE) -f $(ROOT_DIR)/scripts/coverage.awk
  219. ## docker-build: Build docker image with the manager.
  220. .PHONY: docker-build
  221. docker-build: test
  222. docker build -t ${IMG} .
  223. ## docker-push: Push docker image with the manager.
  224. .PHONY: docker-push
  225. docker-push:
  226. docker push ${IMG}
  227. ## docker-buildx-push: Push docker image with the manager using buildx.
  228. .PHONY: docker-buildx-push
  229. docker-buildx-push:
  230. docker buildx build --platform linux/arm64,linux/amd64 -t ${IMG} . --push
  231. ## copyright-verify: Validate boilerplate headers for assign files.
  232. .PHONY: copyright-verify
  233. copyright-verify: tools.verify.addlicense copyright-add
  234. @echo "===========> Validate boilerplate headers for assign files starting in the $(ROOT_DIR) directory"
  235. @$(TOOLS_DIR)/addlicense -v -check -ignore **/server/test/** -f $(LICENSE_TEMPLATE) $(CODE_DIRS)
  236. @echo "===========> End of boilerplate headers check..."
  237. ## copyright-add: Add the boilerplate headers for all files.
  238. .PHONY: copyright-add
  239. copyright-add: tools.verify.addlicense
  240. @echo "===========> Adding $(LICENSE_TEMPLATE) the boilerplate headers for all files"
  241. @$(TOOLS_DIR)/addlicense -y $(shell date +"%Y") -v -c "OpenKF & OpenIM open source community." -f $(LICENSE_TEMPLATE) $(CODE_DIRS)
  242. @echo "===========> End the copyright is added..."
  243. ## swagger: Generate swagger document.
  244. .PHONY: swagger
  245. swagger: tools.verify.swagger
  246. @echo "===========> Generating swagger API docs"
  247. @$(TOOLS_DIR)/swagger generate spec --scan-models -w $(ROOT_DIR)/cmd/gendocs -o $(ROOT_DIR)/server/docs/swagger.yaml
  248. ## serve-swagger: Serve swagger spec and docs.
  249. .PHONY: swagger.serve
  250. serve-swagger: tools.verify.swagger
  251. @$(TOOLS_DIR)/swagger serve -F=redoc --no-open --port 36666 $(ROOT_DIR)/server/docs/swagger.yaml
  252. ## release: release the project
  253. .PHONY: release
  254. release: release.verify release.ensure-tag
  255. @scripts/release.sh
  256. ## release.verify: Check if a tool is installed and install it
  257. .PHONY: release.verify
  258. release.verify: tools.verify.git-chglog tools.verify.github-release tools.verify.coscmd tools.verify.coscli
  259. ## release.tag: release the project
  260. .PHONY: release.tag
  261. release.tag: tools.verify.gsemver release.ensure-tag
  262. @git push origin `git describe --tags --abbrev=0`
  263. ## release.ensure-tag: ensure tag
  264. .PHONY: release.ensure-tag
  265. release.ensure-tag: tools.verify.gsemver
  266. @scripts/ensure_tag.sh
  267. ## clean: Clean all builds.
  268. .PHONY: clean
  269. clean:
  270. @echo "===========> Cleaning all builds TMP_DIR($(TMP_DIR)) AND BIN_DIR($(BIN_DIR))"
  271. @-rm -vrf $(TMP_DIR) $(BIN_DIR)
  272. @echo "===========> End clean..."
  273. ## help: Show this help info.
  274. .PHONY: help
  275. help: Makefile
  276. @printf "\n\033[1mUsage: make <TARGETS> ...\033[0m\n\n\\033[1mTargets:\\033[0m\n\n"
  277. @sed -n 's/^##//p' $< | awk -F':' '{printf "\033[36m%-28s\033[0m %s\n", $$1, $$2}' | sed -e 's/^/ /'
  278. ######################################=> common tools<= ############################################
  279. # tools
  280. BUILD_TOOLS ?= go-gitlint golangci-lint goimports addlicense deepcopy-gen conversion-gen ginkgo go-junit-report
  281. ## tools.verify.%: Check if a tool is installed and install it
  282. .PHONY: tools.verify.%
  283. tools.verify.%:
  284. @echo "===========> Verifying $* is installed"
  285. @if [ ! -f $(TOOLS_DIR)/$* ]; then GOBIN=$(TOOLS_DIR) $(MAKE) tools.install.$*; fi
  286. @echo "===========> $* is install in $(TOOLS_DIR)/$*"
  287. # tools: Install a must tools
  288. .PHONY: tools
  289. tools: $(addprefix tools.verify., $(BUILD_TOOLS))
  290. # tools.install.%: Install a single tool in $GOBIN/
  291. .PHONY: tools.install.%
  292. tools.install.%:
  293. @echo "===========> Installing $,The default installation path is $(GOBIN)/$*"
  294. @$(MAKE) install.$*
  295. .PHONY: install.golangci-lint
  296. install.golangci-lint:
  297. @$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
  298. .PHONY: install.goimports
  299. install.goimports:
  300. @$(GO) install golang.org/x/tools/cmd/goimports@latest
  301. .PHONY: install.addlicense
  302. install.addlicense:
  303. @$(GO) install github.com/google/addlicense@latest
  304. .PHONY: install.deepcopy-gen
  305. install.deepcopy-gen:
  306. @$(GO) install k8s.io/code-generator/cmd/deepcopy-gen@latest
  307. .PHONY: install.conversion-gen
  308. install.conversion-gen:
  309. @$(GO) install k8s.io/code-generator/cmd/conversion-gen@latest
  310. .PHONY: install.ginkgo
  311. install.ginkgo:
  312. @$(GO) install github.com/onsi/ginkgo/ginkgo@v1.16.2
  313. # git hook
  314. .PHONY: install.go-gitlint
  315. install.go-gitlint:
  316. @$(GO) install github.com/llorllale/go-gitlint@latest
  317. .PHONY: install.go-junit-report
  318. install.go-junit-report:
  319. @$(GO) install github.com/jstemmer/go-junit-report@latest
  320. ## install.gotests: Install gotests, used to generate go tests
  321. .PHONY: install.swagger
  322. install.swagger:
  323. @$(GO) install github.com/go-swagger/go-swagger/cmd/swagger@latest
  324. # ==============================================================================
  325. # Tools that might be used include go gvm, cos
  326. #
  327. ## install.kube-score: Install kube-score, used to check kubernetes yaml files
  328. .PHONY: install.kube-score
  329. install.kube-score:
  330. @$(GO) install github.com/zegl/kube-score/cmd/kube-score@latest
  331. ## install.kubeconform: Install kubeconform, used to check kubernetes yaml files
  332. .PHONY: install.kubeconform
  333. install.kubeconform:
  334. @$(GO) install github.com/yannh/kubeconform/cmd/kubeconform@latest
  335. ## install.gsemver: Install gsemver, used to generate semver
  336. .PHONY: install.gsemver
  337. install.gsemver:
  338. @$(GO) install github.com/arnaud-deprez/gsemver@latest
  339. ## install.git-chglog: Install git-chglog, used to generate changelog
  340. .PHONY: install.git-chglog
  341. install.git-chglog:
  342. @$(GO) install github.com/git-chglog/git-chglog/cmd/git-chglog@latest
  343. ## install.github-release: Install github-release, used to create github release
  344. .PHONY: install.github-release
  345. install.github-release:
  346. @$(GO) install github.com/github-release/github-release@latest
  347. ## install.coscli: Install coscli, used to upload files to cos
  348. # example: ./coscli cp/sync -r /root/workspaces/OpenIMSDK/OpenKF/ cos://OpenIMSDK-1306374445/code/ -e cos.ap-hongkong.myqcloud.com
  349. # https://cloud.tencent.com/document/product/436/71763
  350. # OpenIMSDK/*
  351. # - code/
  352. # - docs/
  353. # - images/
  354. # - scripts/
  355. .PHONY: install.coscli
  356. install.coscli:
  357. @wget -q https://github.com/tencentyun/coscli/releases/download/v0.13.0-beta/coscli-linux -O ${TOOLS_DIR}/coscli
  358. @chmod +x ${TOOLS_DIR}/coscli
  359. ## install.coscmd: Install coscmd, used to upload files to cos
  360. .PHONY: install.coscmd
  361. install.coscmd:
  362. @if which pip &>/dev/null; then pip install coscmd; else pip3 install coscmd; fi
  363. ## install.delve: Install delve, used to debug go program
  364. .PHONY: install.delve
  365. install.delve:
  366. @$(GO) install github.com/go-delve/delve/cmd/dlv@latest
  367. ## install.swag: Install swag, used to generate swagger
  368. # go1.17+
  369. # go-swagger is more powerful than swag
  370. # http://localhost:8080/swagger/index.html
  371. .PHONY: install.swag
  372. install.swag:
  373. @$(GO) install github.com/swaggo/swag/cmd/swag@latest
  374. ## install.go-swagger: Install go-swagger, used to generate swagger
  375. .PHONY: install.go-swagger
  376. install.go-swagger:
  377. @$(GO) install github.com/go-swagger/go-swagger/cmd/swagger@latest
  378. ## install.air: Install air, used to hot reload go program
  379. .PHONY: install.air
  380. install.air:
  381. @$(GO) install github.com/cosmtrek/air@latest
  382. ## install.gvm: Install gvm, gvm is a Go version manager, built on top of the official go tool.
  383. .PHONY: install.gvm
  384. install.gvm:
  385. @echo "===========> Installing gvm,The default installation path is ~/.gvm/script/gvm"
  386. @bash < <(curl -s -S -L https://raw.gitee.com/moovweb/gvm/master/binscripts/gvm-installer)
  387. @$(shell source /root/.gvm/script/gvm)
  388. ## install.golines: Install golines, used to format long lines
  389. .PHONY: install.golines
  390. install.golines:
  391. @$(GO) install github.com/segmentio/golines@latest
  392. ## install.go-mod-outdated: Install go-mod-outdated, used to check outdated dependencies
  393. .PHONY: install.go-mod-outdated
  394. install.go-mod-outdated:
  395. @$(GO) install github.com/psampaz/go-mod-outdated@latest
  396. ## install.mockgen: Install mockgen, used to generate mock functions
  397. .PHONY: install.mockgen
  398. install.mockgen:
  399. @$(GO) install github.com/golang/mock/mockgen@latest
  400. ## install.gotests: Install gotests, used to generate test functions
  401. .PHONY: install.gotests
  402. install.gotests:
  403. @$(GO) install github.com/cweill/gotests/gotests@latest
  404. ## install.protoc-gen-go: Install protoc-gen-go, used to generate go source files from protobuf files
  405. .PHONY: install.protoc-gen-go
  406. install.protoc-gen-go:
  407. @$(GO) install github.com/golang/protobuf/protoc-gen-go@latest
  408. ## install.cfssl: Install cfssl, used to generate certificates
  409. .PHONY: install.cfssl
  410. install.cfssl:
  411. @$(ROOT_DIR)/script/install/install.sh iam::install::install_cfssl
  412. ## install.depth: Install depth, used to check dependency tree
  413. .PHONY: install.depth
  414. install.depth:
  415. @$(GO) install github.com/KyleBanks/depth/cmd/depth@latest
  416. ## install.go-callvis: Install go-callvis, used to visualize call graph
  417. .PHONY: install.go-callvis
  418. install.go-callvis:
  419. @$(GO) install github.com/ofabry/go-callvis@latest
  420. ## install.gothanks: Install gothanks, used to thank go dependencies
  421. .PHONY: install.gothanks
  422. install.gothanks:
  423. @$(GO) install github.com/psampaz/gothanks@latest
  424. ## install.richgo: Install richgo
  425. .PHONY: install.richgo
  426. install.richgo:
  427. @$(GO) install github.com/kyoh86/richgo@latest
  428. ## install.rts: Install rts
  429. .PHONY: install.rts
  430. install.rts:
  431. @$(GO) install github.com/galeone/rts/cmd/rts@latest