Skip to content

Commit 0443669

Browse files
committed
dotc: Get versions of all dependencies from Build.scala
1 parent cb73668 commit 0443669

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

bin/dotc

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,27 @@
22
# This script is used for running compiler standalone(outside of sbt)
33
# it's based on miniboxing script and paulp's launcher script
44

5+
# Try to autodetect real location of the script
6+
DOTTY_ROOT="`readlink \"$0\"`" # relative, symbolic links resolved
7+
if [[ "$DOTTY_ROOT" == "" ]]; then
8+
DOTTY_ROOT="$0"
9+
fi
10+
DOTTY_ROOT="`dirname \"$DOTTY_ROOT\"`"
11+
DOTTY_ROOT="`( cd \"$DOTTY_ROOT\" && pwd )`/.." # absolute
12+
13+
# Finds in dotty build file a line containing PATTERN
14+
# returns last "" escaped string in this line
15+
function getLastStringOnLineWith {
16+
PATTERN="$1"
17+
grep "$PATTERN" "$DOTTY_ROOT/project/Build.scala"|sed -n 's/.*\"\(.*\)\".*/\1/'p
18+
}
519

620
# Configuration
7-
SCALA_VERSION=2.11.5
21+
SCALA_VERSION=$(getLastStringOnLineWith "scalaVersion in")
822
SCALA_BINARY_VERSION=2.11
9-
SCALA_COMPILER_VERSION=2.11.5-20150416-144435-09c4a520e1
10-
DOTTY_VERSION=0.1
11-
JLINE_VERSION=2.12
23+
SCALA_COMPILER_VERSION=$(getLastStringOnLineWith "scala-compiler")
24+
DOTTY_VERSION=$(getLastStringOnLineWith "version in")
25+
JLINE_VERSION=$(getLastStringOnLineWith "jline")
1226
bootcp=true
1327
default_java_opts="-Xmx768m -Xms768m"
1428
programName=$(basename "$0")
@@ -25,16 +39,10 @@ CompilerMain=dotty.tools.dotc.Main
2539
ReplMain=test.DottyRepl
2640

2741

28-
# Try to autodetect real location of the script
29-
DOTTY_ROOT="`readlink \"$0\"`" # relative, symbolic links resolved
30-
if [[ "$DOTTY_ROOT" == "" ]]; then
31-
DOTTY_ROOT="$0"
32-
fi
33-
DOTTY_ROOT="`dirname \"$DOTTY_ROOT\"`"
34-
DOTTY_ROOT="`( cd \"$DOTTY_ROOT\" && pwd )`/.." # absolute
42+
3543
# autodetecting the compiler jar. this is location where sbt 'packages' it
36-
MAIN_JAR=$DOTTY_ROOT/target/scala-$SCALA_BINARY_VERSION/dotty_$SCALA_BINARY_VERSION-$DOTTY_VERSION-SNAPSHOT.jar
37-
TEST_JAR=$DOTTY_ROOT/target/scala-$SCALA_BINARY_VERSION/dotty_$SCALA_BINARY_VERSION-$DOTTY_VERSION-SNAPSHOT-tests.jar
44+
MAIN_JAR=$DOTTY_ROOT/target/scala-$SCALA_BINARY_VERSION/dotty_$SCALA_BINARY_VERSION-$DOTTY_VERSION.jar
45+
TEST_JAR=$DOTTY_ROOT/target/scala-$SCALA_BINARY_VERSION/dotty_$SCALA_BINARY_VERSION-$DOTTY_VERSION-tests.jar
3846
function checkjar {
3947
if [ ! -f "$1" ]
4048
then

0 commit comments

Comments
 (0)