Skip to content

Commit 5bbf4ea

Browse files
Update Build.scala to always use dotty-library-bootstraped
I couldn't get rid of the `dotty-library` project completely, it's still used the first time sbt-briged is compiled with dotty. The dependencies are as follows: - (no dep) compile `dotty-compile` with scalac [0] - (no dep) compile `dotty-library` with scalac [1] - ([0], [1]) → compile `dotty-sbt-bridge` with dotty [2] - ([0], [2]) → compile `dotty-library-bootstraped` with dotty + sbt After that, [1] should never be used again.
1 parent 831227a commit 5bbf4ea

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

bin/common

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ function build_all {
9090
printf "done\n"
9191

9292
printf "Building dotty library..."
93-
DOTTY_LIB_JAR=$(build_jar dotty-library/package "library/target/scala-$SCALA_BINARY_VERSION")
93+
DOTTY_LIB_JAR=$(build_jar dotty-library-bootstrapped/package "out/dotty-library-bootstrapped/target/scala-$SCALA_BINARY_VERSION")
94+
9495
printf "done\n"
9596

9697
printf "Building tests..."

project/Build.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ object Build {
130130
aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, `dotty-doc`, dottySbtBridgeRef,
131131
`scala-library`, `scala-compiler`, `scala-reflect`, scalap).
132132
dependsOn(`dotty-compiler`).
133-
dependsOn(`dotty-library`).
134133
settings(
135134
triggeredMessage in ThisBuild := Watched.clearWhenTriggered,
136135

@@ -261,7 +260,6 @@ object Build {
261260

262261
// Settings shared between dotty-compiler and dotty-compiler-bootstrapped
263262
lazy val dottyCompilerSettings = Seq(
264-
265263
// set system in/out for repl
266264
connectInput in run := true,
267265
outputStrategy := Some(StdoutOutput),
@@ -502,7 +500,7 @@ object Build {
502500

503501
lazy val `dotty-compiler` = project.in(file("compiler")).
504502
dependsOn(`dotty-interfaces`).
505-
dependsOn(`dotty-library`).
503+
dependsOn(`dotty-library-bootstrapped` % "test->compile").
506504
settings(sourceStructure).
507505
settings(dottyCompilerSettings).
508506
settings(
@@ -518,7 +516,7 @@ object Build {
518516
Map(
519517
"dotty-interfaces" -> (packageBin in (`dotty-interfaces`, Compile)).value,
520518
"dotty-compiler" -> (packageBin in Compile).value,
521-
"dotty-library" -> (packageBin in (`dotty-library`, Compile)).value,
519+
"dotty-library" -> (packageBin in (`dotty-library-bootstrapped`, Compile)).value,
522520
"dotty-compiler-test" -> (packageBin in Test).value
523521
) map { case (k, v) => (k, v.getAbsolutePath) }
524522
}
@@ -562,11 +560,13 @@ object Build {
562560
)
563561

564562
lazy val `dotty-library` = project.in(file("library")).
563+
settings(unmanagedSourceDirectories in Compile += baseDirectory.value / "src_scalac").
565564
settings(sourceStructure).
566565
settings(dottyLibrarySettings).
567566
settings(publishing)
568567

569568
lazy val `dotty-library-bootstrapped` = project.in(file("library")).
569+
settings(unmanagedSourceDirectories in Compile += baseDirectory.value / "src_dotc").
570570
settings(sourceStructure).
571571
settings(commonBootstrappedSettings).
572572
settings(dottyLibrarySettings)
@@ -576,6 +576,7 @@ object Build {
576576

577577
lazy val `dotty-sbt-bridge` = project.in(file("sbt-bridge")).
578578
dependsOn(`dotty-compiler`).
579+
dependsOn(`dotty-library`).
579580
settings(sourceStructure).
580581
settings(
581582
overrideScalaVersionSetting,
@@ -622,7 +623,7 @@ object Build {
622623
ScriptedPlugin.scripted := {
623624
val x1 = (publishLocal in `dotty-interfaces`).value
624625
val x2 = (publishLocal in `dotty-compiler`).value
625-
val x3 = (publishLocal in `dotty-library`).value
626+
val x3 = (publishLocal in `dotty-library-bootstrapped`).value
626627
val x4 = (publishLocal in dotty).value // Needed because sbt currently hardcodes the dotty artifact
627628
ScriptedPlugin.scriptedTask.evaluated
628629
}

0 commit comments

Comments
 (0)