-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
51 lines (40 loc) · 2.12 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
.DEFAULT_GOAL := help
.PHONY: build-js build-js-min
.PHONY: test lint check
.PHONY: install-linters format
.PHONY: help
.PHONY: test-js
.PHONY: test-suite-ts test-suite-ts-extensive
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 -o js/skycoin.js
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 -o js/skycoin.js
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
cd js && npm run test
test-suite-ts-extensive: ## Run the ts version of the cipher test suite. All the test cases
cd js && npm run test-extensive
test:
go test ./... -timeout=10m -cover
lint: ## Run linters. Use make install-linters first.
vendorcheck ./...
golangci-lint run -c ./.golangci.yml ./...
@# The govet version in golangci-lint is out of date and has spurious warnings, run it separately
go vet -all ./...
check: lint test ## Run tests and linters
install-linters: ## Install linters
go get -u github.com/FiloSottile/vendorcheck
# For some reason this install method is not recommended, see https://github.com/golangci/golangci-lint#install
# However, they suggest `curl ... | bash` which we should not do
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
format: ## Formats the code. Must have goimports installed (use make install-linters).
goimports -w -local github.com/skycoin/skycoin-lite ./skycoin
goimports -w -local github.com/skycoin/skycoin-lite ./liteclient
goimports -w -local github.com/skycoin/skycoin-lite ./mobile
goimports -w -local github.com/skycoin/skycoin-lite ./main.go
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'