Skip to content

Commit 80209dd

Browse files
committed
Fix (run, Test) classpath issues
1 parent e41f4fd commit 80209dd

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

project/Build.scala

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import sbt._
22
import Keys._
33
import Process._
44

5-
object MiniboxingBuild extends Build {
5+
object DottyBuild extends Build {
66

77
val defaults = Defaults.defaultSettings ++ Seq(
88
// set sources to src/, tests to test/ and resources to resources/
@@ -31,9 +31,23 @@ object MiniboxingBuild extends Build {
3131
// scalac options
3232
scalacOptions in Global ++= Seq("-feature", "-deprecation", "-language:_"),
3333

34-
// main class
35-
mainClass in (Compile, run) := Some("dotty.tools.dotc.Main")
34+
// Adjust classpath for running dotty
35+
mainClass in (Compile, run) := Some("dotty.tools.dotc.Main"),
36+
fork in run := true,
37+
fork in Test := true,
38+
// http://grokbase.com/t/gg/simple-build-tool/135ke5y90p/sbt-setting-jvm-boot-paramaters-for-scala
39+
javaOptions <++= (managedClasspath in Runtime, packageBin in Compile) map { (attList, bin) =>
40+
// put the Scala {library, reflect, compiler} in the classpath
41+
val path = for {
42+
file <- attList.map(_.data)
43+
path = file.getAbsolutePath
44+
} yield "-Xbootclasspath/p:" + path
45+
// dotty itself needs to be in the bootclasspath
46+
val self = "-Xbootclasspath/a:" + bin
47+
System.err.println("PATH: " + path)
48+
self :: path.toList
49+
}
3650
)
3751

38-
lazy val dotty = Project(id = "miniboxing", base = file("."), settings = defaults)
52+
lazy val dotty = Project(id = "dotty", base = file("."), settings = defaults)
3953
}

0 commit comments

Comments
 (0)