aboutsummaryrefslogblamecommitdiff
path: root/bootstrap_scala/bootstrap_scala
blob: 7bc1d3145d58f37b6034a021e051539563437152 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                                                    
                                                                                                                                                       

                                                       
                                                                        




                                                                 
#!/bin/sh

_DIR=$(dirname $(readlink "$0") 2>/dev/null || dirname "$0" 2>/dev/null )
DIR=$(dirname $($_DIR/../realpath/realpath.sh $0))
JAVAC="javac -Xlint:deprecation"
TARGET=$DIR/target
CLASSES=$TARGET/classes/
VERSION=$1
CACHE=$DIR/cache/$VERSION/

COMPILER_JAR=scala-compiler-$VERSION.jar
LIBRARY_JAR=scala-library-$VERSION.jar
REFLECT_JAR=scala-reflect-$VERSION.jar
XML_JAR=scala-xml_2.11-1.0.5.jar # this is a bit fishy, because it doesn't take version into account

mkdir -p $CLASSES

if [ ! -f $CACHE$COMPILER_JAR ] || [ ! -f $CACHE$LIBRARY_JAR ] || [ ! -f $CACHE$REFLECT_JAR ]\
 || [ ! -f $CACHE$XML_JAR ] || [ $DIR/BootstrapScala.java -nt $CLASSES/BootstrapScala.class ] || [ $DIR/Dependency.java -nt $CLASSES/Dependency.class ]
then
	echo "Recompiling CBT BootstrapScala.java" 1>&2
	$JAVAC -d $CLASSES $DIR/BootstrapScala.java $DIR/Dependency.java
	java -cp $CLASSES BootstrapScala $1 $CACHE
else
	# for speedup
	echo `for f in $CACHE*; do printf "$f "; done`|tr " " ":"
fi