Including changes to Makefile to build cosmos-sdk-cli and also ignoring linting for cosmos-sdk-cli

This commit is contained in:
Sridhar Ganesan 2018-07-16 20:45:56 +02:00
parent 26aa871957
commit b952331b22
5 changed files with 47 additions and 11 deletions

10
Gopkg.lock generated
View File

@ -2,7 +2,6 @@
[[projects]]
branch = "master"
name = "github.com/bartekn/go-bip39"
packages = ["."]
revision = "a05967ea095d81c8fe4833776774cfaff8e5036c"
@ -79,6 +78,12 @@
revision = "259ab82a6cad3992b4e21ff5cac294ccb06474bc"
version = "v1.7.0"
[[projects]]
name = "github.com/gobuffalo/packr"
packages = ["."]
revision = "bd47f2894846e32edcf9aa37290fef76c327883f"
version = "v1.11.1"
[[projects]]
name = "github.com/gogo/protobuf"
packages = [
@ -135,7 +140,6 @@
".",
"hcl/ast",
"hcl/parser",
"hcl/printer",
"hcl/scanner",
"hcl/strconv",
"hcl/token",
@ -503,6 +507,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "94abff3ff321fd150a6e4b95d109297296cdc00693c648c9b2a48171b90e36b0"
inputs-digest = "2a655310c28a7f80cb2cfe5f2969182896aac09293344472de10e9135ddc364c"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -67,6 +67,10 @@
name = "github.com/zondax/ledger-goclient"
revision = "39ba4728c137c75718a21f9b4b3280fa31b9139b"
[[constraint]]
name = "github.com/gobuffalo/packr"
version = "1.11.1"
[prune]
go-tests = true
unused-packages = true

View File

@ -1,5 +1,5 @@
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
PACKAGES_NOCLITEST=$(shell go list ./... | grep -v '/vendor/' | grep -v github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test)
PACKAGES=$(shell go list ./... | grep -v '/vendor/' | grep -v '/cosmos-sdk-cli/template')
PACKAGES_NOCLITEST=$(shell go list ./... | grep -v '/vendor/' | grep -v '/cosmos-sdk-cli/template' | grep -v github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test)
COMMIT_HASH := $(shell git rev-parse --short HEAD)
BUILD_TAGS = netgo ledger
BUILD_FLAGS = -tags "${BUILD_TAGS}" -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=${COMMIT_HASH}"
@ -37,6 +37,15 @@ endif
build-linux:
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build
build_cosmos-sdk-cli:
ifeq ($(OS),Windows_NT)
packr build $(BUILD_FLAGS) -o build/cosmos-sdk-cli.exe ./cmd/cosmos-sdk-cli
packr clean
else
packr build $(BUILD_FLAGS) -o build/cosmos-sdk-cli ./cmd/cosmos-sdk-cli
packr clean
endif
build_examples:
ifeq ($(OS),Windows_NT)
go build $(BUILD_FLAGS) -o build/basecoind.exe ./examples/basecoin/cmd/basecoind
@ -60,6 +69,9 @@ install_examples:
go install $(BUILD_FLAGS) ./examples/democoin/cmd/democoind
go install $(BUILD_FLAGS) ./examples/democoin/cmd/democli
install_cosmos-sdk-cli:
go install $(BUILD_FLAGS) ./cmd/cosmos-sdk-cli
install_debug:
go install $(BUILD_FLAGS) ./cmd/gaia/cmd/gaiadebug
@ -82,7 +94,7 @@ get_tools:
get_vendor_deps:
@rm -rf vendor/
@echo "--> Running dep ensure"
@dep ensure -v
@dep ensure -v --vendor-only
draw_deps:
@# requires brew install graphviz or apt-get install graphviz
@ -116,9 +128,9 @@ test_cover:
@bash tests/test_cover.sh
test_lint:
gometalinter.v2 --config=tools/gometalinter.json ./...
!(gometalinter.v2 --disable-all --enable='errcheck' --vendor ./... | grep -v "client/")
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
gometalinter.v2 --config=tools/gometalinter.json ./... --exclude cmd/cosmos-sdk-cli
!(gometalinter.v2 --disable-all --enable='errcheck' --vendor ./... | grep -v "client/" | grep -v "cosmos-sdk-cli/template/")
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./cmd/cosmos-sdk-cli/*" -not -path "*.git*" | xargs gofmt -d -s
dep status >> /dev/null
!(grep -n branch Gopkg.toml)
@ -193,7 +205,7 @@ remotenet-status:
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: build build_examples install install_examples install_debug dist \
.PHONY: build build_cosmos-sdk-cli build_examples install install_examples install_cosmos-sdk-cli install_debug dist \
check_tools get_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 remotenet-start \

View File

@ -8,13 +8,14 @@ import (
)
var rootCmd = &cobra.Command{
Use: "cosmos-zone",
Use: "cosmos-sdk-cli",
Short: "Tools to develop on cosmos-sdk",
Run: func(cmd *cobra.Command, args []string) {
// Do Stuff Here
},
}
// Execute the command
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)

View File

@ -13,6 +13,7 @@ MISSPELL = github.com/client9/misspell/cmd/misspell
ERRCHECK = github.com/kisielk/errcheck
UNPARAM = mvdan.cc/unparam
GOCYCLO = github.com/alecthomas/gocyclo
PACKR = github.com/gobuffalo/packr
DEP_CHECK := $(shell command -v dep 2> /dev/null)
GOLINT_CHECK := $(shell command -v golint 2> /dev/null)
@ -23,6 +24,7 @@ MISSPELL_CHECK := $(shell command -v misspell 2> /dev/null)
ERRCHECK_CHECK := $(shell command -v errcheck 2> /dev/null)
UNPARAM_CHECK := $(shell command -v unparam 2> /dev/null)
GOCYCLO_CHECK := $(shell command -v gocyclo 2> /dev/null)
PACKR_CHECK := $(shell command -v packr 2> /dev/null)
check_tools:
ifndef DEP_CHECK
@ -70,6 +72,11 @@ ifndef GOCYCLO_CHECK
else
@echo "Found gocyclo in path."
endif
ifndef PACKR_CHECK
@echo "No packr in path. Install with make get_tools'."
else
@echo "Found packr in path."
endif
get_tools:
ifdef DEP_CHECK
@ -126,6 +133,12 @@ else
@echo "Installing goyclo"
go get -v $(GOCYCLO)
endif
ifdef PACKR_CHECK
@echo "Packr is already installed. Run 'make update_tools' to update."
else
@echo "$(ansi_grn)Installing packr$(ansi_end)"
go get -v $(PACKR)
endif
update_tools:
@echo "Updating dep"
@ -146,6 +159,8 @@ update_tools:
go get -u -v $(UNPARAM)
@echo "Updating goyclo"
go get -u -v $(GOCYCLO)
@echo "Updating packr"
go get -u -v $(PACKR)
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.