diff --git a/Makefile b/Makefile index 35e5b50eff1f..f4475d1d9ef1 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ GOTOOLS = \ GOBIN ?= $(GOPATH)/bin all: get_tools get_vendor_deps install install_examples install_cosmos-sdk-cli test_lint test +# The below include contains the get_tools target. +include scripts/Makefile + ######################################## ### CI @@ -107,20 +110,13 @@ check_tools: update_tools: @echo "--> Updating tools to correct version" - $(MAKE) -C scripts get_tools + $(MAKE) --always-make get_tools update_dev_tools: @echo "--> Downloading linters (this may take awhile)" $(GOPATH)/src/github.com/alecthomas/gometalinter/scripts/install.sh -b $(GOBIN) go get -u github.com/tendermint/lint/golint -get_tools: $(GOBIN)/dep $(GOBIN)/gometalinter $(GOBIN)/statik - @echo "--> Installing tools" - $(MAKE) -C scripts get_tools - -$(GOBIN)/%: - $(MAKE) -C scripts $(subst $(GOBIN)/,,$(@)) - get_dev_tools: get_tools @echo "--> Downloading linters (this may take awhile)" $(GOPATH)/src/github.com/alecthomas/gometalinter/scripts/install.sh -b $(GOBIN) @@ -212,6 +208,7 @@ test_lint: format: find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk benchmark: @go test -bench=. $(PACKAGES_NOSIMULATION) diff --git a/PENDING.md b/PENDING.md index 47c6ab60e5ff..b9b98ce0fbd8 100644 --- a/PENDING.md +++ b/PENDING.md @@ -60,6 +60,7 @@ IMPROVEMENTS - #2772 Update BaseApp to not persist state when the ante handler fails on DeliverTx. - #2773 Require moniker to be provided on `gaiad init`. - #2672 [Makefile] Updated for better Windows compatibility and ledger support logic, get_tools was rewritten as a cross-compatible Makefile. + - #2766 [Makefile] Added goimports tool to get_tools. Get_tools now only builds new versions if binaries are missing. - [#110](https://github.com/tendermint/devops/issues/110) Updated CircleCI job to trigger website build when cosmos docs are updated. * SDK diff --git a/scripts/Makefile b/scripts/Makefile index 9abc497e45d4..90cb84231106 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -37,18 +37,21 @@ go_install = $(call go_get,$(1),$(2),$(3)) && cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) # get_tools ### all: get_tools -get_tools: dep gometalinter statik +get_tools: $(GOPATH)/bin/dep $(GOPATH)/bin/gometalinter $(GOPATH)/bin/statik $(GOPATH)/bin/goimports -dep: +$(GOPATH)/bin/dep: $(call go_get,golang,dep,22125cfaa6ddc71e145b1535d4b7ee9744fefff2) cd $(GITHUBDIR)$(FS)golang$(FS)dep$(FS)cmd$(FS)dep && $(GO) install #v2.0.11 -gometalinter: +$(GOPATH)/bin/gometalinter: $(call go_install,alecthomas,gometalinter,17a7ffa42374937bfecabfb8d2efbd4db0c26741) -statik: +$(GOPATH)/bin/statik: $(call go_install,rakyll,statik,v0.1.5) -.PHONY: all get_tools dep gometalinter statik +$(GOPATH)/bin/goimports: + go get golang.org/x/tools/cmd/goimports + +.PHONY: all get_tools