diff --git a/Makefile b/Makefile index 9b8953e7..7110efb9 100644 --- a/Makefile +++ b/Makefile @@ -107,10 +107,7 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) BUILD_FLAGS += -trimpath endif -# The below include contains the tools and runsim targets. -include contrib/devtools/Makefile - -all: tools install lint test +all: install lint test build: go.sum ifeq ($(OS),Windows_NT) diff --git a/contrib/devtools/Makefile b/contrib/devtools/Makefile deleted file mode 100644 index 1416939b..00000000 --- a/contrib/devtools/Makefile +++ /dev/null @@ -1,83 +0,0 @@ -### -# 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 - -############################################################################### -### 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) - -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd) - -############################################################################### -### Tools ### -############################################################################### - -PREFIX ?= /usr/local -BIN ?= $(PREFIX)/bin -UNAME_S ?= $(shell uname -s) -UNAME_M ?= $(shell uname -m) - -GOPATH ?= $(shell $(GO) env GOPATH) -GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com - -BUF_VERSION ?= 0.11.0 - -TOOLS_DESTDIR ?= $(GOPATH)/bin -STATIK = $(TOOLS_DESTDIR)/statik -RUNSIM = $(TOOLS_DESTDIR)/runsim - -tools: tools-stamp -tools-stamp: statik runsim - # Create dummy file to satisfy dependency and avoid - # rebuilding when this Makefile target is hit twice - # in a row. - 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 -statik: $(STATIK) -$(STATIK): - @echo "Installing statik..." - @(cd /tmp && go install github.com/rakyll/statik@v0.1.6) - -# 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/runsim@v1.0.0) - -tools-clean: - rm -f $(STATIK) $(RUNSIM) - rm -f tools-stamp - -.PHONY: tools-clean statik runsim diff --git a/contrib/devtools/dockerfile b/contrib/devtools/dockerfile deleted file mode 100644 index 565e66ea..00000000 --- a/contrib/devtools/dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM bufbuild/buf:latest as BUILDER - -FROM golang:alpine - -ENV GOLANG_PROTOBUF_VERSION=1.3.5 \ - GOGO_PROTOBUF_VERSION=1.3.2 \ - GRPC_GATEWAY_VERSION=1.14.7 - - -RUN GO111MODULE=on go get \ - github.com/golang/protobuf/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} \ - github.com/gogo/protobuf/protoc-gen-gogo@v${GOGO_PROTOBUF_VERSION} \ - github.com/gogo/protobuf/protoc-gen-gogofast@v${GOGO_PROTOBUF_VERSION} \ - github.com/gogo/protobuf/protoc-gen-gogofaster@v${GOGO_PROTOBUF_VERSION} \ - github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} \ - github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION} \ - github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest - -RUN GO111MODULE=on go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc - -COPY --from=BUILDER /usr/local/bin /usr/local/bin