1
+ include scripts/Makefile.docs
2
+
1
3
MODULE := $(shell go list -m)
2
4
MODULE_NAME := $(lastword $(subst /, ,$(MODULE ) ) )
3
5
BUILD := $(shell git rev-parse --short HEAD) @$(shell date +% s)
@@ -10,7 +12,6 @@ DOCKER_FILE := cmd/app/Dockerfile
10
12
LD_FLAGS := "-X $(MODULE ) /internal/config.BuildVersion=$(BUILD ) "
11
13
GO_BUILD := CGO_ENABLED=0 go build -trimpath -ldflags $(LD_FLAGS ) -tags=jsoniter
12
14
13
-
14
15
.PHONY : init
15
16
init : # # Init all dependencies
16
17
go mod download
@@ -39,13 +40,13 @@ gen-proto: ## Generate proto files and run protoc plugins
39
40
40
41
.PHONY : gen-docs
41
42
gen-docs : gen-proto # # Generate swagger docs
42
- swag init --output ./swagger/ api --tags api.v1,shared.v1 --instanceName API -g docs.go --parseDependency
43
- swag init --output ./swagger/ dash --tags dash.v1,shared.v1 --instanceName Dash -g docs.go --parseDependency
43
+ $( call gen_docs, api, API)
44
+ $( call gen_docs, dash, Dash)
44
45
45
46
.PHONY : gen-ts
46
47
gen-ts : gen-docs # # Generate typescript client
47
- npx swagger-typescript- api -p ./swagger/api/API_swagger.json -o ./swagger/api/typescript --modular --responses --extract-response-body --extract-response-error
48
- npx swagger-typescript-api -p ./swagger/ dash/Dash_swagger.json -o ./swagger/dash/typescript --modular --responses --extract-response-body --extract-response-error
48
+ $( call gen_ts, api,API)
49
+ $( call gen_ts, dash,Dash)
49
50
50
51
.PHONY : gen-ent
51
52
gen-ent : # # Generate ent code
@@ -109,7 +110,6 @@ clean: ## Clean build files
109
110
rm -rf ./api
110
111
rm -rf ./internal/pkg/database/ent
111
112
112
-
113
113
.PHONY : help
114
114
help : # # Show this help message
115
115
@echo " \n\033[1mSphere build tool.\033[0m Usage: make [target]\n"
0 commit comments