forked from filswan/go-swan-provider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (50 loc) · 1.7 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
PROJECT_NAME=payment-bridge
PKG := "$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
BINARY_NAME=payment-bridge
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOBIN=$(shell pwd)/build/bin
.PHONY: all dep build clean test coverage coverhtml lint
all: build
lint: ## Lint the files
@golangci-lint run --timeout 150m
@echo "Done lint."
test: ## Run unittests
@go test -short ${PKG_LIST}
@echo "Done testing."
dep: ## Get the dependencies
ifeq ($(shell command -v dep 2> /dev/null),)
$(GOGET) -u -v github.com/golang/dep/cmd/dep
endif
ifeq ($(shell command -v govendor 2> /dev/null),)
$(GOGET) -u -v github.com/kardianos/govendor
endif
@dep ensure
@govendor init
@govendor add +e
@rm -rf ./vendor/github.com/nebulaai/nbai-node/crypto/secp256k1/
@rm -rf ./vendor/github.com/karalabe/hid
@govendor fetch -tree github.com/nebulaai/nbai-node/crypto/secp256k1
@govendor fetch -tree github.com/karalabe/hid
@echo "Done dep."
build: ## Build the binary file
@go mod download
@go mod tidy
@go build -o build/payment-bridge main/payment-bridge.go
@mkdir -p ./build/config
@mkdir -p ./build/on-chain/contracts/abi
@cp ./config/config.toml ./build/config/config.toml
@cp .env ./build/.env
@cp ./on-chain/contracts/abi/SwanPayment.json ./build/on-chain/contracts/abi/SwanPayment.json
@echo "Done building."
clean: ## Remove previous build
@go clean
@rm -rf $(shell pwd)/build
@echo "Done cleaning."
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'