Skip to content

Commit

Permalink
Don't use deprecated ScalaInstance constructor
Browse files Browse the repository at this point in the history
sbt/zinc@9397b6a#diff-ea135f2f26f43e40ff045089da221e1e
introduced a new constructor for ScalaInstance and deprecated the old
one. We use the new one but don't call it with the proper arguments. It
shouldn't matter though as the enw constructor was introduced to fix an
issue with `sbt run` that only occurs when `(fork in run) := false`.
  • Loading branch information
allanrenucci committed Mar 27, 2018
1 parent 7020f13 commit 172b82c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
9 changes: 9 additions & 0 deletions dotty.sublime-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"folders":
[
{
"path": ".",
"folder_exclude_patterns": ["scala-backend", "collection-strawman", "scala2-library"]
}
]
}
17 changes: 15 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ object Build {
// Compile using the non-bootstrapped and non-published dotty
managedScalaInstance := false,
scalaInstance := {
import sbt.internal.inc.ScalaInstance
import sbt.internal.inc.classpath.ClasspathUtilities

val updateReport = update.value
var libraryJar = packageBin.in(`dotty-library`, Compile).value
var compilerJar = packageBin.in(`dotty-compiler`, Compile).value
Expand All @@ -270,8 +273,18 @@ object Build {

val allJars = libraryJar :: compilerJar :: otherDependencies.toList
val classLoader = state.value.classLoaderCache(allJars)
new sbt.internal.inc.ScalaInstance(scalaVersion.value,
classLoader, libraryJar, compilerJar, allJars.toArray, None)
new ScalaInstance(
scalaVersion.value,
classLoader,
ClasspathUtilities.rootLoader, // FIXME: Should be a class loader which only includes the dotty-lib
// See: https://github.com/sbt/zinc/commit/9397b6aaf94ac3cfab386e3abd11c0ef9c2ceaff#diff-ea135f2f26f43e40ff045089da221e1e
// Should not matter, as it addresses an issue with `sbt run` that
// only occur when `(fork in run) := false`
libraryJar,
compilerJar,
allJars.toArray,
None
)
}
)

Expand Down

0 comments on commit 172b82c

Please sign in to comment.