7
7
# Special-Targets #
8
8
# https://www.gnu.org/software/make/manual/html_node/Special-Targets.html
9
9
.DEFAULT_GOAL := install
10
- OPENAPI_PATH := Submodule/github/rest-api-description/descriptions/api.github.com/api.github.com.yaml
11
- .SECONDARY : $(%.yml )
10
+ OPENAPI_PATH := Submodule/github/rest-api-description/descriptions/api.github.com/api.github.com.yaml
11
+ TAG_NAMES := $(shell yq -r '.tags[].name' $(OPENAPI_PATH ) )
12
+ SUBDIRS := $(addprefix Sources/, $(TAG_NAMES ) )
13
+ SWIFT_FILES := $(addsuffix /Client.swift, $(SUBDIRS ) )
14
+ .SECONDARY : $(%.yml )
12
15
13
16
% /openapi.yml : $(OPENAPI_PATH )
14
17
@mkdir -p " $( @D) "
15
18
@ln -sf ../../$(OPENAPI_PATH ) $@
16
19
@git add $@
17
20
@echo " ::debug:: make $@ "
18
21
19
- TAG_NAMES := $(shell yq -r '.tags[].name' $(OPENAPI_PATH ) )
20
- SUBDIRS := $(addprefix Sources/, $(TAG_NAMES ) )
21
- OPENAPI_CONFIG_FILES := $(addsuffix /openapi-generator-config.yml, $(SUBDIRS ) )
22
22
% /openapi-generator-config.yml : $(OPENAPI_PATH )
23
23
@mkdir -p " $( @D) "
24
24
@tag_name=$(shell basename $(shell dirname $@ ) ) ; \
@@ -35,24 +35,24 @@ OPENAPI_CONFIG_FILES := $(addsuffix /openapi-generator-config.yml, $(SUBDIRS))
35
35
@git add $@
36
36
@echo " ::debug:: make $@ "
37
37
38
- SWIFT_FILES := $(addsuffix /Client.swift, $(SUBDIRS ) )
39
38
% /Client.swift : % /openapi.yml % /openapi-generator-config.yml
40
39
mint run apple/swift-openapi-generator generate $(@D ) /openapi.yml \
41
40
--config $(@D ) /openapi-generator-config.yml \
42
41
--output-directory $(@D )
43
42
@git add $(@D )
44
- @git commit -m " [Make] Sync *.swift" > /dev/null \
43
+ @git commit -m " [Make] Generate $( @D ) / *.swift" > /dev/null \
45
44
&& echo " ::notice:: make $@ " \
46
45
|| true
47
46
48
47
.PHONY : install-$(OPENAPI_PATH )
49
48
install-$(OPENAPI_PATH ) :
50
49
ifdef GITHUB_ACTIONS ## https ://docs.github.com/en/actions/learn-github-actions/variables
50
+ @touch $(OPENAPI_PATH )
51
51
@echo " ::notice:: make $@ "
52
52
else
53
53
git submodule update --recursive --remote
54
54
@git add Submodule
55
- @git commit -m "[Make]$$(git submodule status Submodule/github/rest-api-description)" >/dev/null \
55
+ @git commit -m "[Make] Bump $$(git submodule status Submodule/github/rest-api-description)" >/dev/null \
56
56
&& touch $(OPENAPI_PATH) \
57
57
&& echo "::notice:: make $@" \
58
58
|| true
@@ -61,22 +61,22 @@ endif
61
61
install : install-$(OPENAPI_PATH ) $(SWIFT_FILES )
62
62
@echo " ::notice:: make $@ "
63
63
64
- XCFrameworks :
65
- mint run giginet/Scipio create . \
66
- --static \
67
- --embed-debug-symbols \
68
- --support-simulators
69
- @touch $@
70
- @echo " ::notice:: make $@ "
71
-
72
- % .zip : % .xcframework
73
- @zip -qr " $@ " " $<"
74
- @rm -rf " $<"
75
- @git add " $@ "
76
- @echo " ::debug:: make $@ "
77
-
78
- install-zips : XCFrameworks
79
- @$(MAKE ) $(shell echo XCFrameworks/* .xcframework | sed 's/\.xcframework/\.zip/g') ;
64
+ # XCFrameworks:
65
+ # mint run giginet/Scipio create . \
66
+ # --static \
67
+ # --embed-debug-symbols \
68
+ # --support-simulators
69
+ # @touch $@
70
+ # @echo "::notice:: make $@"
71
+ #
72
+ # %.zip: %.xcframework
73
+ # @zip -qr "$@" "$<"
74
+ # @rm -rf "$<"
75
+ # @git add "$@"
76
+ # @echo "::debug:: make $@"
77
+ #
78
+ # install-zips: XCFrameworks
79
+ # @$(MAKE) $(shell echo XCFrameworks/*.xcframework | sed 's/\.xcframework/\.zip/g');
80
80
# @git commit -m "[Make] Modify xcframework zips" || true
81
81
# @echo "::notice:: make $@"
82
82
@@ -87,12 +87,12 @@ update-to-date:
87
87
touch Sources/** /openapi.yml
88
88
touch Sources/** /Client.swift
89
89
90
- docs : # # Need env GITHUB_PAGES is created as 'true'
91
- swift package --allow-writing-to-directory $@ generate-documentation \
92
- --disable-indexing \
93
- --transform-for-static-hosting \
94
- --hosting-base-path github-rest-api-swift-openapi;
95
- sh Script/setupDocsHtml.sh
90
+ # docs: ## Need env GITHUB_PAGES is created as 'true'
91
+ # swift package --allow-writing-to-directory $@ generate-documentation \
92
+ # --disable-indexing \
93
+ # --transform-for-static-hosting \
94
+ # --hosting-base-path github-rest-api-swift-openapi;
95
+ # sh Script/setupDocsHtml.sh
96
96
97
97
.PHONY : help
98
98
.SILENT : help
0 commit comments