From 04436699427d14cb45080104c3bc781f90da3bb2 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Mon, 4 May 2015 22:43:49 +0200 Subject: dotc: Get versions of all dependencies from Build.scala --- bin/dotc | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3