Skip to content

Commit cf95d4e

Browse files
committed
added android sample
1 parent b503994 commit cf95d4e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

bin/android-java-wordnik-api.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
5+
6+
while [ -h "$SCRIPT" ] ; do
7+
ls=`ls -ld "$SCRIPT"`
8+
link=`expr "$ls" : '.*-> \(.*\)$'`
9+
if expr "$link" : '/.*' > /dev/null; then
10+
SCRIPT="$link"
11+
else
12+
SCRIPT=`dirname "$SCRIPT"`/"$link"
13+
fi
14+
done
15+
16+
if [ ! -d "${APP_DIR}" ]; then
17+
APP_DIR=`dirname "$SCRIPT"`/..
18+
APP_DIR=`cd "${APP_DIR}"; pwd`
19+
fi
20+
21+
cd $APP_DIR
22+
23+
24+
# if you've executed sbt assembly previously it will use that instead.
25+
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
26+
ags="$@ samples/client/petstore/android-java/AndroidJavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
27+
28+
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
29+
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
30+
else
31+
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
32+
fi

0 commit comments

Comments
 (0)