From 0c0bff7ea04452dde378f5cf868ed51b566bbf4e Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Thu, 20 Dec 2018 18:03:59 +0000 Subject: [PATCH] Fix Makefile's all target (#3085) - Rename get_dev_tools to devtools - tools and devtools now create a stamp after execution so that they are not executed twice on the same pipeline - Add clean target to remove stamps --- .circleci/config.yml | 7 +++---- Dockerfile | 2 +- Makefile | 22 +++++++++++++--------- Vagrantfile | 2 +- docs/DOCS_README.md | 14 ++++++++++++++ docs/examples/README.md | 2 +- docs/gaia/installation.md | 2 +- scripts/Makefile | 9 ++++----- scripts/install/install_sdk_arm.sh | 2 +- scripts/install/install_sdk_bsd.sh | 2 +- scripts/install/install_sdk_ubuntu.sh | 2 +- 11 files changed, 41 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa3b7d8b3..0fa045de5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ jobs: name: tools command: | export PATH="$GOBIN:$PATH" - make get_tools + make tools - run: name: dependencies command: | @@ -91,8 +91,7 @@ jobs: name: Get metalinter command: | export PATH="$GOBIN:$PATH" - make get_tools - make get_dev_tools + make devtools - run: name: Lint source command: | @@ -286,7 +285,7 @@ jobs: sudo mv go /usr/local popd set -x - make get_tools + make tools make get_vendor_deps make build-linux make localnet-start diff --git a/Dockerfile b/Dockerfile index 5dfd625de..b3a5ea732 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ COPY . . # Install minimum necessary dependencies, build Cosmos SDK, remove packages RUN apk add --no-cache $PACKAGES && \ - make get_tools && \ + make tools && \ make get_vendor_deps && \ make build && \ make install diff --git a/Makefile b/Makefile index af07d7d07..dbc31842c 100644 --- a/Makefile +++ b/Makefile @@ -9,15 +9,15 @@ GOTOOLS = \ github.com/alecthomas/gometalinter \ github.com/rakyll/statik GOBIN ?= $(GOPATH)/bin -all: get_tools get_vendor_deps install install_examples install_cosmos-sdk-cli test_lint test +all: devtools get_vendor_deps install install_examples install_cosmos-sdk-cli test_lint test -# The below include contains the get_tools target. +# The below include contains the tools target. include scripts/Makefile ######################################## ### CI -ci: get_tools get_vendor_deps install test_cover test_lint test +ci: devtools get_vendor_deps install test_cover test_lint test ######################################## ### Build/Install @@ -117,33 +117,37 @@ check_tools: update_tools: @echo "--> Updating tools to correct version" - $(MAKE) --always-make get_tools + $(MAKE) --always-make 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_dev_tools: get_tools +devtools: devtools-stamp +devtools-stamp: tools @echo "--> Downloading linters (this may take awhile)" $(GOPATH)/src/github.com/alecthomas/gometalinter/scripts/install.sh -b $(GOBIN) go get github.com/tendermint/lint/golint + touch $@ -get_vendor_deps: get_tools +get_vendor_deps: tools @echo "--> Generating vendor directory via dep ensure" @rm -rf .vendor-new @dep ensure -v -vendor-only -update_vendor_deps: get_tools +update_vendor_deps: tools @echo "--> Running dep ensure" @rm -rf .vendor-new @dep ensure -v -draw_deps: get_tools +draw_deps: tools @# requires brew install graphviz or apt-get install graphviz go get github.com/RobotsAndPencils/goviz @goviz -i github.com/cosmos/cosmos-sdk/cmd/gaia/cmd/gaiad -d 2 | dot -Tpng -o dependency-graph.png +clean: + rm -f devtools-stamp ######################################## ### Documentation @@ -264,7 +268,7 @@ localnet-stop: # unless there is a reason not to. # https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html .PHONY: build build_cosmos-sdk-cli build_examples install install_examples install_cosmos-sdk-cli install_debug dist \ -check_tools check_dev_tools get_dev_tools get_vendor_deps draw_deps test test_cli test_unit \ +check_tools check_dev_tools get_vendor_deps draw_deps test test_cli test_unit \ test_cover test_lint benchmark devdoc_init devdoc devdoc_save devdoc_update \ build-linux build-docker-gaiadnode localnet-start localnet-stop \ format check-ledger test_sim_gaia_nondeterminism test_sim_modules test_sim_gaia_fast \ diff --git a/Vagrantfile b/Vagrantfile index 84681e2b7..6dc32dc97 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -46,6 +46,6 @@ Vagrant.configure("2") do |config| chown vagrant:vagrant /home/vagrant/.bash_profile su - vagrant -c 'source /home/vagrant/.bash_profile' - su - vagrant -c 'cd /home/vagrant/go/src/github.com/cosmos/cosmos-sdk && make get_tools' + su - vagrant -c 'cd /home/vagrant/go/src/github.com/cosmos/cosmos-sdk && make tools' SHELL end diff --git a/docs/DOCS_README.md b/docs/DOCS_README.md index c21bdacc5..602947697 100644 --- a/docs/DOCS_README.md +++ b/docs/DOCS_README.md @@ -110,3 +110,17 @@ We are using [Algolia](https://www.algolia.com) to power full-text search. This Because the build processes are identical (as is the information contained herein), this file should be kept in sync as much as possible with its [counterpart in the Tendermint Core repo](https://github.com/tendermint/tendermint/blob/develop/docs/DOCS_README.md). +### Update and Build the RPC docs + +1. Execute the following command at the root directory to install the swagger-ui generate tool. + ``` + make tools + ``` +2. Edit API docs + 1. Directly Edit API docs manually: `client/lcd/swagger-ui/swagger.yaml`. + 2. Edit API docs within [SwaggerHub](https://app.swaggerhub.com). Please refer to this [document](https://app.swaggerhub.com/help/index) for how to use the about website to edit API docs. +3. Download `swagger.yaml` and replace the old `swagger.yaml` under fold `client/lcd/swagger-ui`. +4. Compile gaiacli + ``` + make install + ``` diff --git a/docs/examples/README.md b/docs/examples/README.md index 5d872a7c9..26be66aab 100644 --- a/docs/examples/README.md +++ b/docs/examples/README.md @@ -23,7 +23,7 @@ cd $GOPATH/src/github.com/cosmos/cosmos-sdk And run : ``` -make get_tools // run make update_tools if you already had it installed +make tools // run make update_tools if you already had it installed make get_vendor_deps make install_examples ``` diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index e8809b6b6..39634bb40 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -28,7 +28,7 @@ mkdir -p $GOPATH/src/github.com/cosmos cd $GOPATH/src/github.com/cosmos git clone https://github.com/cosmos/cosmos-sdk cd cosmos-sdk && git checkout master -make get_tools && make get_vendor_deps && make install +make tools && make get_vendor_deps && make install ``` > *NOTE*: If you have issues at this step, please check that you have the latest stable version of GO installed. diff --git a/scripts/Makefile b/scripts/Makefile index 90cb84231..910c6f68d 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -34,10 +34,10 @@ cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && git fetch origin && git checkout -q $(3) go_install = $(call go_get,$(1),$(2),$(3)) && cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && $(GO) install ### -# get_tools +# tools ### -all: get_tools -get_tools: $(GOPATH)/bin/dep $(GOPATH)/bin/gometalinter $(GOPATH)/bin/statik $(GOPATH)/bin/goimports +all: tools +tools: $(GOPATH)/bin/dep $(GOPATH)/bin/gometalinter $(GOPATH)/bin/statik $(GOPATH)/bin/goimports $(GOPATH)/bin/dep: $(call go_get,golang,dep,22125cfaa6ddc71e145b1535d4b7ee9744fefff2) @@ -53,5 +53,4 @@ $(GOPATH)/bin/statik: $(GOPATH)/bin/goimports: go get golang.org/x/tools/cmd/goimports -.PHONY: all get_tools - +.PHONY: all diff --git a/scripts/install/install_sdk_arm.sh b/scripts/install/install_sdk_arm.sh index 39bbd16e4..951e2830c 100644 --- a/scripts/install/install_sdk_arm.sh +++ b/scripts/install/install_sdk_arm.sh @@ -31,7 +31,7 @@ cd $GOPATH/src/$REPO # build & install master git checkout $BRANCH -LEDGER_ENABLED=false make get_tools +LEDGER_ENABLED=false make tools LEDGER_ENABLED=false make get_vendor_deps LEDGER_ENABLED=false make install diff --git a/scripts/install/install_sdk_bsd.sh b/scripts/install/install_sdk_bsd.sh index c9d4d3195..fda0eb1e1 100644 --- a/scripts/install/install_sdk_bsd.sh +++ b/scripts/install/install_sdk_bsd.sh @@ -47,7 +47,7 @@ cd $GOPATH/src/$REPO # build & install master git checkout $BRANCH -gmake get_tools +gmake tools gmake get_vendor_deps gmake install gmake install_examples diff --git a/scripts/install/install_sdk_ubuntu.sh b/scripts/install/install_sdk_ubuntu.sh index 1bf72ef3c..3ac23ccae 100644 --- a/scripts/install/install_sdk_ubuntu.sh +++ b/scripts/install/install_sdk_ubuntu.sh @@ -34,7 +34,7 @@ cd $GOPATH/src/$REPO # build & install master git checkout $BRANCH -LEDGER_ENABLED=false make get_tools +LEDGER_ENABLED=false make tools LEDGER_ENABLED=false make get_vendor_deps LEDGER_ENABLED=false make install