Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
smarter committed Jan 27, 2017
commit 6419a0668b3d4e0bfd42f9a1f69fde66a3944fd6
20 changes: 9 additions & 11 deletions compiler/test/dotty/Jars.scala
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package dotty

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

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

val dottyInterfaces: String = sys.env.get("DOTTY_INTERFACE") getOrElse {
"../interfaces/target/dotty-interfaces-0.1.1-SNAPSHOT.jar"
}
val dottyInterfaces: String = sys.env.get("DOTTY_INTERFACE")
.getOrElse(sys.props("dotty.tests.classes.interfaces"))

val dottyExtras: List[String] = sys.env.get("DOTTY_EXTRAS")
val dottyExtras: List[String] = Option(sys.env.get("DOTTY_EXTRAS")
.getOrElse(sys.props("dotty.tests.extraclasspath")))
.map(_.split(":").toList).getOrElse(Nil)

val dottyReplDeps: List[String] = dottyLib :: dottyExtras
Expand Down
10 changes: 8 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ object DottyBuild extends Build {

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

("-DpartestParentID=" + pid) :: tuning ::: agentOptions ::: ci_build ::: path.toList
val jars = List(
"-Ddotty.tests.classes.interfaces=" + pA("dotty-interfaces"),
"-Ddotty.tests.classes.library=" + pA("dotty-library"),
"-Ddotty.tests.classes.compiler=" + pA("dotty-compiler")
)

("-DpartestParentID=" + pid) :: jars ::: tuning ::: agentOptions ::: ci_build ::: path.toList
}
).
settings(publishing)
Expand Down