aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-04 22:43:49 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-04 22:43:49 +0200
commit04436699427d14cb45080104c3bc781f90da3bb2 (patch)
tree624eaea17b09ee4727bd646c875cc1c2e8a61bed /bin
parentcb73668c691a5cab77cd8503856754834f4a9ba4 (diff)
downloaddotty-04436699427d14cb45080104c3bc781f90da3bb2.tar.gz
dotty-04436699427d14cb45080104c3bc781f90da3bb2.tar.bz2
dotty-04436699427d14cb45080104c3bc781f90da3bb2.zip
dotc: Get versions of all dependencies from Build.scala
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dotc34
1 files changed, 21 insertions, 13 deletions
diff --git a/bin/dotc b/bin/dotc
index 2af8064f3..1aadfbc55 100755
--- a/bin/dotc
+++ b/bin/dotc
@@ -2,13 +2,27 @@
# This script is used for running compiler standalone(outside of sbt)
# it's based on miniboxing script and paulp's launcher script
+# Try to autodetect real location of the script
+DOTTY_ROOT="`readlink \"$0\"`" # relative, symbolic links resolved
+if [[ "$DOTTY_ROOT" == "" ]]; then
+ DOTTY_ROOT="$0"
+fi
+DOTTY_ROOT="`dirname \"$DOTTY_ROOT\"`"
+DOTTY_ROOT="`( cd \"$DOTTY_ROOT\" && pwd )`/.." # absolute
+
+# Finds in dotty build file a line containing PATTERN
+# returns last "" escaped string in this line
+function getLastStringOnLineWith {
+ PATTERN="$1"
+ grep "$PATTERN" "$DOTTY_ROOT/project/Build.scala"|sed -n 's/.*\"\(.*\)\".*/\1/'p
+}
# Configuration
-SCALA_VERSION=2.11.5
+SCALA_VERSION=$(getLastStringOnLineWith "scalaVersion in")
SCALA_BINARY_VERSION=2.11
-SCALA_COMPILER_VERSION=2.11.5-20150416-144435-09c4a520e1
-DOTTY_VERSION=0.1
-JLINE_VERSION=2.12
+SCALA_COMPILER_VERSION=$(getLastStringOnLineWith "scala-compiler")
+DOTTY_VERSION=$(getLastStringOnLineWith "version in")
+JLINE_VERSION=$(getLastStringOnLineWith "jline")
bootcp=true
default_java_opts="-Xmx768m -Xms768m"
programName=$(basename "$0")
@@ -25,16 +39,10 @@ CompilerMain=dotty.tools.dotc.Main
ReplMain=test.DottyRepl
-# Try to autodetect real location of the script
-DOTTY_ROOT="`readlink \"$0\"`" # relative, symbolic links resolved
-if [[ "$DOTTY_ROOT" == "" ]]; then
- DOTTY_ROOT="$0"
-fi
-DOTTY_ROOT="`dirname \"$DOTTY_ROOT\"`"
-DOTTY_ROOT="`( cd \"$DOTTY_ROOT\" && pwd )`/.." # absolute
+
# autodetecting the compiler jar. this is location where sbt 'packages' it
-MAIN_JAR=$DOTTY_ROOT/target/scala-$SCALA_BINARY_VERSION/dotty_$SCALA_BINARY_VERSION-$DOTTY_VERSION-SNAPSHOT.jar
-TEST_JAR=$DOTTY_ROOT/target/scala-$SCALA_BINARY_VERSION/dotty_$SCALA_BINARY_VERSION-$DOTTY_VERSION-SNAPSHOT-tests.jar
+MAIN_JAR=$DOTTY_ROOT/target/scala-$SCALA_BINARY_VERSION/dotty_$SCALA_BINARY_VERSION-$DOTTY_VERSION.jar
+TEST_JAR=$DOTTY_ROOT/target/scala-$SCALA_BINARY_VERSION/dotty_$SCALA_BINARY_VERSION-$DOTTY_VERSION-tests.jar
function checkjar {
if [ ! -f "$1" ]
then