-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: makefile cleanup/fixes (#2549)
* cleaning up makefile * chore: removing goimports (#2548) * more cleanup * missing files * empty new line at the end * fix dockerfile * rename import Co-authored-by: Carlos Rodriguez <[email protected]> Co-authored-by: Cian Hatton <[email protected]>
- Loading branch information
1 parent
35b6084
commit e3a32a6
Showing
8 changed files
with
99 additions
and
543 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,76 @@ | ||
### | ||
# 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 | ||
statik: $(STATIK) | ||
$(STATIK): | ||
@echo "Installing statik..." | ||
@go install github.com/rakyll/[email protected] | ||
|
||
# Install the runsim binary | ||
runsim: $(RUNSIM) | ||
$(RUNSIM): | ||
@echo "Installing runsim..." | ||
@go install github.com/cosmos/tools/cmd/[email protected] | ||
|
||
tools-clean: | ||
rm -f $(STATIK) $(GOLANGCI_LINT) $(RUNSIM) | ||
rm -f tools-stamp | ||
|
||
.PHONY: tools-clean statik runsim |
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,14 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
PKGS=$(go list ./... | grep -v '/simapp') | ||
|
||
set -e | ||
echo "mode: atomic" > coverage.txt | ||
for pkg in ${PKGS[@]}; do | ||
go test -v -timeout 30m -race -coverprofile=profile.out -covermode=atomic -tags='ledger test_ledger_mock' "$pkg" | ||
if [ -f profile.out ]; then | ||
tail -n +2 profile.out >> coverage.txt; | ||
rm profile.out | ||
fi | ||
done |
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
Oops, something went wrong.