Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R: Remove dep and vendor from doc and version. #4064

Merged
merged 11 commits into from
Apr 8, 2019
1 change: 1 addition & 0 deletions .pending/improvements/gaia/4064-Remove-dep-and-
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#4064 Remove `dep` and `vendor` from `doc` and `version`.
16 changes: 5 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags)"

ifneq ($(GOSUM),)
ldflags += -X github.com/cosmos/cosmos-sdk/version.VendorDirHash=$(shell $(GOSUM) go.sum)
yangyanqing marked this conversation as resolved.
Show resolved Hide resolved
endif

ifeq ($(WITH_CLEVELDB),yes)
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
endif
Expand Down Expand Up @@ -121,8 +117,6 @@ draw_deps: tools
clean:
rm -rf snapcraft-local.yaml build/

distclean: clean
rm -rf vendor/

########################################
### Documentation
Expand Down Expand Up @@ -203,13 +197,13 @@ lint: tools ci-lint
ci-lint:
golangci-lint run
go vet -composites=false -tests=false ./...
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
yangyanqing marked this conversation as resolved.
Show resolved Hide resolved
find . -name '*.go' -type f -not -path "*.git*" | xargs gofmt -d -s
go mod verify

format: tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s
yangyanqing marked this conversation as resolved.
Show resolved Hide resolved
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
yangyanqing marked this conversation as resolved.
Show resolved Hide resolved
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
yangyanqing marked this conversation as resolved.
Show resolved Hide resolved
find . -name '*.go' -type f -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk

benchmark:
@go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION)
Expand Down Expand Up @@ -264,7 +258,7 @@ snapcraft-local.yaml: snapcraft-local.yaml.in
# 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: install install_debug dist clean distclean \
.PHONY: install install_debug dist clean \
draw_deps test test_cli test_unit \
test_cover lint benchmark devdoc_init devdoc devdoc_save devdoc_update \
build-linux build-docker-gaiadnode localnet-start localnet-stop \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Once you have finallized your application, install it using `go get`. The follow
```bash
go get github.com/<your_username>/cosmos-sdk
cd $GOPATH/src/github.com/<your_username>/cosmos-sdk
make get_vendor_deps
make install
make install_examples
```
Expand Down
1 change: 0 additions & 1 deletion docs/gaia/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ $ gaiacli version --long
```
cosmos-sdk: 0.33.0
git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0
vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f
build tags: netgo ledger
go version go1.12 linux/amd64
```
Expand Down
1 change: 0 additions & 1 deletion docs/translations/cn/gaia/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ $ gaiacli version --long
```
cosmos-sdk: 0.33.0
git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0
vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f
build tags: netgo ledger
go version go1.12 linux/amd64
```
Expand Down
1 change: 0 additions & 1 deletion scripts/install/install_sdk_arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ cd $GOPATH/src/$REPO
# build & install master
git checkout $BRANCH
LEDGER_ENABLED=false make tools
LEDGER_ENABLED=false make get_vendor_deps
LEDGER_ENABLED=false make install

source ~/.profile
1 change: 0 additions & 1 deletion scripts/install/install_sdk_bsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ cd $GOPATH/src/$REPO
# build & install master
git checkout $BRANCH
gmake tools
gmake get_vendor_deps
gmake install
gmake install_examples
1 change: 0 additions & 1 deletion scripts/install/install_sdk_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ cd $GOPATH/src/$REPO
# build & install master
git checkout $BRANCH
LEDGER_ENABLED=false make tools
LEDGER_ENABLED=false make get_vendor_deps
LEDGER_ENABLED=false make install

source ~/.profile
20 changes: 8 additions & 12 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,29 @@ import (

// Variables set by build flags
var (
Commit = ""
Version = ""
VendorDirHash = ""
yangyanqing marked this conversation as resolved.
Show resolved Hide resolved
BuildTags = ""
Commit = ""
Version = ""
BuildTags = ""
)

type versionInfo struct {
CosmosSDK string `json:"cosmos_sdk"`
GitCommit string `json:"commit"`
VendorDirHash string `json:"vendor_hash"`
BuildTags string `json:"build_tags"`
GoVersion string `json:"go"`
CosmosSDK string `json:"cosmos_sdk"`
GitCommit string `json:"commit"`
BuildTags string `json:"build_tags"`
GoVersion string `json:"go"`
}

func (v versionInfo) String() string {
return fmt.Sprintf(`cosmos-sdk: %s
git commit: %s
vendor hash: %s
yangyanqing marked this conversation as resolved.
Show resolved Hide resolved
build tags: %s
%s`, v.CosmosSDK, v.GitCommit, v.VendorDirHash, v.BuildTags, v.GoVersion)
%s`, v.CosmosSDK, v.GitCommit, v.BuildTags, v.GoVersion)
}

func newVersionInfo() versionInfo {
return versionInfo{
Version,
Commit,
VendorDirHash,
yangyanqing marked this conversation as resolved.
Show resolved Hide resolved
BuildTags,
fmt.Sprintf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)}
}