@@ -828,7 +828,14 @@ object DottyInjectedPlugin extends AutoPlugin {
828828 // depend on the dotty-library
829829 lazy val `scala-library` = project.
830830 dependsOn(`dotty-library-bootstrapped`).
831- settings(commonDummySettings)
831+ settings(commonDummySettings).
832+ settings(
833+ // Need a direct dependency on the real scala-library even though we indirectly
834+ // depend on it via dotty-library, because sbt may rewrite dependencies
835+ // (see https://github.com/sbt/sbt/pull/2634), but won't rewrite the direct
836+ // dependencies of scala-library (see https://github.com/sbt/sbt/pull/2897)
837+ libraryDependencies += " org.scala-lang" % " scala-library" % scalacVersion
838+ )
832839
833840 lazy val `scala-compiler` = project.
834841 settings(commonDummySettings)
@@ -854,7 +861,17 @@ object DottyInjectedPlugin extends AutoPlugin {
854861 ScriptedPlugin .scriptedSettings,
855862 ScriptedPlugin .sbtTestDirectory := baseDirectory.value / " sbt-test" ,
856863 ScriptedPlugin .scriptedBufferLog := false ,
857- ScriptedPlugin .scriptedLaunchOpts += " -Dplugin.version=" + version.value
864+ ScriptedPlugin .scriptedLaunchOpts += " -Dplugin.version=" + version.value,
865+ ScriptedPlugin .scriptedLaunchOpts += " -Dplugin.scalaVersion=" + dottyVersion,
866+ ScriptedPlugin .scripted := ScriptedPlugin .scripted.dependsOn(Def .task {
867+ val x0 = (publishLocal in `dotty-sbt-bridge-bootstrapped`).value
868+ val x1 = (publishLocal in `dotty-interfaces`).value
869+ val x2 = (publishLocal in `dotty-compiler-bootstrapped`).value
870+ val x3 = (publishLocal in `dotty-library-bootstrapped`).value
871+ val x4 = (publishLocal in `scala-library`).value
872+ val x5 = (publishLocal in `scala-reflect`).value
873+ val x6 = (publishLocal in `dotty-bootstrapped`).value // Needed because sbt currently hardcodes the dotty artifact
874+ }).evaluated
858875 )
859876
860877 lazy val publishSettings = Seq (
0 commit comments