-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
53 lines (53 loc) · 2.07 KB
/
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
46
47
48
49
50
51
52
53
run:
make lint
make bundle
make ruby
make go
make typescript
make python
make java
make php
make cli
@echo Client libraries generated, check clients directory.
lint:
npx swagger-cli validate main.yaml
make bundle
bash ./lint.sh
bundle:
npx swagger-cli bundle -t json -w 300 main.yaml > doc/compiled.json
npx swagger-cli bundle -t yaml -w 300 main.yaml > tmp/compiled.yaml
watch_bundle:
make lint
npx swagger-cli bundle -t json -w 300 main.yaml > doc/compiled.json
watch_scss:
npx sass --watch ./doc/main.scss:./doc/main.css ./doc/rapidoc.scss:./doc/rapidoc.css
watch_ts:
npx tsc --watch ./doc/main.ts --outFile ./doc/main.js
serve:
npx http-server doc -c-1 -p 8080
docs: lint bundle
npx sass -s compressed ./doc/main.scss:./doc/main.css ./doc/rapidoc.scss:./doc/rapidoc.css
npx tsc ./doc/main.ts --outFile ./doc/main.js
npx terser ./doc/main.js --compress --mangle -o ./doc/main.js
ruby:
openapi-generator-cli generate -i tmp/compiled.yaml -g ruby -o clients/ruby -c ./openapi-generator/ruby_lang.yaml
go:
openapi-generator-cli generate -i tmp/compiled.yaml -g go -o clients/go -c ./openapi-generator/go_lang.yaml --global-property apiTests=false,modelTests=false
go install golang.org/x/tools/cmd/goimports@v0.24.0
goimports -w clients/go
cd clients/go && go mod tidy
typescript:
openapi-generator-cli generate -i tmp/compiled.yaml -g typescript-fetch -o clients/typescript -c ./openapi-generator/typescript_lang.yaml
python:
openapi-generator-cli generate -i tmp/compiled.yaml -g python -o clients/python -c ./openapi-generator/python_lang.yaml
java:
openapi-generator-cli generate -i tmp/compiled.yaml -g java -o clients/java -c ./openapi-generator/java_lang.yaml
php:
openapi-generator-cli generate -i tmp/compiled.yaml -g php -o clients/php -c ./openapi-generator/php_lang.yaml
cli:
openapi-generator-cli generate -i tmp/compiled.yaml -g go -o tmp/cli -c ./openapi-generator/cli_lang.yaml -e handlebars
cp tmp/cli/api_* clients/cli/cmd/
cp tmp/cli/README.md clients/cli/
go install golang.org/x/tools/cmd/goimports@v0.24.0
goimports -w clients/cli
cd clients/cli && go mod tidy