-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
93 lines (80 loc) · 2.75 KB
/
makefile
File metadata and controls
93 lines (80 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Makefile
# Variables (adjust these as needed)
OPENAPI_YAML = ari-openapi.yaml
GENERATOR_CLI = openapi-generator-cli.jar
GENERATOR_CLI_URL = https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.11.0/openapi-generator-cli-7.11.0.jar
# Names for the generated packages
ASYNC_PACKAGE = ari_async_sdk
SYNC_PACKAGE = ari_sync_sdk
PYDANTIC_SYNC_PACKAGE = ari_sync_sdk
PYDANTIC_ASYNC_PACKAGE = ari_async_sdk
# Output directories
ASYNC_OUTPUT = ./output/ari-async
SYNC_OUTPUT = ./output/ari-sync
PYDANTIC_SYNC_OUTPUT = ./output/ari-pydantic-sync
PYDANTIC_ASYNC_OUTPUT = ./output/ari-pydantic-async
.PHONY: all async sync pydantic clean
# Rule to download the generator CLI jar only if it is not present
$(GENERATOR_CLI):
wget $(GENERATOR_CLI_URL) -O $(GENERATOR_CLI)
all: async sync pydantic-sync pydantic-async
async: $(GENERATOR_CLI)
@echo "Generating asynchronous Python SDK with type hints (client only)..."
java -jar $(GENERATOR_CLI) generate \
-i $(OPENAPI_YAML) \
-g python-aiohttp \
--package-name $(ASYNC_PACKAGE) \
--additional-properties=\
projectName=$(ASYNC_PACKAGE),\
packageName=$(ASYNC_PACKAGE),\
async=true,\
withTypeHints=true,\
server=false \
-o $(ASYNC_OUTPUT)
@echo "Async SDK generated in $(ASYNC_OUTPUT)"
sync: $(GENERATOR_CLI)
@echo "Generating synchronous Python SDK with type hints (client only)..."
java -jar $(GENERATOR_CLI) generate \
-i $(OPENAPI_YAML) \
-g python \
--package-name $(SYNC_PACKAGE) \
--additional-properties=\
projectName=$(SYNC_PACKAGE),\
packageName=$(SYNC_PACKAGE),\
async=false,\
withTypeHints=true,\
server=false \
-o $(SYNC_OUTPUT)
@echo "Sync SDK generated in $(SYNC_OUTPUT)"
pydantic-sync: $(GENERATOR_CLI)
@echo "Generating synchronous Python SDK with type hints (client only)..."
java -jar $(GENERATOR_CLI) generate \
-i $(OPENAPI_YAML) \
-g python-pydantic-v1 \
--package-name $(PYDANTIC_SYNC_PACKAGE) \
--additional-properties=\
projectName=$(PYDANTIC_SYNC_PACKAGE),\
packageName=$(PYDANTIC_SYNC_PACKAGE),\
library=urllib3,\
withTypeHints=true,\
server=false \
-o $(PYDANTIC_SYNC_OUTPUT)
@echo "Sync SDK generated in $(PYDANTIC_SYNC_OUTPUT)"
pydantic-async: $(GENERATOR_CLI)
@echo "Generating synchronous Python SDK with type hints (client only)..."
java -jar $(GENERATOR_CLI) generate \
-i $(OPENAPI_YAML) \
-g python-pydantic-v1 \
--package-name $(PYDANTIC_ASYNC_PACKAGE) \
--additional-properties=\
library=asyncio,\
projectName=$(PYDANTIC_ASYNC_PACKAGE),\
packageName=$(PYDANTIC_ASYNC_PACKAGE),\
withTypeHints=true,\
server=false \
-o $(PYDANTIC_ASYNC_OUTPUT)
@echo "Sync SDK generated in $(PYDANTIC_ASYNC_OUTPUT)"
clean:
@echo "Cleaning generated SDKs"
rm -rf output/*
# rm -rf $(GENERATOR_CLI)