@@ -5,6 +5,7 @@ BINARY_NAME = axoned
5
5
TARGET_FOLDER = target
6
6
DIST_FOLDER = $(TARGET_FOLDER ) /dist
7
7
RELEASE_FOLDER = $(TARGET_FOLDER ) /release
8
+ TOOLS_FOLDER = $(TARGET_FOLDER ) /tools
8
9
CMD_ROOT :=./cmd/${BINARY_NAME}
9
10
LEDGER_ENABLED ?= true
10
11
@@ -19,6 +20,12 @@ DOCKER_BUILDX_BUILDER = axone-builder
19
20
DOCKER_IMAGE_MARKDOWNLINT = thegeeklab/markdownlint-cli:0.32.2
20
21
DOCKER_IMAGE_GOTEMPLATE = hairyhenderson/gomplate:v3.11.3-alpine
21
22
23
+ # Tools
24
+ TOOL_TPARSE_NAME := tparse
25
+ TOOL_TPARSE_VERSION := v0.16.0
26
+ TOOL_TPARSE_PKG := github.com/mfridman/$(TOOL_TPARSE_NAME ) @$(TOOL_TPARSE_VERSION )
27
+ TOOL_TPARSE_BIN := ${TOOLS_FOLDER}/$(TOOL_TPARSE_NAME ) /$(TOOL_TPARSE_VERSION ) /$(TOOL_TPARSE_NAME )
28
+
22
29
# Some colors
23
30
COLOR_GREEN = $(shell tput -Txterm setaf 2)
24
31
COLOR_YELLOW = $(shell tput -Txterm setaf 3)
@@ -190,9 +197,9 @@ install: ## Install node executable
190
197
test : test-go # # Pass all the tests
191
198
192
199
.PHONY : test-go
193
- test-go : build # # Pass the test for the go source code
200
+ test-go : $( TOOL_TPARSE_BIN ) build # # Pass the test for the go source code
194
201
@echo " ${COLOR_CYAN} 🧪 Passing go tests${COLOR_RESET} "
195
- @go test -v -coverprofile ./target/coverage.txt ./...
202
+ @go test -v -coverprofile ./target/coverage.txt ./... -json | $( TOOL_TPARSE_BIN )
196
203
197
204
# # Chain:
198
205
chain-init : build # # Initialize the blockchain with default settings.
@@ -409,6 +416,15 @@ ensure-buildx-builder:
409
416
@docker buildx ls | sed ' 1 d' | cut -f 1 -d ' ' | grep -q ${DOCKER_BUILDX_BUILDER} || \
410
417
docker buildx create --name ${DOCKER_BUILDX_BUILDER}
411
418
419
+ # # Dependencies:
420
+ .PHONY : deps
421
+ deps : $(TOOL_TPARSE_BIN ) # # Install all the dependencies (tools, etc.)
422
+
423
+ $(TOOL_TPARSE_BIN ) :
424
+ @echo " ${COLOR_CYAN} 📦 Installing ${COLOR_GREEN} $( TOOL_TPARSE_NAME) @$( TOOL_TPARSE_VERSION) ${COLOR_CYAN} ...${COLOR_RESET} "
425
+ @mkdir -p $(dir $(TOOL_TPARSE_BIN ) )
426
+ @GOBIN=$(dir $(abspath $(TOOL_TPARSE_BIN ) ) ) go install $(TOOL_TPARSE_PKG )
427
+
412
428
# # Help:
413
429
.PHONY : help
414
430
help : # # Show this help.
0 commit comments