@@ -372,8 +372,8 @@ object Build {
372
372
// Compile using the non-bootstrapped and non-published dotty
373
373
managedScalaInstance := false ,
374
374
scalaInstance := {
375
- val externalLibraryDeps = (`scala3-library` / Compile / externalDependencyClasspath).value.map(_.data).toSet
376
- val externalCompilerDeps = (`scala3-compiler` / Compile / externalDependencyClasspath).value.map(_.data).toSet
375
+ val externalLibraryDeps = (`scala3-library` / Compile / externalDependencyClasspath).value.map(_.data)
376
+ val externalCompilerDeps = (`scala3-compiler` / Compile / externalDependencyClasspath).value.map(_.data)
377
377
378
378
// IMPORTANT: We need to use actual jars to form the ScalaInstance and not
379
379
// just directories containing classfiles because sbt maintains a cache of
@@ -386,15 +386,14 @@ object Build {
386
386
val scala3Compiler = (`scala3-compiler` / Compile / packageBin).value
387
387
388
388
val libraryJars = Array (scala3Library) ++ externalLibraryDeps
389
- val compilerJars = Array (tastyCore, scala3Interfaces, scala3Compiler) ++ ( externalCompilerDeps -- externalLibraryDeps)
389
+ val compilerJars = Seq (tastyCore, scala3Interfaces, scala3Compiler) ++ externalCompilerDeps
390
390
391
- // should be replaced by sbt.Defaults.makeScalaInstance when released
392
- // See https://github.com/sbt/sbt/pull/6480
393
- Bootstrap .makeScalaInstance(
394
- state.value,
391
+ Defaults .makeScalaInstance(
395
392
scalaVersion.value,
396
393
libraryJars = libraryJars,
397
- compilerJars = compilerJars,
394
+ allCompilerJars = compilerJars,
395
+ allDocJars = Seq .empty,
396
+ state.value,
398
397
scalaInstanceTopLoader.value
399
398
)
400
399
},
@@ -404,15 +403,18 @@ object Build {
404
403
// in the `scalaInstance` of the `doc` task which allows us to run
405
404
// `scala3-library-bootstrapped/doc` for example.
406
405
doc / scalaInstance := {
407
- val externalCompilerDeps = (`scala3-compiler` / Compile / externalDependencyClasspath).value.map(_.data).toSet
408
- val externalScaladocDeps = (LocalProject (" scaladoc" ) / Compile / externalDependencyClasspath).value.map(_.data).toSet
406
+ val externalDeps = (LocalProject (" scaladoc" ) / Compile / externalDependencyClasspath).value.map(_.data)
409
407
val scalaDoc = (LocalProject (" scaladoc" ) / Compile / packageBin).value
410
- val docJars = Array (scalaDoc) ++ (externalScaladocDeps -- externalCompilerDeps)
411
-
412
- Bootstrap .makeDocScalaInstance(
408
+ val docJars = Array (scalaDoc) ++ externalDeps
409
+
410
+ val base = scalaInstance.value
411
+ Defaults .makeScalaInstance(
412
+ version = base.version,
413
+ libraryJars = base.libraryJars,
414
+ allCompilerJars = base.compilerJars,
415
+ allDocJars = docJars,
413
416
state.value,
414
- scalaInstance.value,
415
- docJars
417
+ scalaInstanceTopLoader.value
416
418
)
417
419
},
418
420
Compile / doc / scalacOptions ++= scalacOptionsDocSettings
0 commit comments