@@ -232,6 +232,8 @@ object Build {
232232 }
233233 )
234234
235+ lazy val commonOptimisedSettings = commonBootstrappedSettings ++ Seq (bootstrapOptimised := true )
236+
235237 lazy val commonBenchmarkSettings = Seq (
236238 mainClass in (Jmh , run) := Some (" dotty.tools.benchmarks.Bench" ), // custom main for jmh:run
237239 javaOptions += " -DBENCH_CLASS_PATH=" + Attributed .data((fullClasspath in Compile ).value).mkString(" " , " :" , " " )
@@ -286,6 +288,16 @@ object Build {
286288 dependsOn(`dotty-library-bootstrapped`).
287289 settings(commonBootstrappedSettings)
288290
291+ lazy val `dotty-optimised` = project.
292+ aggregate(`dotty-interfaces`, `dotty-library-optimised`, `dotty-compiler-optimised`, `dotty-doc-bootstrapped`,
293+ `dotty-language-server`,
294+ dottySbtBridgeBootstrappedRef,
295+ `scala-library`, `scala-compiler`, `scala-reflect`, scalap).
296+ dependsOn(`dotty-compiler-optimised`).
297+ dependsOn(`dotty-library-optimised`).
298+ settings(commonOptimisedSettings)
299+
300+
289301 lazy val `dotty-interfaces` = project.in(file(" interfaces" )).
290302 settings(commonScala2Settings). // Java-only project, so this is fine
291303 settings(
@@ -674,6 +686,20 @@ object Build {
674686 }
675687 )
676688
689+ lazy val `dotty-compiler-optimised` = project.in(file(" compiler" )).
690+ dependsOn(`dotty-interfaces`).
691+ dependsOn(`dotty-library-optimised`).
692+ settings(commonOptimisedSettings).
693+ settings(dottyCompilerSettings).
694+ settings(
695+ packageAll := {
696+ (packageAll in `dotty-compiler`).value ++ Seq (
697+ (" dotty-compiler" -> (packageBin in Compile ).value.getAbsolutePath),
698+ (" dotty-library" -> (packageBin in (`dotty-library-optimised`, Compile )).value.getAbsolutePath)
699+ )
700+ }
701+ )
702+
677703 // Settings shared between dotty-library and dotty-library-bootstrapped
678704 lazy val dottyLibrarySettings = Seq (
679705 libraryDependencies ++= Seq (
@@ -694,6 +720,14 @@ object Build {
694720 scalacOptions in Compile ++= Seq (" -sourcepath" , (scalaSource in Compile ).value.getAbsolutePath)
695721 )
696722
723+ lazy val `dotty-library-optimised` : Project = project.in(file(" library" )).
724+ settings(commonOptimisedSettings).
725+ settings(dottyLibrarySettings).
726+ settings(
727+ // Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called.
728+ scalacOptions in Compile ++= Seq (" -sourcepath" , (scalaSource in Compile ).value.getAbsolutePath)
729+ )
730+
697731 // until sbt/sbt#2402 is fixed (https://github.com/sbt/sbt/issues/2402)
698732 lazy val cleanSbtBridge = TaskKey [Unit ](" cleanSbtBridge" , " delete dotty-sbt-bridge cache" )
699733
@@ -832,6 +866,12 @@ object Build {
832866 settings(unmanagedSourceDirectories in Compile ++= Seq (baseDirectory.value / " .." / " bench" / " src" )).
833867 enablePlugins(JmhPlugin )
834868
869+ lazy val `dotty-bench-optimised` = project.in(file(" bench-optimised" )).
870+ dependsOn(`dotty-compiler-optimised`).
871+ settings(commonOptimisedSettings ++ commonBenchmarkSettings).
872+ settings(unmanagedSourceDirectories in Compile ++= Seq (baseDirectory.value / " .." / " bench" / " src" )).
873+ enablePlugins(JmhPlugin )
874+
835875 // Depend on dotty-library so that sbt projects using dotty automatically
836876 // depend on the dotty-library
837877 lazy val `scala-library` = project.
@@ -1151,4 +1191,15 @@ object Build {
11511191 settings(
11521192 target := baseDirectory.value / " target" // override setting in commonBootstrappedSettings
11531193 )
1194+
1195+ lazy val `dist-optimised` = project.
1196+ dependsOn(`dotty-interfaces`).
1197+ dependsOn(`dotty-library-optimised`).
1198+ dependsOn(`dotty-compiler-optimised`).
1199+ dependsOn(`dotty-doc-bootstrapped`).
1200+ settings(commonOptimisedSettings).
1201+ settings(commonDistSettings).
1202+ settings(
1203+ target := baseDirectory.value / " target" // override setting in commonBootstrappedSettings
1204+ )
11541205}
0 commit comments