-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (40 loc) · 1.19 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
# Exporting bin folder to the path for makefile
export PATH := $(PWD)/bin:$(PATH)
# Default Shell
export SHELL := bash
# Type of OS: Linux or Darwin.
export OSTYPE := $(shell uname -s)
# --- Tooling & Variables ----------------------------------------------------------------
include ./misc/make/tools.Makefile
install-deps: gotestsum
deps: $(GOTESTSUM)
deps:
@ echo "Required Tools Are Available"
build:
@ echo "Build Binary"
@ mkdir ./build/db
@ cp ./db/local-data.db ./build/db/local-data.db && cp .example.env ./build/.env
@ go mod install
@ go build -o ./build/pokewar.exe ./cmd/web/main.go -v
@ echo "generate binary done"
swag: tests
@ echo "Re-generate Swagger File (API Spec docs)"
@ swag init --parseDependency --parseInternal \
--parseDepth 4 -g ./cmd/web/main.go
@ echo "generate swagger file done"
tests: $(GOTESTSUM) lint
@ echo "Run tests"
@ gotestsum --format pkgname-and-test-fails \
--hide-summary=skipped \
-- -coverprofile=cover.out ./...
@ rm cover.out
lint: $(GOLANGCI)
@ echo "Applying linter"
@ golangci-lint cache clean
@ golangci-lint run -c .golangci.yaml ./...
run:
@echo "Run App"
go run ./cmd/web/main.go
prepare:
go mod install
cp .example.env .env