From 0c3fc84f52d76c349cba178717d02fb1c0dfb1b1 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 8 Feb 2018 15:14:49 +0800 Subject: [PATCH] minor enhancemnt to swift3 bin scripts --- bin/swift3-petstore-all.sh | 42 ++++----------------------- bin/swift3-petstore-objcCompatible.sh | 2 +- 2 files changed, 6 insertions(+), 38 deletions(-) diff --git a/bin/swift3-petstore-all.sh b/bin/swift3-petstore-all.sh index a27fe261859..eeaf29df012 100755 --- a/bin/swift3-petstore-all.sh +++ b/bin/swift3-petstore-all.sh @@ -1,48 +1,16 @@ #!/bin/sh -SCRIPT="$0" - -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/swagger-codegen-cli/target/swagger-codegen-cli.jar" - -if [ ! -f "$executable" ] -then - mvn 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 -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore.json -o samples/client/petstore/swift3/default" - echo "#### Petstore Swift API client (default) ####" -java $JAVA_OPTS -jar $executable $ags +./bin/swift3-petstore.sh -ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-promisekit.json -o samples/client/petstore/swift3/promisekit" echo "#### Petstore Swift API client (promisekit) ####" -java $JAVA_OPTS -jar $executable $ags +./bin/swift3-petstore-promisekit.sh -ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-rxswift.json -o samples/client/petstore/swift3/rxswift" echo "#### Petstore Swift API client (rxswift) ####" -java $JAVA_OPTS -jar $executable $ags +./bin/swift3-petstore-rxswift.sh -ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-unwraprequired.json -o samples/client/petstore/swift3/unwraprequired" echo "#### Petstore Swift API client (unwraprequired) ####" -java $JAVA_OPTS -jar $executable $ags +./bin/swift3-petstore-unwraprequired.sh -ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-objcCompatible.json -o samples/client/petstore/swift3/objcCompatible" echo "#### Petstore Swift API client (objcCompatible) ####" -java $JAVA_OPTS -jar $executable $ags +./bin/swift3-petstore-objcCompatible.sh diff --git a/bin/swift3-petstore-objcCompatible.sh b/bin/swift3-petstore-objcCompatible.sh index bbc88b1dc3f..620ffd6fd73 100755 --- a/bin/swift3-petstore-objcCompatible.sh +++ b/bin/swift3-petstore-objcCompatible.sh @@ -26,6 +26,6 @@ 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 -v -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-objcCompatible.json -o samples/client/petstore/swift3/objcCompatible $@" +ags="generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-objcCompatible.json -o samples/client/petstore/swift3/objcCompatible $@" java $JAVA_OPTS -jar $executable $ags