-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): Add go-mod-outdated for tools/ to make
- Loading branch information
Jonathan Thurman
committed
Jan 6, 2021
1 parent
c4d608f
commit cf875db
Showing
6 changed files
with
41 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# Makefile fragment for installing tools | ||
# | ||
|
||
GO ?= go | ||
GOFMT ?= gofmt | ||
VENDOR_CMD ?= ${GO} mod tidy | ||
GO_MOD_OUTDATED ?= go-mod-outdated | ||
BUILD_DIR ?= ./bin/ | ||
|
||
# Go file to track tool deps with go modules | ||
TOOL_DIR ?= tools | ||
TOOL_CONFIG ?= $(TOOL_DIR)/tools.go | ||
|
||
GOTOOLS ?= $(shell cd $(TOOL_DIR) && go list -f '{{ .Imports }}' -tags tools |tr -d '[]') | ||
|
||
tools: check-version | ||
@echo "=== $(PROJECT_NAME) === [ tools ]: Installing tools required by the project..." | ||
@cd $(TOOL_DIR) && $(GO) install $(GOTOOLS) | ||
@cd $(TOOL_DIR) && $(VENDOR_CMD) | ||
|
||
tools-outdated: check-version | ||
@echo "=== $(PROJECT_NAME) === [ tools-outdated ]: Finding outdated tool deps with $(GO_MOD_OUTDATED)..." | ||
@cd $(TOOL_DIR) && $(GO) list -u -m -json all | $(GO_MOD_OUTDATED) -direct -update | ||
|
||
tools-update: check-version | ||
@echo "=== $(PROJECT_NAME) === [ tools-update ]: Updating tools required by the project..." | ||
@cd $(TOOL_DIR) && for x in $(GOTOOLS); do \ | ||
$(GO) get -u $$x; \ | ||
done | ||
@cd $(TOOL_DIR) && $(VENDOR_CMD) | ||
|
||
.PHONY: tools tools-update tools-outdated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters