Skip to content

Commit a0bad87

Browse files
committed
Fix make %/Client.swift, due to *.yml will not change but datasources does
1 parent 88fd0ef commit a0bad87

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

Makefile

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@
66
OPENAPI_PATH := Submodule/github/rest-api-description/descriptions/api.github.com/api.github.com.yaml
77
.SECONDARY: $(%.yml)
88

9-
.PHONY: force
10-
force:
11-
12-
Submodule: force
13-
git submodule update --recursive --remote
14-
git add $@
15-
git commit -m "[Make] Pull $$(git submodule status Submodule/github/rest-api-description)" || true
16-
echo "::notice:: make $@"
9+
Submodule:
10+
@echo "::notice:: make $@"
1711

1812
TAG_NAMES := $(shell yq -r '.tags[].name' $(OPENAPI_PATH))
1913
SUBDIRS := $(addprefix Sources/, $(TAG_NAMES))
@@ -33,22 +27,31 @@ OPENAPI_CONFIG_FILES := $(addsuffix /openapi-generator-config.yml, $(SUBDIRS))
3327
echo "" >> $@; \
3428
echo "accessModifier: public" >> $@; \
3529
echo "" >> $@;
36-
# git add $@ # INTERMEDIATE file after *.swift
30+
@git add $@
31+
@echo "::debug:: make $@"
3732

38-
%/openapi.yml: %/openapi-generator-config.yml Submodule
39-
ln -sf ../../$(OPENAPI_PATH) $@
40-
# git add $@ # INTERMEDIATE file after *.swift
33+
%/openapi.yml: %/openapi-generator-config.yml
34+
@ln -sf ../../$(OPENAPI_PATH) $@
35+
@git add $@
36+
@echo "::debug:: make $@"
4137

4238
SWIFT_FILES := $(addsuffix /Client.swift, $(SUBDIRS))
43-
%/Client.swift: %/openapi.yml
39+
%/Client.swift: %/openapi.yml Submodule
4440
mint run apple/swift-openapi-generator generate $(@D)/openapi.yml \
4541
--config $(@D)/openapi-generator-config.yml \
4642
--output-directory $(@D)
47-
git add $(@D)
48-
git commit -m "[Make] Sync *.swift" || true
43+
@git add $(@D)
44+
@git commit -m "[Make] Sync *.swift" || true
45+
@echo "::debug:: make $@"
46+
47+
check-submodule: Submodule
48+
git submodule update --recursive --remote
49+
@git add $@
50+
@git commit -m "[Make]$$(git submodule status Submodule/github/rest-api-description)" && touch $^ || true
51+
@echo "::notice:: make $@"
4952

50-
install: $(SWIFT_FILES)
51-
echo "::notice:: make $@"
53+
install: check-submodule $(SWIFT_FILES)
54+
@echo "::notice:: make $@"
5255

5356
#XCFrameworks:
5457
# mint run giginet/Scipio create . \

0 commit comments

Comments
 (0)