Skip to content

Commit 22dcaa2

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 d6d4e87 commit 22dcaa2

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

bin/common

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ 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+
94+
cd "$DOTTY_ROOT" >& /dev/null
95+
sbt publish-local >& /dev/null
96+
cd - >& /dev/null
97+
98+
DOTTY_LIB_JAR=$(build_jar dotty-library-bootstrapped/package "out/dotty-library-bootstrapped/scala-$SCALA_BINARY_VERSION")
99+
94100
printf "done\n"
95101

96102
printf "Building tests..."

project/Build.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ object Build {
128128
aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, `dotty-doc`, dottySbtBridgeRef,
129129
`scala-library`, `scala-compiler`, `scala-reflect`, scalap).
130130
dependsOn(`dotty-compiler`).
131-
dependsOn(`dotty-library`).
132131
settings(
133132
triggeredMessage in ThisBuild := Watched.clearWhenTriggered,
134133

@@ -240,7 +239,6 @@ object Build {
240239

241240
// Settings shared between dotty-compiler and dotty-compiler-bootstrapped
242241
lazy val dottyCompilerSettings = Seq(
243-
244242
// The scala-backend folder is a git submodule that contains a fork of the Scala 2.11
245243
// compiler developed at https://github.com/lampepfl/scala/tree/sharing-backend.
246244
// We do not compile the whole submodule, only the part of the Scala 2.11 GenBCode backend
@@ -444,7 +442,6 @@ object Build {
444442

445443
lazy val `dotty-compiler` = project.in(file("compiler")).
446444
dependsOn(`dotty-interfaces`).
447-
dependsOn(`dotty-library`).
448445
settings(sourceStructure).
449446
settings(dottyCompilerSettings).
450447
settings(
@@ -460,7 +457,7 @@ object Build {
460457
Map(
461458
"dotty-interfaces" -> (packageBin in (`dotty-interfaces`, Compile)).value,
462459
"dotty-compiler" -> (packageBin in Compile).value,
463-
"dotty-library" -> (packageBin in (`dotty-library`, Compile)).value,
460+
"dotty-library" -> (packageBin in (`dotty-library-bootstrapped`, Compile)).value,
464461
"dotty-compiler-test" -> (packageBin in Test).value
465462
) map { case (k, v) => (k, v.getAbsolutePath) }
466463
}
@@ -504,11 +501,13 @@ object Build {
504501
)
505502

506503
lazy val `dotty-library` = project.in(file("library")).
504+
settings(unmanagedSourceDirectories in Compile += baseDirectory.value / "src_scalac").
507505
settings(sourceStructure).
508506
settings(dottyLibrarySettings).
509507
settings(publishing)
510508

511509
lazy val `dotty-library-bootstrapped` = project.in(file("library")).
510+
settings(unmanagedSourceDirectories in Compile += baseDirectory.value / "src_dotc").
512511
settings(sourceStructure).
513512
settings(commonBootstrappedSettings).
514513
settings(dottyLibrarySettings)
@@ -518,6 +517,7 @@ object Build {
518517

519518
lazy val `dotty-sbt-bridge` = project.in(file("sbt-bridge")).
520519
dependsOn(`dotty-compiler`).
520+
dependsOn(`dotty-library`).
521521
settings(sourceStructure).
522522
settings(
523523
overrideScalaVersionSetting,
@@ -564,7 +564,7 @@ object Build {
564564
ScriptedPlugin.scripted := {
565565
val x1 = (publishLocal in `dotty-interfaces`).value
566566
val x2 = (publishLocal in `dotty-compiler`).value
567-
val x3 = (publishLocal in `dotty-library`).value
567+
val x3 = (publishLocal in `dotty-library-bootstrapped`).value
568568
val x4 = (publishLocal in dotty).value // Needed because sbt currently hardcodes the dotty artifact
569569
ScriptedPlugin.scriptedTask.evaluated
570570
}

0 commit comments

Comments
 (0)