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`.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-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
ldflags += -X github.com/cosmos/cosmos-sdk/version.GoSumHash=$(shell $(GOSUM) go.sum)
endif

ifeq ($(WITH_CLEVELDB),yes)
Expand Down Expand Up @@ -121,8 +121,6 @@ draw_deps: tools
clean:
rm -rf snapcraft-local.yaml build/

distclean: clean
rm -rf vendor/

########################################
### Documentation
Expand Down Expand Up @@ -264,7 +262,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
2 changes: 1 addition & 1 deletion docs/gaia/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ $ gaiacli version --long
```
cosmos-sdk: 0.33.0
git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0
vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f
go.sum hash: d156153bd5e128fec3868eca9a1397a63a864edb5cfa0ac486db1b574b8eecfe
build tags: netgo ledger
go version go1.12 linux/amd64
```
Expand Down
4 changes: 2 additions & 2 deletions docs/translations/cn/gaia/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $ gaiacli version --long
```
cosmos-sdk: 0.33.0
git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0
vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f
go.sum hash: d156153bd5e128fec3868eca9a1397a63a864edb5cfa0ac486db1b574b8eecfe
build tags: netgo ledger
go version go1.12 linux/amd64
```
Expand All @@ -64,4 +64,4 @@ build tags指定了可执行程序具有的特殊特性。
| ledger | 支持Ledger设备(硬件钱包) |

### 接下来
然后你可以选择 加入公共测试网 或是 创建私有测试网。
然后你可以选择 加入公共测试网 或是 创建私有测试网。
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
24 changes: 12 additions & 12 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ import (

// Variables set by build flags
var (
Commit = ""
Version = ""
VendorDirHash = ""
yangyanqing marked this conversation as resolved.
Show resolved Hide resolved
BuildTags = ""
Commit = ""
Version = ""
GoSumHash = ""
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"`
GoSumHash string `json:"gosum_hash"`
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
go.sum hash: %s
build tags: %s
%s`, v.CosmosSDK, v.GitCommit, v.VendorDirHash, v.BuildTags, v.GoVersion)
%s`, v.CosmosSDK, v.GitCommit, v.GoSumHash, v.BuildTags, v.GoVersion)
}

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