forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
438 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*.swp | ||
*.swo | ||
vendor | ||
build | ||
|
||
### Vagrant ### | ||
.vagrant/ | ||
*.box | ||
*.log | ||
vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
PACKAGES=$(shell go list ./... | grep -v '/vendor/' | grep -v '_attic') | ||
BUILD_FLAGS = -ldflags "-X github.com/cosmos/cosmos-sdk/examples/basecoin/version.GitCommit=`git rev-parse --short HEAD`" | ||
|
||
all: check_tools get_vendor_deps build test | ||
|
||
######################################## | ||
### Build | ||
|
||
build: | ||
go build $(BUILD_FLAGS) -o build/basecoin ./cmd/... | ||
|
||
|
||
######################################## | ||
### Tools & dependencies | ||
|
||
check_tools: | ||
cd tools && $(MAKE) check | ||
|
||
get_tools: | ||
cd tools && $(MAKE) | ||
|
||
get_vendor_deps: | ||
@rm -rf vendor/ | ||
@echo "--> Running glide install" | ||
@glide install | ||
|
||
|
||
######################################## | ||
### Testing | ||
|
||
test: | ||
@go test $(PACKAGES) | ||
|
||
benchmark: | ||
@go test -bench=. $(PACKAGES) | ||
|
||
|
||
# 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 check_tools get_tools get_vendor_deps test benchmark |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package: github.com/cosmos/cosmos-sdk/examples/basecoin | ||
import: | ||
- package: github.com/cosmos/cosmos-sdk | ||
version: sdk2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
all: install_glide check get_vendor_deps install | ||
|
||
|
||
######################################## | ||
### Glide | ||
|
||
GLIDE = github.com/tendermint/glide | ||
GLIDE_CHECK := $(shell command -v glide 2> /dev/null) | ||
|
||
check: | ||
ifndef GLIDE_CHECK | ||
@echo "No glide in path. Install with 'make install_glide'." | ||
else | ||
@echo "Found glide in path." | ||
endif | ||
|
||
install_glide: | ||
ifdef GLIDE_CHECK | ||
@echo "Glide is already installed. Run 'make update_glide' to update." | ||
else | ||
@echo "$(ansi_grn)Installing glide$(ansi_end)" | ||
go get -v $(GLIDE) | ||
endif | ||
|
||
update_glide: | ||
@echo "$(ansi_grn)Updating glide$(ansi_end)" | ||
go get -u -v $(GLIDE) | ||
|
||
|
||
######################################## | ||
### Install tools | ||
|
||
|
||
get_vendor_deps: check | ||
@rm -rf vendor/ | ||
@echo "--> Running glide install" | ||
@glide install | ||
|
||
install: get_vendor_deps | ||
@echo "$(ansi_grn)Installing tools$(ansi_end)" | ||
@echo "$(ansi_yel)Install go-vendorinstall$(ansi_end)" | ||
go build -o bin/go-vendorinstall go-vendorinstall/*.go | ||
|
||
@echo "$(ansi_yel)Install gometalinter.v2$(ansi_end)" | ||
GOBIN=$(CURDIR)/bin ./bin/go-vendorinstall gopkg.in/alecthomas/gometalinter.v2 | ||
|
||
@echo "$(ansi_yel)Install shelldown$(ansi_end)" | ||
GOBIN=$(CURDIR)/bin ./bin/go-vendorinstall github.com/rigelrozanski/shelldown/cmd/shelldown | ||
|
||
@echo "$(ansi_grn)Done installing tools$(ansi_end)" | ||
|
||
|
||
######################################## | ||
# ANSI colors | ||
|
||
ansi_red=\033[0;31m | ||
ansi_grn=\033[0;32m | ||
ansi_yel=\033[0;33m | ||
ansi_end=\033[0m | ||
|
||
|
||
# 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: check install_glide update_glide get_vendor_deps install |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package: github.com/cosmos/cosmos-sdk/tools | ||
import: | ||
- package: github.com/rigelrozanski/shelldown | ||
subpackages: | ||
- cmd/shelldown | ||
- package: gopkg.in/alecthomas/gometalinter.v2 |
Oops, something went wrong.