@@ -25,6 +25,7 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
25
25
object ExposedValues extends AutoPlugin {
26
26
object autoImport {
27
27
val bootstrapFromPublishedJars = Build .bootstrapFromPublishedJars
28
+ val bootstrapOptimised = Build .bootstrapOptimised
28
29
}
29
30
}
30
31
@@ -52,6 +53,7 @@ object Build {
52
53
val JENKINS_BUILD = " dotty.jenkins.build"
53
54
val DRONE_MEM = " dotty.drone.mem"
54
55
56
+
55
57
val agentOptions = List (
56
58
// "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
57
59
// "-agentpath:/home/dark/opt/yjp-2013-build-13072/bin/linux-x86-64/libyjpagent.so"
@@ -84,12 +86,14 @@ object Build {
84
86
lazy val dottydoc = inputKey[Unit ](" run dottydoc" )
85
87
86
88
lazy val bootstrapFromPublishedJars = settingKey[Boolean ](" If true, bootstrap dotty from published non-bootstrapped dotty" )
89
+ lazy val bootstrapOptimised = settingKey[Boolean ](" Bootstrap with -optimise" )
87
90
88
91
// Used in build.sbt
89
92
lazy val thisBuildSettings = Def .settings(
90
93
// Change this to true if you want to bootstrap using a published non-bootstrapped compiler
91
94
bootstrapFromPublishedJars := false ,
92
95
96
+ bootstrapOptimised := false ,
93
97
94
98
// Override `runCode` from sbt-dotty to use the language-server and
95
99
// vscode extension from the source repository of dotty instead of a
@@ -167,8 +171,6 @@ object Build {
167
171
// otherwise sbt 0.13 incremental compilation breaks (https://github.com/sbt/sbt/issues/3142)
168
172
scalacOptions ++= Seq (" -bootclasspath" , sys.props(" sun.boot.class.path" )),
169
173
170
- scalacOptions += " -optimise" ,
171
-
172
174
// sbt gets very unhappy if two projects use the same target
173
175
target := baseDirectory.value / " .." / " out" / " bootstrap" / name.value,
174
176
@@ -177,6 +179,13 @@ object Build {
177
179
// ...but scala-library is
178
180
libraryDependencies += " org.scala-lang" % " scala-library" % scalacVersion,
179
181
182
+ scalacOptions ++= {
183
+ if (bootstrapOptimised.value)
184
+ Seq (" -optimise" )
185
+ else
186
+ Seq ()
187
+ },
188
+
180
189
ivyConfigurations ++= {
181
190
if (bootstrapFromPublishedJars.value)
182
191
Seq (Configurations .ScalaTool )
0 commit comments