updated scripts to detect scala version and use appropriate library if possible

This commit is contained in:
Tony Tam
2013-10-18 14:46:03 -07:00
parent 044621b325
commit 5076d76a74
22 changed files with 93 additions and 148 deletions

View File

@@ -1,6 +1,7 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -24,11 +25,8 @@ cd $APP_DIR
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
ags="$@ SwaggerDocGenerator http://developer.wordnik.com/v4/resources.json"
if [ -f $APP_DIR/target/scala-2.9.1/swagger-codegen.jar ]; then
scala -cp target/scala-2.9.1/swagger-codegen.jar $ags
elif [[ -f $APP_DIR/target/scala-2.10/swagger-codegen.jar ]]; then
java -cp target/scala-2.10/swagger-codegen.jar $ags
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
./sbt "run-main $ags"
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi