Skip to content

Commit 75d4235

Browse files
committed
sbt-dotty: Use default dependency resolution
In particular, this should use coursier instead of ivy unless someone forced the use of ivy. And we shouldn't have to worry about inter-project dependencies in the dotty build because of coursier/sbt-coursier#101.
1 parent 625efde commit 75d4235

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,15 @@ object DottyPlugin extends AutoPlugin {
302302
// ... instead, we'll fetch the compiler and its dependencies ourselves.
303303
scalaInstance := Def.taskDyn {
304304
if (isDotty.value)
305-
dottyScalaInstanceTask("dotty-compiler")
305+
dottyScalaInstanceTask("dotty-compiler", dependencyResolution.value)
306306
else
307307
Def.valueStrict { scalaInstance.taskValue }
308308
}.value,
309309

310310
// We need more stuff on the classpath to run the `doc` task.
311311
scalaInstance in doc := Def.taskDyn {
312312
if (isDotty.value)
313-
dottyScalaInstanceTask("dotty-doc")
313+
dottyScalaInstanceTask("dotty-doc", dependencyResolution.value)
314314
else
315315
Def.valueStrict { (scalaInstance in doc).taskValue }
316316
}.value,
@@ -404,16 +404,11 @@ object DottyPlugin extends AutoPlugin {
404404
}
405405

406406
/** Create a scalaInstance task that uses Dotty based on `moduleName`. */
407-
def dottyScalaInstanceTask(moduleName: String): Initialize[Task[ScalaInstance]] = Def.task {
408-
val ivyConfig0 = Classpaths.mkIvyConfiguration.value
409-
// When compiling non-bootstrapped projects in the build of Dotty itself,
410-
// dependency resolution might pick a local project which is not what we
411-
// want. We avoid this by dropping the inter-project resolver.
412-
val ivyConfig1 = ivyConfig0.withResolvers(ivyConfig0.resolvers.filter(_.name != "inter-project"))
407+
def dottyScalaInstanceTask(moduleName: String, dependencyRes: DependencyResolution): Initialize[Task[ScalaInstance]] = Def.task {
413408
val updateReport =
414409
fetchArtifactsOf(
415410
scalaOrganization.value %% moduleName % scalaVersion.value,
416-
ivy.IvyDependencyResolution(ivyConfig1),
411+
dependencyRes,
417412
scalaModuleInfo.value,
418413
updateConfiguration.value,
419414
(unresolvedWarningConfiguration in update).value,

0 commit comments

Comments
 (0)