Skip to content

Commit 0f38acd

Browse files
committed
Use git clone & swift build swift-openapi-generator
1 parent e93d6dc commit 0f38acd

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@ commit:
2020
&& echo "::notice::git commit $(file)" \
2121
|| true;
2222

23-
.PHONY: swift-openapi-generator
24-
swift-openapi-generator:
23+
SWIFT_BUILD_FLAGS = -c release --arch arm64 --arch x86_64
24+
EXECUTABLE_NAME = swift-openapi-generator
25+
EXECUTABLE_PATH = $(shell swift build $(SWIFT_BUILD_FLAGS) --show-bin-path)/$(EXECUTABLE_NAME)
26+
.NOTPARALLEL: .build/bin/swift-openapi-generator
27+
.build/bin/swift-openapi-generator:
2528
@echo "::debug::make: $@"
26-
mise use spm:apple/swift-openapi-generator
29+
git clone --branch 1.11.0 --single-branch \
30+
https://github.com/apple/swift-openapi-generator
31+
cd swift-openapi-generator; swift build $(SWIFT_BUILD_FLAGS);
32+
mkdir -p $(@D);
33+
cp -f $(EXECUTABLE_PATH) $@; \
34+
rm -rf swift-openapi-generator;
2735

2836
## Generate Sources
2937

@@ -48,9 +56,9 @@ endif
4856
$(OPENAPI_PATH): Submodule
4957
@touch "$@"
5058

51-
%/Client.swift %/Types.swift: $(OPENAPI_PATH) %/openapi-generator-config.yml
59+
%/Client.swift %/Types.swift: $(OPENAPI_PATH) %/openapi-generator-config.yml .build/bin/swift-openapi-generator
5260
@echo "::debug::make: $@"
53-
swift-openapi-generator generate \
61+
.build/bin/swift-openapi-generator generate \
5462
"$(OPENAPI_PATH)" \
5563
--config "$(@D)/openapi-generator-config.yml" \
5664
--output-directory "$(@D)";

mise.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tools]
22
# swift = "6"
3-
"spm:apple/swift-openapi-generator" = "latest"
3+
# "spm:apple/swift-openapi-generator" = "latest"
44

55
[settings]
6-
experimental = true
6+
# experimental = true

0 commit comments

Comments
 (0)