@@ -25,6 +25,7 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
2525object ExposedValues extends AutoPlugin {
2626 object autoImport {
2727 val bootstrapFromPublishedJars = Build .bootstrapFromPublishedJars
28+ val bootstrapOptimised = Build .bootstrapOptimised
2829 }
2930}
3031
@@ -52,6 +53,7 @@ object Build {
5253 val JENKINS_BUILD = " dotty.jenkins.build"
5354 val DRONE_MEM = " dotty.drone.mem"
5455
56+
5557 val agentOptions = List (
5658 // "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
5759 // "-agentpath:/home/dark/opt/yjp-2013-build-13072/bin/linux-x86-64/libyjpagent.so"
@@ -84,12 +86,14 @@ object Build {
8486 lazy val dottydoc = inputKey[Unit ](" run dottydoc" )
8587
8688 lazy val bootstrapFromPublishedJars = settingKey[Boolean ](" If true, bootstrap dotty from published non-bootstrapped dotty" )
89+ lazy val bootstrapOptimised = settingKey[Boolean ](" Bootstrap with -optimise" )
8790
8891 // Used in build.sbt
8992 lazy val thisBuildSettings = Def .settings(
9093 // Change this to true if you want to bootstrap using a published non-bootstrapped compiler
9194 bootstrapFromPublishedJars := false ,
9295
96+ bootstrapOptimised := false ,
9397
9498 // Override `runCode` from sbt-dotty to use the language-server and
9599 // vscode extension from the source repository of dotty instead of a
@@ -167,8 +171,6 @@ object Build {
167171 // otherwise sbt 0.13 incremental compilation breaks (https://github.com/sbt/sbt/issues/3142)
168172 scalacOptions ++= Seq (" -bootclasspath" , sys.props(" sun.boot.class.path" )),
169173
170- scalacOptions += " -optimise" ,
171-
172174 // sbt gets very unhappy if two projects use the same target
173175 target := baseDirectory.value / " .." / " out" / " bootstrap" / name.value,
174176
@@ -177,6 +179,13 @@ object Build {
177179 // ...but scala-library is
178180 libraryDependencies += " org.scala-lang" % " scala-library" % scalacVersion,
179181
182+ scalacOptions ++= {
183+ if (bootstrapOptimised.value)
184+ Seq (" -optimise" )
185+ else
186+ Seq ()
187+ },
188+
180189 ivyConfigurations ++= {
181190 if (bootstrapFromPublishedJars.value)
182191 Seq (Configurations .ScalaTool )
0 commit comments