Skip to content

Commit 334cea8

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 cc67e28 commit 334cea8

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
@@ -124,7 +124,6 @@ object Build {
124124
aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, `dotty-doc`, dottySbtBridgeRef,
125125
`scala-library`, `scala-compiler`, `scala-reflect`, scalap).
126126
dependsOn(`dotty-compiler`).
127-
dependsOn(`dotty-library`).
128127
settings(
129128
triggeredMessage in ThisBuild := Watched.clearWhenTriggered,
130129

@@ -246,7 +245,6 @@ object Build {
246245

247246
// Settings shared between dotty-compiler and dotty-compiler-bootstrapped
248247
lazy val dottyCompilerSettings = Seq(
249-
250248
// The scala-backend folder is a git submodule that contains a fork of the Scala 2.11
251249
// compiler developed at https://github.com/lampepfl/scala/tree/sharing-backend.
252250
// We do not compile the whole submodule, only the part of the Scala 2.11 GenBCode backend
@@ -454,7 +452,6 @@ object Build {
454452

455453
lazy val `dotty-compiler` = project.in(file("compiler")).
456454
dependsOn(`dotty-interfaces`).
457-
dependsOn(`dotty-library`).
458455
settings(sourceStructure).
459456
settings(dottyCompilerSettings).
460457
settings(
@@ -468,7 +465,7 @@ object Build {
468465
Map(
469466
"dotty-interfaces" -> (packageBin in (`dotty-interfaces`, Compile)).value,
470467
"dotty-compiler" -> (packageBin in Compile).value,
471-
"dotty-library" -> (packageBin in (`dotty-library`, Compile)).value,
468+
"dotty-library" -> (packageBin in (`dotty-library-bootstrapped`, Compile)).value,
472469
"dotty-compiler-test" -> (packageBin in Test).value
473470
) map { case (k, v) => (k, v.getAbsolutePath) }
474471
}
@@ -512,11 +509,13 @@ object Build {
512509
)
513510

514511
lazy val `dotty-library` = project.in(file("library")).
512+
settings(unmanagedSourceDirectories in Compile += baseDirectory.value / "src_scalac").
515513
settings(sourceStructure).
516514
settings(dottyLibrarySettings).
517515
settings(publishing)
518516

519517
lazy val `dotty-library-bootstrapped` = project.in(file("library")).
518+
settings(unmanagedSourceDirectories in Compile += baseDirectory.value / "src_dotc").
520519
settings(sourceStructure).
521520
settings(commonBootstrappedSettings).
522521
settings(dottyLibrarySettings)
@@ -526,6 +525,7 @@ object Build {
526525

527526
lazy val `dotty-sbt-bridge` = project.in(file("sbt-bridge")).
528527
dependsOn(`dotty-compiler`).
528+
dependsOn(`dotty-library`).
529529
settings(sourceStructure).
530530
settings(
531531
cleanSbtBridge := {
@@ -570,7 +570,7 @@ object Build {
570570
ScriptedPlugin.scripted := {
571571
val x1 = (publishLocal in `dotty-interfaces`).value
572572
val x2 = (publishLocal in `dotty-compiler`).value
573-
val x3 = (publishLocal in `dotty-library`).value
573+
val x3 = (publishLocal in `dotty-library-bootstrapped`).value
574574
val x4 = (publishLocal in dotty).value // Needed because sbt currently hardcodes the dotty artifact
575575
ScriptedPlugin.scriptedTask.evaluated
576576
}

0 commit comments

Comments
 (0)