Skip to content

Commit 172b82c

Browse files
committed
Don't use deprecated ScalaInstance constructor
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`.
1 parent 7020f13 commit 172b82c

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

dotty.sublime-project

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"folders":
3+
[
4+
{
5+
"path": ".",
6+
"folder_exclude_patterns": ["scala-backend", "collection-strawman", "scala2-library"]
7+
}
8+
]
9+
}

project/Build.scala

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ object Build {
249249
// Compile using the non-bootstrapped and non-published dotty
250250
managedScalaInstance := false,
251251
scalaInstance := {
252+
import sbt.internal.inc.ScalaInstance
253+
import sbt.internal.inc.classpath.ClasspathUtilities
254+
252255
val updateReport = update.value
253256
var libraryJar = packageBin.in(`dotty-library`, Compile).value
254257
var compilerJar = packageBin.in(`dotty-compiler`, Compile).value
@@ -270,8 +273,18 @@ object Build {
270273

271274
val allJars = libraryJar :: compilerJar :: otherDependencies.toList
272275
val classLoader = state.value.classLoaderCache(allJars)
273-
new sbt.internal.inc.ScalaInstance(scalaVersion.value,
274-
classLoader, libraryJar, compilerJar, allJars.toArray, None)
276+
new ScalaInstance(
277+
scalaVersion.value,
278+
classLoader,
279+
ClasspathUtilities.rootLoader, // FIXME: Should be a class loader which only includes the dotty-lib
280+
// See: https://github.com/sbt/zinc/commit/9397b6aaf94ac3cfab386e3abd11c0ef9c2ceaff#diff-ea135f2f26f43e40ff045089da221e1e
281+
// Should not matter, as it addresses an issue with `sbt run` that
282+
// only occur when `(fork in run) := false`
283+
libraryJar,
284+
compilerJar,
285+
allJars.toArray,
286+
None
287+
)
275288
}
276289
)
277290

0 commit comments

Comments
 (0)