diff options
-rwxr-xr-x | bin/dotc | 34 | ||||
-rw-r--r-- | build.sbt | 14 | ||||
-rw-r--r-- | project/Build.scala | 7 |
3 files changed, 28 insertions, 27 deletions
@@ -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 diff --git a/build.sbt b/build.sbt deleted file mode 100644 index 24f2c12d7..000000000 --- a/build.sbt +++ /dev/null @@ -1,14 +0,0 @@ - -name := "dotty" - -scalaVersion in Global := "2.11.5" - -version in Global := "0.1-SNAPSHOT" - -organization in Global := "org.scala-lang" - -organizationName in Global := "LAMP/EPFL" - -organizationHomepage in Global := Some(url("http://lamp.epfl.ch")) - -homepage in Global := Some(url("http://scala-lang.org")) diff --git a/project/Build.scala b/project/Build.scala index 89d79a8af..3f8a9b522 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -19,6 +19,13 @@ object DottyBuild extends Build { var partestLock: FileLock = null val defaults = Defaults.defaultSettings ++ Seq( + scalaVersion in Global := "2.11.5", + version in Global := "0.1-SNAPSHOT", + organization in Global := "org.scala-lang", + organizationName in Global := "LAMP/EPFL", + organizationHomepage in Global := Some(url("http://lamp.epfl.ch")), + homepage in Global := Some(url("https://github.com/lampepfl/dotty")), + // set sources to src/, tests to test/ and resources to resources/ scalaSource in Compile := baseDirectory.value / "src", javaSource in Compile := baseDirectory.value / "src", |