77# Special-Targets #
88# https://www.gnu.org/software/make/manual/html_node/Special-Targets.html
99.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 )
1215
1316% /openapi.yml : $(OPENAPI_PATH )
1417 @mkdir -p " $( @D) "
1518 @ln -sf ../../$(OPENAPI_PATH ) $@
1619 @git add $@
1720 @echo " ::debug:: make $@ "
1821
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 ) )
2222% /openapi-generator-config.yml : $(OPENAPI_PATH )
2323 @mkdir -p " $( @D) "
2424 @tag_name=$(shell basename $(shell dirname $@ ) ) ; \
@@ -35,24 +35,24 @@ OPENAPI_CONFIG_FILES := $(addsuffix /openapi-generator-config.yml, $(SUBDIRS))
3535 @git add $@
3636 @echo " ::debug:: make $@ "
3737
38- SWIFT_FILES := $(addsuffix /Client.swift, $(SUBDIRS ) )
3938% /Client.swift : % /openapi.yml % /openapi-generator-config.yml
4039 mint run apple/swift-openapi-generator generate $(@D ) /openapi.yml \
4140 --config $(@D ) /openapi-generator-config.yml \
4241 --output-directory $(@D )
4342 @git add $(@D )
44- @git commit -m " [Make] Sync *.swift" > /dev/null \
43+ @git commit -m " [Make] Generate $( @D ) / *.swift" > /dev/null \
4544 && echo " ::notice:: make $@ " \
4645 || true
4746
4847.PHONY : install-$(OPENAPI_PATH )
4948install-$(OPENAPI_PATH ) :
5049ifdef GITHUB_ACTIONS ## https ://docs.github.com/en/actions/learn-github-actions/variables
50+ @touch $(OPENAPI_PATH )
5151 @echo " ::notice:: make $@ "
5252else
5353 git submodule update --recursive --remote
5454 @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 \
5656 && touch $(OPENAPI_PATH) \
5757 && echo "::notice:: make $@" \
5858 || true
@@ -61,22 +61,22 @@ endif
6161install : install-$(OPENAPI_PATH ) $(SWIFT_FILES )
6262 @echo " ::notice:: make $@ "
6363
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');
8080# @git commit -m "[Make] Modify xcframework zips" || true
8181# @echo "::notice:: make $@"
8282
@@ -87,12 +87,12 @@ update-to-date:
8787 touch Sources/** /openapi.yml
8888 touch Sources/** /Client.swift
8989
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
9696
9797.PHONY : help
9898.SILENT : help
0 commit comments