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

buildsystem: various small improvements #6598

Merged
merged 1 commit into from
Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ docs/node_modules
dist
tools-stamp
proto-tools-stamp
buf-stamp

# Data - ideally these don't exist
baseapp/data/*
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuil

export GO111MODULE = on

all: tools build lint test

# The below include contains the tools and runsim targets.
include contrib/devtools/Makefile

all: tools build lint test

###############################################################################
### Build ###
###############################################################################

build: go.sum
@go build -mod=readonly ./...
go build -mod=readonly ./...

build-sim: go.sum
mkdir -p $(BUILDDIR)
Expand Down
24 changes: 13 additions & 11 deletions contrib/devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ tools-stamp: proto-tools statik runsim
# 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
statik: $(STATIK)
$(STATIK):
Expand All @@ -70,7 +70,7 @@ $(STATIK):
# 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):
Expand All @@ -85,7 +85,7 @@ ifeq ($(UNAME_S),Darwin)
PROTOC_ZIP ?= protoc-3.11.2-osx-x86_64.zip
endif

proto-tools: proto-tools-stamp protoc-gen-gocosmos buf
proto-tools: proto-tools-stamp buf

proto-tools-stamp:
@echo "Installing protoc compiler..."
Expand All @@ -95,7 +95,14 @@ proto-tools-stamp:
unzip -o ${PROTOC_ZIP} -d $(PREFIX) 'include/*'; \
rm -f ${PROTOC_ZIP})

buf:
@echo "Installing protoc-gen-gocosmos..."
@go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos

touch $@

buf: buf-stamp

buf-stamp:
@echo "Installing buf..."
@curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-${UNAME_S}-${UNAME_M}" \
Expand All @@ -104,13 +111,8 @@ buf:

touch $@

protoc-gen-gocosmos:
@echo "Installing protoc-gen-gocosmos..."
@go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos

tools-clean:
rm -f $(STATIK) $(GOLANGCI_LINT) $(RUNSIM)
rm -f tools-stamp proto-tools-stamp
rm -f tools-stamp proto-tools-stamp buf-stamp

.PHONY: tools-clean statik runsim \
protoc-gen-gocosmos
.PHONY: tools-clean statik runsim