aboutsummaryrefslogtreecommitdiff
path: root/apiclient
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-10-04 19:03:39 -0400
committerJoshua M. Boniface <joshua@boniface.me>2020-10-04 19:03:39 -0400
commitfc28ffea53861ea7e8c35d71dcf863e4900f4d8f (patch)
treeb70c6728f6a72905a23046ec4d67c8b0f062cc98 /apiclient
parentd11adeb85ee82c3699f5a3a2e4f660623a19df78 (diff)
Improve handling of apiclient generator
1. Replace the separate stable/unstable scripts with a single script and handle the difference with argument parsing. 2. Unify the calls and pass the Azure arguments in on the CLI.
Diffstat (limited to 'apiclient')
-rw-r--r--apiclient/templates/typescript/axios/generate.sh19
-rw-r--r--apiclient/templates/typescript/axios/stable.sh9
-rw-r--r--apiclient/templates/typescript/axios/unstable.sh9
3 files changed, 19 insertions, 18 deletions
diff --git a/apiclient/templates/typescript/axios/generate.sh b/apiclient/templates/typescript/axios/generate.sh
new file mode 100644
index 0000000000..c514b10d5b
--- /dev/null
+++ b/apiclient/templates/typescript/axios/generate.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+artifactsDirectory="${1}"
+buildNumber="${2}"
+if [[ -n ${buildNumber} ]]; then
+ # Unstable build
+ additionalProperties=",snapshotVersion=\"-SNAPSHOT.${buildNumber}\",npmRepository=\"https://pkgs.dev.azure.com/jellyfin-project/jellyfin/_packaging/unstable/npm/registry/\""
+else
+ # Stable build
+ additionalProperties=""
+fi
+
+java -jar openapi-generator-cli.jar generate \
+ --input-spec ${artifactsDirectory}/openapispec/openapi.json \
+ --generator-name typescript-axios \
+ --output ./apiclient/generated/typescript/axios \
+ --template-dir ./apiclient/templates/typescript/axios \
+ --ignore-file-override ./apiclient/.openapi-generator-ignore \
+ --additional-properties=useSingleRequestParameter="true",withSeparateModelsAndApi="true",npmName="axios"${additionalProperties}
diff --git a/apiclient/templates/typescript/axios/stable.sh b/apiclient/templates/typescript/axios/stable.sh
deleted file mode 100644
index 118ef219fe..0000000000
--- a/apiclient/templates/typescript/axios/stable.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-java -jar openapi-generator-cli.jar generate \
- --input-spec $(System.ArtifactsDirectory)/openapispec/openapi.json \
- --generator-name typescript-axios \
- --output ./apiclient/generated/typescript/axios \
- --template-dir ./apiclient/templates/typescript/axios \
- --ignore-file-override ./apiclient/.openapi-generator-ignore \
- --additional-properties=useSingleRequestParameter="true",withSeparateModelsAndApi="true",npmName="axios"
diff --git a/apiclient/templates/typescript/axios/unstable.sh b/apiclient/templates/typescript/axios/unstable.sh
deleted file mode 100644
index be9f9be438..0000000000
--- a/apiclient/templates/typescript/axios/unstable.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-java -jar openapi-generator-cli.jar generate \
- --input-spec $(System.ArtifactsDirectory)/openapispec/openapi.json \
- --generator-name typescript-axios \
- --output ./apiclient/generated/typescript/axios \
- --template-dir ./apiclient/templates/typescript/axios \
- --ignore-file-override ./apiclient/.openapi-generator-ignore \
- --additional-properties=useSingleRequestParameter="true",withSeparateModelsAndApi="true",npmName="axios",snapshotVersion="-SNAPSHOT.$(Build.BuildNumber)",npmRepository="https://pkgs.dev.azure.com/jellyfin-project/jellyfin/_packaging/unstable/npm/registry/"