Skip to content

Commit 36ebabd

Browse files
committed
Merge pull request #535 from dotty-staging/Build-scala
dotc: Get versions of all dependencies from Build.scala
2 parents 2a45761 + 0443669 commit 36ebabd

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
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

build.sbt

Lines changed: 0 additions & 14 deletions
This file was deleted.

project/Build.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ object DottyBuild extends Build {
1919
var partestLock: FileLock = null
2020

2121
val defaults = Defaults.defaultSettings ++ Seq(
22+
scalaVersion in Global := "2.11.5",
23+
version in Global := "0.1-SNAPSHOT",
24+
organization in Global := "org.scala-lang",
25+
organizationName in Global := "LAMP/EPFL",
26+
organizationHomepage in Global := Some(url("http://lamp.epfl.ch")),
27+
homepage in Global := Some(url("https://github.com/lampepfl/dotty")),
28+
2229
// set sources to src/, tests to test/ and resources to resources/
2330
scalaSource in Compile := baseDirectory.value / "src",
2431
javaSource in Compile := baseDirectory.value / "src",

0 commit comments

Comments
 (0)