-
Notifications
You must be signed in to change notification settings - Fork 130
/
Makefile
30 lines (24 loc) · 896 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
.PHONY: test lint cover mock_wire mock_gen swag
test:
go test ./...
lint:
golangci-lint run
cover:
go test -coverprofile=cover.out ./...
go tool cover -html=cover.out -o cover.html
open cover.html
mock_wire:
@echo "Running wire for component mocks..."
@go run -mod=mod github.com/google/wire/cmd/wire opencsg.com/csghub-server/component/...
@if [ $$? -eq 0 ]; then \
echo "Renaming component wire_gen.go to wire_gen_test.go..."; \
mv component/wire_gen.go component/wire_gen_test.go; \
echo "Renaming component/callback wire_gen.go to wire_gen_test.go..."; \
mv component/callback/wire_gen.go component/callback/wire_gen_test.go; \
else \
echo "Wire failed, skipping renaming."; \
fi
mock_gen:
mockery
swag:
swag init --pd -d cmd/csghub-server/cmd/start,api/router,api/handler,builder/store/database,common/types,accounting/handler,user/handler,component -g server.go