Skip to content

Commit

Permalink
buildsystem: various small improvements (#6598)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Alessio Treglia authored Jul 3, 2020
1 parent 849429e commit 80e53a4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
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

0 comments on commit 80e53a4

Please sign in to comment.