buildsystem: various small improvements (#6598)

Follow-up of #6101.

- Makefile:

Set all as actual default target.

- contrib/devtools/Makefile:

The buf target was running unconditionally.

Install protoc-gen-gocosmos along with protoc.
This commit is contained in:
Alessio Treglia 2020-07-03 20:50:14 +02:00 committed by GitHub
parent 849429ecda
commit 80e53a4d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 14 deletions

1
.gitignore vendored
View File

@ -20,6 +20,7 @@ docs/node_modules
dist
tools-stamp
proto-tools-stamp
buf-stamp
# Data - ideally these don't exist
baseapp/data/*

View File

@ -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)

View File

@ -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):
@ -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):
@ -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..."
@ -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}" \
@ -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