forked from uvwt/nexusdock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (40 loc) · 1.22 KB
/
Copy pathMakefile
File metadata and controls
59 lines (40 loc) · 1.22 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
GO_SOURCES := $(shell find cmd internal tests -type f -name '*.go' -print | sort)
WEB_INSTALL_STAMP := web/node_modules/.install-stamp
.PHONY: fmt fmt-check test test-race vet tidy-check contracts repository-check web-deps web-build build build-nexusdock check ci run run-nexusdock clean
fmt:
gofmt -w $(GO_SOURCES)
fmt-check:
@files="$$(gofmt -l $(GO_SOURCES))"; \
if [ -n "$$files" ]; then \
printf '以下 Go 文件需要 gofmt:\n%s\n' "$$files"; \
exit 1; \
fi
test:
go test ./...
test-race:
go test -race ./...
vet:
go vet ./...
tidy-check:
go mod tidy -diff
contracts:
python3 scripts/check-contracts.py
repository-check:
python3 scripts/check-repository.py
$(WEB_INSTALL_STAMP): web/package.json web/package-lock.json
cd web && npm ci
@touch $(WEB_INSTALL_STAMP)
web-deps: $(WEB_INSTALL_STAMP)
web-build: web-deps
cd web && npm run build
check: fmt-check tidy-check test vet contracts repository-check
ci: web-build check test-race build-nexusdock
build: web-build check build-nexusdock
build-nexusdock:
mkdir -p bin
go build -trimpath -o bin/nexusdock ./cmd/nexusdock
run: run-nexusdock
run-nexusdock:
go run ./cmd/nexusdock
clean:
rm -rf bin web/node_modules web/.vite web/tsconfig.tsbuildinfo