-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
36 lines (28 loc) · 880 Bytes
/
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
GO_FILES:=$$(find ./ -type f -name '*.go' -not -path ".//vendor/*")
COVER_FILE ?= coverage.out
SOURCE_PATHS ?= ./pkg/...
test:
go test ./...
cover: ## Generates coverage report
go test -gcflags=all=-l -timeout=10m `go list $(SOURCE_PATHS)` -coverprofile $(COVER_FILE) ${TEST_FLAGS}
clean:
rm -rf models
rm -rf test_data/tmp_*
check-fmt:
test -z $$(goimports -l -w -e -local=kcl-lang.io $(GO_FILES))
gofmt -l -w .
regenerate: ## regenerate all the golden files
go run scripts/regenerate.go
build-local-linux:
# Delete old artifacts
-rm -rf ./_build/linux
mkdir -p ./_build/linux/
# Build kcl-openapi
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \
go build -o ./_build/linux/kcl-openapi \
-ldflags="-s -w" .
build:
-rm -rf ./_build/local/
mkdir -p ./_build/local/
# Build kcl-openapi
CGO_ENABLED=0 go build -o ./_build/local/kcl-openapi -ldflags="-s -w" .