Skip to content

Commit

Permalink
Make basecoin a root project
Browse files Browse the repository at this point in the history
  • Loading branch information
jaekwon committed Jan 21, 2018
1 parent 561da63 commit b9455e9
Show file tree
Hide file tree
Showing 11 changed files with 438 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/basecoin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.swp
*.swo
vendor
build

### Vagrant ###
.vagrant/
*.box
*.log
vagrant
41 changes: 41 additions & 0 deletions examples/basecoin/Makefile
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
152 changes: 152 additions & 0 deletions examples/basecoin/glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions examples/basecoin/glide.yaml
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
1 change: 1 addition & 0 deletions examples/basecoin/tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/*
65 changes: 65 additions & 0 deletions examples/basecoin/tools/Makefile
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
18 changes: 18 additions & 0 deletions examples/basecoin/tools/glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/basecoin/tools/glide.yaml
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
Loading

0 comments on commit b9455e9

Please sign in to comment.