Skip to content

Commit

Permalink
Enable batchMode on scala.js Optimizer
Browse files Browse the repository at this point in the history
The `batchMode` should help reduce the memory requirement to compile
scala.js code as per
scala-js/scala-js#1788 (comment)

Implementation details: `botBuild` is a sbt setting that will be turned
on on travisCi so that it will not interfere with local dev experience.
  • Loading branch information
ngbinh committed Mar 27, 2016
1 parent df56b82 commit bfe8498
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
global:
- secure: Kf44XQFpq2QGe3rn98Dsf5Uz3WXzPDralS54co7sqT5oQGs1mYLYZRYz+I75ZSo5ffZ86H7M+AI9YFofqGwAjBixBbqf1tGkUh3oZp2fN3QfqzazGV3HzC+o41zALG5FL+UBaURev9ChQ5fYeTtFB7YAzejHz4y5E97awk934Rg=
- secure: QbNAu0jCaKrwjJi7KZtYEBA/pYbTJ91Y1x/eLAJpsamswVOvwnThA/TLYuux+oiZQCiDUpBzP3oxksIrEEUAhl0lMtqRFY3MrcUr+si9NIjX8hmoFwkvZ5o1b7pmLF6Vz3rQeP/EWMLcljLzEwsrRXeK0Ei2E4vFpsg8yz1YXJg=
- botBuild=true
cache:
directories:
- $HOME/.sbt/0.13/dependency
Expand Down
8 changes: 7 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import sbtunidoc.Plugin.UnidocKeys._
import ReleaseTransformations._
import ScoverageSbtPlugin._

lazy val botBuild = settingKey[Boolean]("Jenkins/TravisCI build mode")

lazy val scoverageSettings = Seq(
ScoverageKeys.coverageMinimum := 60,
ScoverageKeys.coverageFailOnMinimum := false,
Expand Down Expand Up @@ -55,7 +57,11 @@ lazy val commonJsSettings = Seq(
s"-P:scalajs:mapSourceURI:$a->$g/"
},
scalaJSStage in Global := FastOptStage,
parallelExecution := false
parallelExecution := false,
// Only use for scala.js for now
botBuild := sys.props.getOrElse("botBuild", default="false") == "true",
// batch mode decreases the amount of memory needed to compile scala.js code
scalaJSOptimizerOptions := scalaJSOptimizerOptions.value.withBatchMode(botBuild.value)
)

lazy val commonJvmSettings = Seq(
Expand Down

0 comments on commit bfe8498

Please sign in to comment.