-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (40 loc) · 1.46 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
all: bundler docs/build/openapi.yaml
redoc-cli bundle docs/build/openapi.yaml -t ./docs/html/index.hbs -o docs/index.html \
--options.item-types-instead-of-operations=true \
--options.root-param-name-as-group-header=true \
--options.hide-download-button=true \
--options.hide-response-samples=true \
--options.hide-path=true \
--options.flatten-response-view=true \
--options.crop-arm-prefixes=true \
--options.code-samples-instead-of-request-samples=true \
--options.theme.params.underlined-header.text-transform=none \
--options.theme.typography.links.color=#695de4 \
/
sp :=
sp += # add space
my-sort = $(shell echo $(subst $(sp),'\n',$2) | sort $1 --key=1,1 -)
define appendFilesWithTabs
for file in $(call my-sort,,$(1)); do \
while IFS= read -r line || [ -n "$$line" ]; do \
echo "$(2)$$line"; \
done < $$file; \
done >> $3
endef
docs/build/tokend_openapi_generated.yaml: ./*.x
bundle exec rake xdr:generate
docs/build/paths.yaml: ./docs/paths/*.yaml
echo "paths:" > $@
$(call appendFilesWithTabs, $^,"" "", $@)
docs/build/openapi.yaml: docs/index.yaml docs/build/paths.yaml docs/build/tokend_openapi_generated.yaml
echo "#This file has been generated automatically. DO NOT MODIFY!" > $@
for file in $^; do \
while IFS= read -r line; do \
echo "$$line"; \
done < $$file; \
done >> $@
clean:
rm -rf docs/build/*
bundler:
bundle install --path ./vendor
bundle update xdrgen