-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile-scala.sh
executable file
·42 lines (34 loc) · 1.27 KB
/
compile-scala.sh
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
if [ ! -f $SCALA_HOME/lib/scala-library.jar ]
then
echo Unable to find scala-library.jar in SCALA_HOME [$SCALA_HOME] > compilation.log
exit 1
fi
if [ ! -f src/main/java/Runner.java ]
then
echo Unable to find src/main/java/Runner.java > compilation.log
exit 1
fi
if [ ! -f src/main/scala/MyStrategy.scala ]
then
echo Unable to find src/main/scala/MyStrategy.scala > compilation.log
exit 1
fi
rm -rf classes
mkdir classes
$SCALA_HOME/bin/scalac -sourcepath "src/main/scala" -d classes src/main/scala/*.scala src/main/scala/model/*.scala src/main/java/*.java src/main/java/model/*.java >compilation.log 2>&1
$JAVA_HOME/bin/javac -sourcepath "src/main/java" -cp "classes" -d classes src/main/java/*.java >>compilation.log 2>&1
if [ ! -f classes/MyStrategy.class ]
then
echo Unable to find classes/MyStrategy.class >> compilation.log
exit 1
fi
if [ ! -f classes/Runner.class ]
then
echo Unable to find classes/Runner.class >> compilation.log
exit 1
fi
echo Manifest-Version: 1.0 >MANIFEST.MF
echo Main-Class: Runner >>MANIFEST.MF
echo Class-Path: scala-library.jar scala-reflect.jar >>MANIFEST.MF
jar -cfm "./scala-cgdk.jar" MANIFEST.MF -C "./classes" . >>compilation.log 2>&1
cp -n $SCALA_HOME/lib/scala-library.jar $SCALA_HOME/lib/scala-reflect.jar .