2013-09-20 19:34:12 +00:00
|
|
|
#!/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
|
|
|
|
|
|
|
|
cd $APP_DIR
|
2014-06-16 19:59:53 +00:00
|
|
|
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
2013-09-20 19:34:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
|
2014-08-27 08:03:32 +00:00
|
|
|
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar ]; then
|
|
|
|
scala -cp $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
2013-09-20 19:34:12 +00:00
|
|
|
else
|
2013-10-18 21:46:03 +00:00
|
|
|
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
2013-09-20 19:34:12 +00:00
|
|
|
fi
|