Skip to content

Commit 85d9684

Browse files
authored
Merge pull request #2407 from dotty-staging/missing-scala-library
Add missing scala-library dependency
2 parents 7a3f880 + 833e029 commit 85d9684

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

project/Build.scala

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
scalaVersion := dottyLatestNightlyBuild.get
1+
scalaVersion := sys.props("plugin.scalaVersion")
22

33
libraryDependencies += ("org.scala-lang.modules" %% "scala-xml" % "1.0.1").withDottyCompat()

0 commit comments

Comments
 (0)