version --long displays replaced build dependencies (#7941)

* version --long displays replaced modules

* Update CHANGELOG

* Update CHANGELOG

* Update version/version.go

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
This commit is contained in:
Paul Kim 2020-11-16 19:00:34 +09:00 committed by GitHub
parent cd29fd642a
commit b5e873cd91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -40,7 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
- (SDK) [\#7925](https://github.com/cosmos/cosmos-sdk/pull/7925) Updated dependencies to use gRPC v1.33.2
* Updated gRPC dependency to v1.33.2
* Updated iavl dependency to v0.15-rc2
* (version) [\#7848](https://github.com/cosmos/cosmos-sdk/pull/7848) [\#7941](https://github.com/cosmos/cosmos-sdk/pull/7941) `version --long` output now shows the list of build dependencies and replaced build dependencies.
## [v0.40.0-rc3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.0-rc3) - 2020-11-06

View File

@ -85,6 +85,13 @@ type buildDep struct {
*debug.Module
}
func (d buildDep) String() string { return fmt.Sprintf("%s@%s", d.Path, d.Version) }
func (d buildDep) String() string {
if d.Replace != nil {
return fmt.Sprintf("%s@%s => %s@%s", d.Path, d.Version, d.Replace.Path, d.Replace.Version)
}
return fmt.Sprintf("%s@%s", d.Path, d.Version)
}
func (d buildDep) MarshalJSON() ([]byte, error) { return json.Marshal(d.String()) }
func (d buildDep) MarshalYAML() (interface{}, error) { return d.String(), nil }