Skip to content

Commit 6419a06

Browse files
committed
Do not hardcode jars path in the tests, instead get them from sbt
This is necessary to run the tests with the bootstrapped projects and is just much better than hardcoding them anyway.
1 parent 0c97f76 commit 6419a06

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

compiler/test/dotty/Jars.scala

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
package dotty
22

3-
/** Jars used when compiling test, defaults to sbt locations */
3+
/** Jars used when compiling test, normally set from the sbt build */
44
object Jars {
5-
val dottyLib: String = sys.env.get("DOTTY_LIB") getOrElse {
6-
"../library/target/scala-2.11/dotty-library_2.11-0.1.1-SNAPSHOT.jar"
7-
}
5+
val dottyLib: String = sys.env.get("DOTTY_LIB")
6+
.getOrElse(sys.props("dotty.tests.classes.library"))
87

9-
val dottyCompiler: String = sys.env.get("DOTTY_COMPILER") getOrElse {
10-
"./target/scala-2.11/dotty-compiler_2.11-0.1.1-SNAPSHOT.jar"
11-
}
8+
val dottyCompiler: String = sys.env.get("DOTTY_COMPILER")
9+
.getOrElse(sys.props("dotty.tests.classes.compiler"))
1210

13-
val dottyInterfaces: String = sys.env.get("DOTTY_INTERFACE") getOrElse {
14-
"../interfaces/target/dotty-interfaces-0.1.1-SNAPSHOT.jar"
15-
}
11+
val dottyInterfaces: String = sys.env.get("DOTTY_INTERFACE")
12+
.getOrElse(sys.props("dotty.tests.classes.interfaces"))
1613

17-
val dottyExtras: List[String] = sys.env.get("DOTTY_EXTRAS")
14+
val dottyExtras: List[String] = Option(sys.env.get("DOTTY_EXTRAS")
15+
.getOrElse(sys.props("dotty.tests.extraclasspath")))
1816
.map(_.split(":").toList).getOrElse(Nil)
1917

2018
val dottyReplDeps: List[String] = dottyLib :: dottyExtras

project/Build.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ object DottyBuild extends Build {
326326

327327
// http://grokbase.com/t/gg/simple-build-tool/135ke5y90p/sbt-setting-jvm-boot-paramaters-for-scala
328328
// packageAll should always be run before tests
329-
javaOptions <++= (dependencyClasspath in Runtime, packageAll) map { (attList, _) =>
329+
javaOptions <++= (dependencyClasspath in Runtime, packageAll) map { (attList, pA) =>
330330
// put needed dependencies on classpath:
331331
val path = for {
332332
file <- attList.map(_.data)
@@ -356,7 +356,13 @@ object DottyBuild extends Build {
356356
List("-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1")
357357
else List()
358358

359-
("-DpartestParentID=" + pid) :: tuning ::: agentOptions ::: ci_build ::: path.toList
359+
val jars = List(
360+
"-Ddotty.tests.classes.interfaces=" + pA("dotty-interfaces"),
361+
"-Ddotty.tests.classes.library=" + pA("dotty-library"),
362+
"-Ddotty.tests.classes.compiler=" + pA("dotty-compiler")
363+
)
364+
365+
("-DpartestParentID=" + pid) :: jars ::: tuning ::: agentOptions ::: ci_build ::: path.toList
360366
}
361367
).
362368
settings(publishing)

0 commit comments

Comments
 (0)