-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Final updates, genesis json * version fix
- Loading branch information
Showing
7 changed files
with
580 additions
and
280 deletions.
There are no files selected for viewing
This file was deleted.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
vue | ||
release/ | ||
.idea/ | ||
build |
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,104 @@ | ||
#!/usr/bin/make -f | ||
|
||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD) | ||
COMMIT := $(shell git log -1 --format='%H') | ||
|
||
# don't override user values | ||
ifeq (,$(VERSION)) | ||
VERSION := $(shell git describe --tags | sed 's/^v//') | ||
# if VERSION is empty, then populate it with branch's name and raw commit hash | ||
ifeq (,$(VERSION)) | ||
VERSION := $(BRANCH)-$(COMMIT) | ||
endif | ||
endif | ||
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation') | ||
LEDGER_ENABLED ?= true | ||
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') | ||
TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::') # grab everything after the space in "github.com/tendermint/tendermint v0.34.7" | ||
DOCKER := $(shell which docker) | ||
BUILDDIR ?= $(CURDIR)/build | ||
TEST_DOCKER_REPO=jackzampolin/gaiatest | ||
|
||
export GO111MODULE = on | ||
|
||
# process build tags | ||
|
||
build_tags = netgo | ||
ifeq ($(LEDGER_ENABLED),true) | ||
ifeq ($(OS),Windows_NT) | ||
GCCEXE = $(shell where gcc.exe 2> NUL) | ||
ifeq ($(GCCEXE),) | ||
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false) | ||
else | ||
build_tags += ledger | ||
endif | ||
else | ||
UNAME_S = $(shell uname -s) | ||
ifeq ($(UNAME_S),OpenBSD) | ||
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988)) | ||
else | ||
GCC = $(shell command -v gcc 2> /dev/null) | ||
ifeq ($(GCC),) | ||
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false) | ||
else | ||
build_tags += ledger | ||
endif | ||
endif | ||
endif | ||
endif | ||
|
||
ifeq (cleveldb,$(findstring cleveldb,$(GAIA_BUILD_OPTIONS))) | ||
build_tags += gcc cleveldb | ||
endif | ||
build_tags += $(BUILD_TAGS) | ||
build_tags := $(strip $(build_tags)) | ||
|
||
whitespace := | ||
whitespace += $(whitespace) | ||
comma := , | ||
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) | ||
|
||
# process linker flags | ||
|
||
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=bcna \ | ||
-X github.com/cosmos/cosmos-sdk/version.AppName=dewebd \ | ||
-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_comma_sep)" \ | ||
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION) | ||
|
||
ifeq (cleveldb,$(findstring cleveldb,$(GAIA_BUILD_OPTIONS))) | ||
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb | ||
endif | ||
ifeq (,$(findstring nostrip,$(GAIA_BUILD_OPTIONS))) | ||
ldflags += -w -s | ||
endif | ||
ldflags += $(LDFLAGS) | ||
ldflags := $(strip $(ldflags)) | ||
|
||
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' | ||
# check for nostrip option | ||
ifeq (,$(findstring nostrip,$(GAIA_BUILD_OPTIONS))) | ||
BUILD_FLAGS += -trimpath | ||
endif | ||
|
||
#$(info $$BUILD_FLAGS is [$(BUILD_FLAGS)]) | ||
|
||
# The below include contains the tools target. | ||
include contrib/devtools/Makefile | ||
|
||
############################################################################### | ||
### Documentation ### | ||
############################################################################### | ||
all: install lint test | ||
|
||
BUILD_TARGETS := build install | ||
|
||
build: BUILD_ARGS=-o $(BUILDDIR)/ | ||
|
||
$(BUILD_TARGETS): go.sum $(BUILDDIR)/ | ||
#go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... Don't overwrite go.sum | ||
go $@ $(BUILD_FLAGS) $(BUILD_ARGS) ./... | ||
|
||
$(BUILDDIR)/: | ||
mkdir -p $(BUILDDIR)/ |
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
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,114 @@ | ||
### | ||
# Find OS and Go environment | ||
# GO contains the Go binary | ||
# FS contains the OS file separator | ||
### | ||
ifeq ($(OS),Windows_NT) | ||
GO := $(shell where go.exe 2> NUL) | ||
FS := \\ | ||
else | ||
GO := $(shell command -v go 2> /dev/null) | ||
FS := / | ||
endif | ||
|
||
ifeq ($(GO),) | ||
$(error could not find go. Is it in PATH? $(GO)) | ||
endif | ||
|
||
GOPATH ?= $(shell $(GO) env GOPATH) | ||
GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com | ||
|
||
### | ||
# Functions | ||
### | ||
|
||
go_get = $(if $(findstring Windows_NT,$(OS)),\ | ||
IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS) ( mkdir $(GITHUBDIR)$(FS)$(1) ) else (cd .) &\ | ||
IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS)$(2)$(FS) ( cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2) ) else (cd .) &\ | ||
,\ | ||
mkdir -p $(GITHUBDIR)$(FS)$(1) &&\ | ||
(test ! -d $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2)) || true &&\ | ||
)\ | ||
cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && git fetch origin && git checkout -q $(3) | ||
|
||
go_install = $(call go_get,$(1),$(2),$(3)) && cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && $(GO) install | ||
|
||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) | ||
mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd) | ||
|
||
############################################################################### | ||
### Tools ### | ||
############################################################################### | ||
|
||
BIN ?= /usr/local/bin | ||
UNAME_S ?= $(shell uname -s) | ||
UNAME_M ?= $(shell uname -m) | ||
|
||
TOOLS_DESTDIR ?= $(GOPATH)/bin | ||
RUNSIM = $(TOOLS_DESTDIR)/runsim | ||
|
||
BUF_VERSION ?= 0.7.0 | ||
PROTOC_VERSION ?= 3.11.2 | ||
|
||
ifeq ($(UNAME_S),Linux) | ||
PROTOC_ZIP ?= protoc-3.11.2-linux-x86_64.zip | ||
endif | ||
ifeq ($(UNAME_S),Darwin) | ||
PROTOC_ZIP ?= protoc-3.11.2-osx-x86_64.zip | ||
endif | ||
|
||
all: tools | ||
|
||
tools: tools-stamp | ||
|
||
tools-stamp: $(RUNSIM) | ||
touch $@ | ||
|
||
# Install the runsim binary with a temporary workaround of entering an outside | ||
# directory as the "go get" command ignores the -mod option and will polute the | ||
# go.{mod, sum} files. | ||
# | ||
# ref: https://github.com/golang/go/issues/30515 | ||
runsim: $(RUNSIM) | ||
$(RUNSIM): | ||
@echo "Installing runsim..." | ||
@(cd /tmp && go get github.com/cosmos/tools/cmd/[email protected]) | ||
|
||
protoc: | ||
@echo "Installing protoc compiler..." | ||
@(cd /tmp; \ | ||
curl -sSOL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"; \ | ||
unzip -o ${PROTOC_ZIP} -d /usr/local bin/protoc; \ | ||
unzip -o ${PROTOC_ZIP} -d /usr/local 'include/*'; \ | ||
rm -f ${PROTOC_ZIP}) | ||
|
||
protoc-gen-gocosmos: | ||
@echo "Installing protoc-gen-gocosmos..." | ||
@go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos | ||
|
||
buf: protoc-gen-buf-check-breaking protoc-gen-buf-check-lint | ||
@echo "Installing buf..." | ||
@(cd /tmp; \ | ||
curl -sSOL "https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-${UNAME_S}-${UNAME_M}"; \ | ||
mv buf-${UNAME_S}-${UNAME_M} "${BIN}/buf"; \ | ||
chmod +x "${BIN}/buf") | ||
|
||
protoc-gen-buf-check-breaking: | ||
@echo "Installing protoc-gen-buf-check-breaking..." | ||
@(cd /tmp; \ | ||
curl -sSOL "https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/protoc-gen-buf-check-breaking-${UNAME_S}-${UNAME_M}"; \ | ||
mv protoc-gen-buf-check-breaking-${UNAME_S}-${UNAME_M} "${BIN}/protoc-gen-buf-check-breaking"; \ | ||
chmod +x "${BIN}/protoc-gen-buf-check-breaking") | ||
|
||
protoc-gen-buf-check-lint: | ||
@echo "Installing protoc-gen-buf-check-lint..." | ||
@(cd /tmp; \ | ||
curl -sSOL "https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/protoc-gen-buf-check-lint-${UNAME_S}-${UNAME_M}"; \ | ||
mv protoc-gen-buf-check-lint-${UNAME_S}-${UNAME_M} "${BIN}/protoc-gen-buf-check-lint"; \ | ||
chmod +x "${BIN}/protoc-gen-buf-check-lint") | ||
|
||
tools-clean: | ||
rm -f $(RUNSIM) | ||
rm -f tools-stamp | ||
|
||
.PHONY: all tools tools-clean protoc buf protoc-gen-buf-check-breaking protoc-gen-buf-check-lint protoc-gen-gocosmos |
Oops, something went wrong.