-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (29 loc) · 1.06 KB
/
Makefile
File metadata and controls
42 lines (29 loc) · 1.06 KB
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
.PHONY: all dep lint vet test test-coverage build clean
# custom define
PROJECT := moreu
MAINFILE := main.go
all: build
mod: ## Get the dependencies
@go mod download
lint: ## Lint Golang files
@golangci-lint --version
@golangci-lint run -D errcheck
test: ## Run tests with coverage
go test -coverprofile .coverprofile ./...
go tool cover --func=.coverprofile
coverage-html: ## show coverage by the html
go tool cover -html=.coverprofile
generate:
go generate ./...
swag:
swag init --exclude client
client: swag
swagger-codegen generate -i docs/swagger.json -l go -DpackageName=client -o client
jssdk: swag
swagger-codegen generate -i docs/swagger.json -l javascript -DprojectName=moreu-jssdk --additional-properties usePromises=true,useES6=true -o ../moreu-jssdk
build: mod ## Build the binary file
@go build -v -o build/bin/$(PROJECT) $(MAINFILE)
clean: ## Remove previous build
@rm -rf ./build
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}'