-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathva-scala
More file actions
executable file
·58 lines (52 loc) · 1.74 KB
/
Copy pathva-scala
File metadata and controls
executable file
·58 lines (52 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
if [ "$VALIUM_PATH" == "" ]
then
VALIUM_PATH="`dirname \"$0\"`" # relative
VALIUM_PATH="`( cd \"$VALIUM_PATH\" && pwd )`" # absolutized and normalized
fi
if [ "$SCALA_PATH_211" == "" ]
then
SCALA_PATH_211="`dirname $(which scalac)`"
SCALA_PATH_211="`( cd \"$SCALA_PATH_211\" && pwd )`"
fi
if [ "$VALIUM_PATH" == "" -o "$SCALA_PATH_211" == "" -o ! -f $SCALA_PATH_211/scalac -o ! -d $VALIUM_PATH/components ]
then
echo To use this script please set the VALIUM_PATH and SCALA_PATH_211 environment variables such that:
echo " -" '$SCALA_PATH_211/scalac' "(currently $SCALA_PATH_211/scalac)"
echo " -" '$VALIUM_PATH/components' "(currently $VALIUM_PATH/components)"
echo are accessible
exit 1
fi
SCALA_VERSION=2.11
VALIUM_VERSION=0.1-SNAPSHOT
PLUGIN_JAR=$VALIUM_PATH/components/plugin/target/scala-$SCALA_VERSION/valium-plugin_$SCALA_VERSION-$VALIUM_VERSION.jar
RUNTIME_JAR=$VALIUM_PATH/components/runtime/target/scala-$SCALA_VERSION/valium-runtime_$SCALA_VERSION-$VALIUM_VERSION.jar
me=`basename $0`
if [ "$me" == "va-scalac" ]; then
target=scalac
elif [ "$me" == "va-scala" ]; then
target=scala
else
echo Unrecognized script name: $0
exit 1
fi
function checkjar {
if [ ! -f "$1" ]
then
echo "The script is going to build the required jar file $1 by running \"sbt $2\" [5s until build]"
sleep 5
cd $VALIUM_PATH
sbt $2
cd -
if [ ! -f "$1" ]
then
echo "The required jar file has not been built by sbt. Please run \"sbt $2\""
exit 1
else
echo "The required jar file was built."
fi
fi
}
checkjar $PLUGIN_JAR valium-plugin/package
checkjar $RUNTIME_JAR valium-runtime/package
$SCALA_PATH_211/$target -bootclasspath $RUNTIME_JAR:$PLUGIN_JAR -Xplugin:$PLUGIN_JAR $@