forked from skycoin/skycoin-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (50 loc) · 1.88 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
61
62
.DEFAULT_GOAL := help
.PHONY: build-js build-js-min test lint check install-linters format fix-skycoin-dep help
.PHONY: test-js
build-js: ## Build /skycoin/skycoin.go. The result is saved in the repo root
go build -o gopherjs-tool vendor/github.com/gopherjs/gopherjs/tool.go
GOOS=linux ./gopherjs-tool build skycoin/skycoin.go
build-js-min: ## Build /skycoin/skycoin.go. The result is minified and saved in the repo root
go build -o gopherjs-tool vendor/github.com/gopherjs/gopherjs/tool.go
GOOS=linux ./gopherjs-tool build skycoin/skycoin.go -m
test-js: ## Run the Go tests using JavaScript
go build -o gopherjs-tool vendor/github.com/gopherjs/gopherjs/tool.go
./gopherjs-tool test ./skycoin/ -v
test-suite-ts: ## Run the ts version of the cipher test suite. Use a small number of test cases
npm run test
test-suite-ts-extensive: ## Run the ts version of the cipher test suite. All the test cases
npm run test-extensive
test:
go test ./... -timeout=10m -cover
lint: ## Run linters. Use make install-linters first.
vendorcheck ./...
gometalinter --deadline=3m -j 2 --disable-all --tests --exclude .. --vendor \
-E goimports \
-E unparam \
-E deadcode \
-E errcheck \
-E gosec \
-E goconst \
-E gofmt \
-E golint \
-E ineffassign \
-E maligned \
-E megacheck \
-E misspell \
-E nakedret \
-E structcheck \
-E unconvert \
-E varcheck \
-E vet \
./...
check: lint test ## Run tests and linters
install-linters: ## Install linters
go get -u github.com/FiloSottile/vendorcheck
go get -u github.com/alecthomas/gometalinter
gometalinter --vendored-linters --install
format: ## Formats the code. Must have goimports installed (use make install-linters).
goimports -w ./skycoin
goimports -w ./liteclient
goimports -w ./mobile
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'