mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 02:47:05 +00:00
Make the launcher scripts use the assembly generated jar
This commit is contained in:
@@ -1,6 +1,34 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
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.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
java -cp $CLASSPATH $JAVA_OPTS "$@" SwaggerDocGenerator http://developer.wordnik.com/v4/resources.json ""
|
||||
ags="$@ SwaggerDocGenerator http://developer.wordnik.com/v4/resources.json"
|
||||
|
||||
if [ -f $APP_DIR/target/swagger-codegen.jar ]; then
|
||||
java -cp target/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
|
||||
else
|
||||
./sbt "run-main $ags"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user