mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 02:57:04 +00:00
updated scripts to detect scala version and use appropriate library if possible
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user