@@ -232,6 +232,8 @@ object Build {
232
232
}
233
233
)
234
234
235
+ lazy val commonOptimisedSettings = commonBootstrappedSettings ++ Seq (bootstrapOptimised := true )
236
+
235
237
lazy val commonBenchmarkSettings = Seq (
236
238
mainClass in (Jmh , run) := Some (" dotty.tools.benchmarks.Bench" ), // custom main for jmh:run
237
239
javaOptions += " -DBENCH_CLASS_PATH=" + Attributed .data((fullClasspath in Compile ).value).mkString(" " , " :" , " " )
@@ -286,6 +288,16 @@ object Build {
286
288
dependsOn(`dotty-library-bootstrapped`).
287
289
settings(commonBootstrappedSettings)
288
290
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
+
289
301
lazy val `dotty-interfaces` = project.in(file(" interfaces" )).
290
302
settings(commonScala2Settings). // Java-only project, so this is fine
291
303
settings(
@@ -674,6 +686,20 @@ object Build {
674
686
}
675
687
)
676
688
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
+
677
703
// Settings shared between dotty-library and dotty-library-bootstrapped
678
704
lazy val dottyLibrarySettings = Seq (
679
705
libraryDependencies ++= Seq (
@@ -694,6 +720,14 @@ object Build {
694
720
scalacOptions in Compile ++= Seq (" -sourcepath" , (scalaSource in Compile ).value.getAbsolutePath)
695
721
)
696
722
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
+
697
731
// until sbt/sbt#2402 is fixed (https://github.com/sbt/sbt/issues/2402)
698
732
lazy val cleanSbtBridge = TaskKey [Unit ](" cleanSbtBridge" , " delete dotty-sbt-bridge cache" )
699
733
@@ -832,6 +866,12 @@ object Build {
832
866
settings(unmanagedSourceDirectories in Compile ++= Seq (baseDirectory.value / " .." / " bench" / " src" )).
833
867
enablePlugins(JmhPlugin )
834
868
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
+
835
875
// Depend on dotty-library so that sbt projects using dotty automatically
836
876
// depend on the dotty-library
837
877
lazy val `scala-library` = project.
@@ -1151,4 +1191,15 @@ object Build {
1151
1191
settings(
1152
1192
target := baseDirectory.value / " target" // override setting in commonBootstrappedSettings
1153
1193
)
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
+ )
1154
1205
}
0 commit comments