2019-01-08 21:02:11 +01:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
2019-02-11 09:40:43 +01:00
|
|
|
GO111MODULE = on
|
|
|
|
|
2019-04-15 18:48:32 +08:00
|
|
|
build: GOFLAGS ?= "-mod=vendor"
|
2019-01-08 21:02:11 +01:00
|
|
|
build:
|
2019-04-15 18:48:32 +08:00
|
|
|
GOFLAGS=$(GOFLAGS) go build -o ./bin/status-term-client .
|
2019-01-08 21:02:11 +01:00
|
|
|
.PHONY: build
|
|
|
|
|
|
|
|
run: ARGS ?=
|
|
|
|
run: build
|
|
|
|
./bin/status-term-client $(ARGS) 2>/tmp/status-term-client.log
|
|
|
|
.PHONY: run
|
|
|
|
|
|
|
|
test:
|
2019-04-12 16:53:26 +02:00
|
|
|
go test ./...
|
2019-03-11 18:49:18 +01:00
|
|
|
.PHONY: test
|
2019-02-11 09:40:43 +01:00
|
|
|
|
2019-01-08 21:02:11 +01:00
|
|
|
test-race:
|
|
|
|
go test -race ./...
|
2019-03-11 18:49:18 +01:00
|
|
|
.PHONY: test-race
|
2019-01-08 21:02:11 +01:00
|
|
|
|
|
|
|
lint:
|
2019-02-11 09:40:43 +01:00
|
|
|
golangci-lint run -v
|
2019-01-08 21:02:11 +01:00
|
|
|
.PHONY: lint
|
|
|
|
|
2019-02-11 09:40:43 +01:00
|
|
|
lint-v110:
|
|
|
|
golangci-lint run -v --config .golangci-v110.yml
|
|
|
|
.PHONY: lint-v110
|
|
|
|
|
|
|
|
vendor:
|
|
|
|
go mod vendor
|
|
|
|
modvendor -copy="**/*.c **/*.h" -v
|
|
|
|
.PHONY: vendor
|
|
|
|
|
2019-03-11 18:49:18 +01:00
|
|
|
install-linter:
|
2019-02-11 09:40:43 +01:00
|
|
|
# install linter
|
2019-01-08 21:02:11 +01:00
|
|
|
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.12.5
|
2019-03-11 18:49:18 +01:00
|
|
|
.PHONY: install-linter
|
|
|
|
|
|
|
|
install-dev:
|
2019-02-11 09:40:43 +01:00
|
|
|
# a tool to vendor non-go files
|
2019-04-13 23:08:57 +02:00
|
|
|
go get -u github.com/goware/modvendor
|
|
|
|
go get -u github.com/golang/mock/gomock
|
|
|
|
go install github.com/golang/mock/mockgen
|
2019-01-08 21:02:11 +01:00
|
|
|
.PHONY: install-dev
|
2019-04-13 23:08:57 +02:00
|
|
|
|
|
|
|
mock:
|
|
|
|
mockgen \
|
|
|
|
-destination ./protocol/v1/mock/protocol_mock.go \
|
|
|
|
-package protocol_mock \
|
|
|
|
github.com/status-im/status-console-client/protocol/v1 Protocol
|
|
|
|
.PHONY: mock
|