Skip to content

Commit fe9d262

Browse files
committed
Make proper dotty-optimised project/artefacts
1 parent 660fab6 commit fe9d262

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pipeline:
2929
image: lampepfl/dotty:2017-09-08
3030
commands:
3131
- cp -R . /tmp/3/ && cd /tmp/3/
32-
- ./project/scripts/sbt ";set bootstrapOptimised in ThisBuild := true ;dotty-bootstrapped/test"
32+
- ./project/scripts/sbt dotty-optimised/test
3333

3434
test_sbt:
3535
group: test

build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
val dotty = Build.dotty
22
val `dotty-bootstrapped` = Build.`dotty-bootstrapped`
3+
val `dotty-optimised` = Build.`dotty-optimised`
34
val `dotty-interfaces` = Build.`dotty-interfaces`
45
val `dotty-doc` = Build.`dotty-doc`
56
val `dotty-doc-bootstrapped` = Build.`dotty-doc-bootstrapped`
67
val `dotty-bot` = Build.`dotty-bot`
78
val `dotty-compiler` = Build.`dotty-compiler`
89
val `dotty-compiler-bootstrapped` = Build.`dotty-compiler-bootstrapped`
10+
val `dotty-compiler-optimised` = Build.`dotty-compiler-optimised`
911
val `dotty-library` = Build.`dotty-library`
1012
val `dotty-library-bootstrapped` = Build.`dotty-library-bootstrapped`
13+
val `dotty-library-optimised` = Build.`dotty-library-optimised`
1114
val `dotty-sbt-bridge` = Build.`dotty-sbt-bridge`
1215
val `dotty-sbt-bridge-bootstrapped` = Build.`dotty-sbt-bridge-bootstrapped`
1316
val `dotty-language-server` = Build.`dotty-language-server`
1417
val sjsSandbox = Build.sjsSandbox
1518
val `dotty-bench` = Build.`dotty-bench`
1619
val `dotty-bench-bootstrapped` = Build.`dotty-bench-bootstrapped`
20+
val `dotty-bench-optimised` = Build.`dotty-bench-optimised`
1721
val `scala-library` = Build.`scala-library`
1822
val `scala-compiler` = Build.`scala-compiler`
1923
val `scala-reflect` = Build.`scala-reflect`
2024
val scalap = Build.scalap
2125
val dist = Build.dist
2226
val `dist-bootstrapped` = Build.`dist-bootstrapped`
27+
val `dist-optimised` = Build.`dist-optimised`
2328

2429
val `sbt-dotty` = Build.`sbt-dotty`
2530
val `vscode-dotty` = Build.`vscode-dotty`

project/Build.scala

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)