Skip to content

Commit

Permalink
fixes swagger-api#52: running the validator now uses the sbt-assembly…
Browse files Browse the repository at this point in the history
… generated jar
  • Loading branch information
casualjim committed May 10, 2013
1 parent d30441d commit dfdd8ca
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions bin/validate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#!/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


# if you've executed sbt assembly previously it will use that instead.
ags="com.wordnik.swagger.codegen.spec.Validator $@"

if [ -f $APP_DIR/target/swagger-codegen.jar ]; then
java -cp target/swagger-codegen.jar $ags
else
./sbt "run-main $ags"
fi

export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH com.wordnik.swagger.codegen.spec.Validator "$@"

0 comments on commit dfdd8ca

Please sign in to comment.