From b9287cbbf505d16789d37fbe9c12525188bd3c7c Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Fri, 11 Jan 2019 10:25:33 +0100 Subject: [PATCH] add bash scripts to generate samples --- bin/typescript-rxjs-petstore-all.sh | 6 ++++ bin/typescript-rxjs-petstore-interfaces.sh | 32 +++++++++++++++++++ bin/typescript-rxjs-petstore-target-es6.json | 7 ++++ bin/typescript-rxjs-petstore-target-es6.sh | 32 +++++++++++++++++++ ...script-rxjs-petstore-with-npm-version.json | 6 ++++ ...pescript-rxjs-petstore-with-npm-version.sh | 32 +++++++++++++++++++ bin/typescript-rxjs-petstore.sh | 32 +++++++++++++++++++ 7 files changed, 147 insertions(+) create mode 100755 bin/typescript-rxjs-petstore-all.sh create mode 100755 bin/typescript-rxjs-petstore-interfaces.sh create mode 100644 bin/typescript-rxjs-petstore-target-es6.json create mode 100755 bin/typescript-rxjs-petstore-target-es6.sh create mode 100644 bin/typescript-rxjs-petstore-with-npm-version.json create mode 100755 bin/typescript-rxjs-petstore-with-npm-version.sh create mode 100755 bin/typescript-rxjs-petstore.sh diff --git a/bin/typescript-rxjs-petstore-all.sh b/bin/typescript-rxjs-petstore-all.sh new file mode 100755 index 000000000000..2391a66637bd --- /dev/null +++ b/bin/typescript-rxjs-petstore-all.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +./bin/typescript-rxjs-petstore-target-es6.sh +./bin/typescript-rxjs-petstore-with-npm-version.sh +./bin/typescript-rxjs-petstore-interfaces.sh +./bin/typescript-rxjs-petstore.sh diff --git a/bin/typescript-rxjs-petstore-interfaces.sh b/bin/typescript-rxjs-petstore-interfaces.sh new file mode 100755 index 000000000000..992073ba4e20 --- /dev/null +++ b/bin/typescript-rxjs-petstore-interfaces.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -o samples/client/petstore/typescript-rxjs/builds/with-interfaces -D withInterfaces=true $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-rxjs-petstore-target-es6.json b/bin/typescript-rxjs-petstore-target-es6.json new file mode 100644 index 000000000000..319144440c10 --- /dev/null +++ b/bin/typescript-rxjs-petstore-target-es6.json @@ -0,0 +1,7 @@ +{ + "npmName": "@swagger/typescript-rxjs-petstore", + "npmVersion": "1.0.0", + "npmRepository" : "https://skimdb.npmjs.com/registry", + "snapshot" : false, + "supportsES6": true +} diff --git a/bin/typescript-rxjs-petstore-target-es6.sh b/bin/typescript-rxjs-petstore-target-es6.sh new file mode 100755 index 000000000000..57d1ec974007 --- /dev/null +++ b/bin/typescript-rxjs-petstore-target-es6.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -c bin/typescript-rxjs-petstore-target-es6.json -o samples/client/petstore/typescript-rxjs/builds/es6-target $@" + +java $JAVA_OPTS -jar $executable $ags \ No newline at end of file diff --git a/bin/typescript-rxjs-petstore-with-npm-version.json b/bin/typescript-rxjs-petstore-with-npm-version.json new file mode 100644 index 000000000000..c24b48f4f4f3 --- /dev/null +++ b/bin/typescript-rxjs-petstore-with-npm-version.json @@ -0,0 +1,6 @@ +{ + "npmName": "@swagger/typescript-rxjs-petstore", + "npmVersion": "1.0.0", + "npmRepository" : "https://skimdb.npmjs.com/registry", + "snapshot" : false +} diff --git a/bin/typescript-rxjs-petstore-with-npm-version.sh b/bin/typescript-rxjs-petstore-with-npm-version.sh new file mode 100755 index 000000000000..afc827ed7ae6 --- /dev/null +++ b/bin/typescript-rxjs-petstore-with-npm-version.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -c bin/typescript-rxjs-petstore-with-npm-version.json -o samples/client/petstore/typescript-rxjs/builds/with-npm-version $@" + +java $JAVA_OPTS -jar $executable $ags \ No newline at end of file diff --git a/bin/typescript-rxjs-petstore.sh b/bin/typescript-rxjs-petstore.sh new file mode 100755 index 000000000000..0987a533903b --- /dev/null +++ b/bin/typescript-rxjs-petstore.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -o samples/client/petstore/typescript-rxjs/builds/default $@" + +java $JAVA_OPTS -jar $executable $ags \ No newline at end of file