diff --git a/bin/all-petstore.sh b/bin/all-petstore.sh index 716db5bae15..7564d9cfdb6 100755 --- a/bin/all-petstore.sh +++ b/bin/all-petstore.sh @@ -18,20 +18,13 @@ if [ ! -d "${APP_DIR}" ]; then fi cd $APP_DIR -./bin/java-wordnik-api.sh -./bin/php-wordnik-api.sh -./bin/python3-wordnik-api.sh -./bin/objc-wordnik-api.sh -./bin/python-wordnik-api.sh -./bin/scala-wordnik-api.sh - ./bin/android-java-petstore.sh -./bin/csharp-petstore.sh -./bin/flash-petstore.sh +./bin/android-java-wordnik-api.sh +./bin/dynamic-html.sh +./bin/html.sh +./bin/java-petstore-filemap.sh ./bin/java-petstore.sh +./bin/java-wordnik-api.sh ./bin/objc-petstore.sh -./bin/php-petstore.sh -./bin/python-petstore.sh -./bin/python3-petstore.sh -./bin/ruby-petstore.sh -./bin/scala-petstore.sh +./bin/objc-wordnik-api.sh +./bin/tizen-petstore.sh diff --git a/bin/android-java-petstore.sh b/bin/android-java-petstore.sh index 312953e7d81..5747ff49531 100755 --- a/bin/android-java-petstore.sh +++ b/bin/android-java-petstore.sh @@ -17,11 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/petstore.json -l android -o samples/client/petstore/android-java" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l android -o samples/client/petstore/android-java" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/android-java-wordnik-api.sh b/bin/android-java-wordnik-api.sh index aba96fb9096..3f2654a1685 100755 --- a/bin/android-java-wordnik-api.sh +++ b/bin/android-java-wordnik-api.sh @@ -1,7 +1,6 @@ #!/bin/sh SCRIPT="$0" -SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala) while [ -h "$SCRIPT" ] ; do ls=`ls -ld "$SCRIPT"` @@ -18,15 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ samples/client/petstore/android-java/AndroidJavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l android -o samples/client/wordnik/android-java" -if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar ]; then - scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags -else - echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly" -fi +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/dynamic-html.sh b/bin/dynamic-html.sh index 192cb6f0159..45dcedd5f69 100755 --- a/bin/dynamic-html.sh +++ b/bin/dynamic-html.sh @@ -17,11 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ com.wordnik.swagger.codegen.Codegen -i http://petstore.swagger.wordnik.com/v2/swagger.json -l dynamic-html -o samples/swagger-dynamic-html" +ags="$@ -i http://petstore.swagger.wordnik.com/v2/swagger.json -l dynamic-html -o samples/swagger-dynamic-html" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/html.sh b/bin/html.sh index d50a5cc7cf0..95c5e01411a 100755 --- a/bin/html.sh +++ b/bin/html.sh @@ -17,11 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ com.wordnik.swagger.codegen.Codegen -i http://petstore.swagger.wordnik.com/v2/swagger.json -l html -o samples/swagger-html" +ags="$@ -i http://petstore.swagger.wordnik.com/v2/swagger.json -l html -o samples/swagger-html" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-filemap.sh b/bin/java-petstore-filemap.sh index fbe0f86c210..04345b346ab 100755 --- a/bin/java-petstore-filemap.sh +++ b/bin/java-petstore-filemap.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/petstore.json -l java -o samples/client/petstore/java" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l java -o samples/client/petstore/java" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore.sh b/bin/java-petstore.sh index 8996c23faea..a3f15898492 100755 --- a/bin/java-petstore.sh +++ b/bin/java-petstore.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ com.wordnik.swagger.codegen.Codegen -i http://petstore.swagger.wordnik.com/v2/swagger.json -l java -o samples/client/petstore/java" +ags="$@ -i http://petstore.swagger.wordnik.com/v2/swagger.json -l java -o samples/client/petstore/java" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-wordnik-api.sh b/bin/java-wordnik-api.sh index c1888f07fb0..b4cae8590bc 100755 --- a/bin/java-wordnik-api.sh +++ b/bin/java-wordnik-api.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/wordnik.json -l java" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l java -o samples/client/wordnik/java" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/objc-petstore.sh b/bin/objc-petstore.sh index 199ef4fb7ad..d01aebcff67 100755 --- a/bin/objc-petstore.sh +++ b/bin/objc-petstore.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/petstore.json -l objc -o samples/client/petstore/objc -t src/main/resources/objc" +ags="$@ -i modules/swagger-codegen/src/test/resources/petstore.json -l objc -o samples/client/petstore/objc -t src/main/resources/objc" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/objc-wordnik-api.sh b/bin/objc-wordnik-api.sh index cde5fb50fc2..68eb1b8226d 100755 --- a/bin/objc-wordnik-api.sh +++ b/bin/objc-wordnik-api.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/wordnik.json -l objc" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l objc -o samples/client/wordnik/objc" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/tizen-petstore.sh b/bin/tizen-petstore.sh index 6026e0ca7b1..97ba32ae721 100755 --- a/bin/tizen-petstore.sh +++ b/bin/tizen-petstore.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.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="$@ com.wordnik.swagger.codegen.Codegen -i http://petstore.swagger.wordnik.com/v2/swagger.json -l tizen -o samples/client/petstore/tizen" +ags="$@ -i http://petstore.swagger.wordnik.com/v2/swagger.json -l tizen -o samples/client/petstore/tizen" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags