forked from MacPaw/OpenAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
16 lines (15 loc) · 872 Bytes
/
Copy pathMakefile
File metadata and controls
16 lines (15 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Requires a local fork of swift-openapi-generator to be checked out as a
# sibling directory named `swift-openapi-generator` (i.e. ../swift-openapi-generator).
# See https://github.com/apple/swift-openapi-generator for the upstream repo.
GENERATOR_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/../swift-openapi-generator
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
TYPES_SWIFT := $(GENERATOR_DIR)/Types.swift
COMPONENTS_SWIFT := $(PROJECT_DIR)/Sources/OpenAI/Public/Schemas/Generated/Components.swift
.PHONY: generate
generate:
cd "$(GENERATOR_DIR)" && swift run swift-openapi-generator generate \
--config "$(PROJECT_DIR)/openapi-generator-config.yaml" \
"$(PROJECT_DIR)/openapi.with-code-samples.yml"
python3 "$(PROJECT_DIR)/Scripts/extract_components.py" \
"$(TYPES_SWIFT)" \
"$(COMPONENTS_SWIFT)"