-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (37 loc) · 942 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
37
38
39
40
41
42
43
44
45
default: generate dependency
# Removes currently generated client files
cleanup:
@echo "Removing current client files"
rm -rf client/*
# Validating Swagger spec
#
# https://openapi-generator.tech/docs/usage/#validate
validate:
@echo "Validating Swagger spec"
openapi-generator validate -i swagger.yaml
# Generating API client
#
# https://openapi-generator.tech/docs/generators/go
generate: cleanup validate
@echo "Generating API client"
openapi-generator generate \
-i swagger.yaml \
-g go \
-o client \
--package-name client \
--global-property skipFormModel=false \
-p enumClassPrefix=true
@echo "Removing generated dependencies file"
rm -rf client/go.*
# Adding new dependencies
dependency:
@echo "Adding new dependencies"
go mod tidy
go mod vendor
build:
@echo "Building Go module"
go build ./...
test:
@echo "Testing Go module"
go test ./...
.PHONY: all cleanup validate generate dependency build test