Skip to content

Commit adb13ac

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 1c0a088 commit adb13ac

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

@@ -252,7 +251,6 @@ object Build {
252251

253252
// Settings shared between dotty-compiler and dotty-compiler-bootstrapped
254253
lazy val dottyCompilerSettings = Seq(
255-
256254
// The scala-backend folder is a git submodule that contains a fork of the Scala 2.11
257255
// compiler developed at https://github.com/lampepfl/scala/tree/sharing-backend.
258256
// We do not compile the whole submodule, only the part of the Scala 2.11 GenBCode backend
@@ -484,7 +482,6 @@ object Build {
484482

485483
lazy val `dotty-compiler` = project.in(file("compiler")).
486484
dependsOn(`dotty-interfaces`).
487-
dependsOn(`dotty-library`).
488485
settings(sourceStructure).
489486
settings(dottyCompilerSettings).
490487
settings(
@@ -498,7 +495,7 @@ object Build {
498495
Map(
499496
"dotty-interfaces" -> (packageBin in (`dotty-interfaces`, Compile)).value,
500497
"dotty-compiler" -> (packageBin in Compile).value,
501-
"dotty-library" -> (packageBin in (`dotty-library`, Compile)).value,
498+
"dotty-library" -> (packageBin in (`dotty-library-bootstrapped`, Compile)).value,
502499
"dotty-compiler-test" -> (packageBin in Test).value
503500
) map { case (k, v) => (k, v.getAbsolutePath) }
504501
}
@@ -542,11 +539,13 @@ object Build {
542539
)
543540

544541
lazy val `dotty-library` = project.in(file("library")).
542+
settings(unmanagedSourceDirectories in Compile += baseDirectory.value / "src_scalac").
545543
settings(sourceStructure).
546544
settings(dottyLibrarySettings).
547545
settings(publishing)
548546

549547
lazy val `dotty-library-bootstrapped` = project.in(file("library")).
548+
settings(unmanagedSourceDirectories in Compile += baseDirectory.value / "src_dotc").
550549
settings(sourceStructure).
551550
settings(commonBootstrappedSettings).
552551
settings(dottyLibrarySettings)
@@ -556,6 +555,7 @@ object Build {
556555

557556
lazy val `dotty-sbt-bridge` = project.in(file("sbt-bridge")).
558557
dependsOn(`dotty-compiler`).
558+
dependsOn(`dotty-library`).
559559
settings(sourceStructure).
560560
settings(
561561
cleanSbtBridge := {
@@ -600,7 +600,7 @@ object Build {
600600
ScriptedPlugin.scripted := {
601601
val x1 = (publishLocal in `dotty-interfaces`).value
602602
val x2 = (publishLocal in `dotty-compiler`).value
603-
val x3 = (publishLocal in `dotty-library`).value
603+
val x3 = (publishLocal in `dotty-library-bootstrapped`).value
604604
val x4 = (publishLocal in dotty).value // Needed because sbt currently hardcodes the dotty artifact
605605
ScriptedPlugin.scriptedTask.evaluated
606606
}

0 commit comments

Comments
 (0)