Skip to content

Commit bb322b0

Browse files
authored
Merge pull request #5061 from dotty-staging/fix-inc-java8
Fix incremental compilation under Java 8
2 parents c9cae24 + fc3d150 commit bb322b0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

project/Build.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import dotty.tools.sbtplugin.DottyIDEPlugin.autoImport._
2121
import sbtbuildinfo.BuildInfoPlugin
2222
import sbtbuildinfo.BuildInfoPlugin.autoImport._
2323

24+
import scala.util.Properties.isJavaAtLeast
25+
2426
/* In sbt 0.13 the Build trait would expose all vals to the shell, where you
2527
* can use them in "set a := b" like expressions. This re-exposes them.
2628
*/
@@ -225,6 +227,14 @@ object Build {
225227
// non-bootstrapped dotty-library that will then take priority over
226228
// the bootstrapped dotty-library on the classpath or sourcepath.
227229
classpathOptions ~= (_.withAutoBoot(false)),
230+
// ... but when running under Java 8, we still need a Scala bootclasspath that contains the JVM bootclasspath,
231+
// otherwise sbt incremental compilation breaks.
232+
scalacOptions ++= {
233+
if (isJavaAtLeast("9"))
234+
Seq()
235+
else
236+
Seq("-bootclasspath", sys.props("sun.boot.class.path"))
237+
},
228238

229239
// Enforce that the only Scala 2 classfiles we unpickle come from scala-library
230240
/*

0 commit comments

Comments
 (0)