From 26562675adc960931cf0ab1a7ace4ca51c6fa400 Mon Sep 17 00:00:00 2001 From: Anthony Pieter Holland Date: Fri, 5 Feb 2016 14:40:03 +0200 Subject: [PATCH] Added configuration "Compile" to command that sets mainClass. Also added a brief explanation and links to two relevant Stack Overflow questions. --- doc/project/building.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/project/building.md b/doc/project/building.md index 2ede5c00..4d0e18e5 100644 --- a/doc/project/building.md +++ b/doc/project/building.md @@ -75,5 +75,7 @@ You can run your code and tests in fullOpt stage with the following command: ## Writing Launcher Code If you want the code which is used to run the main class to be written to a file, you can set `persistLauncher := true`. -Note that this will require your main class to be either unique or explicitly set (`mainClass := Some()`). +Note that this will require your main class to be either unique or explicitly set (`mainClass in Compile := Some()`). +If you explicitly set `mainClass`, note that it needs to be set on a per-configuration basis (i.e. the part `in Compile` is essential, otherwise the setting will be ignored). For further information see the Stack Overflow entry ['How to set mainClass in ScalaJS build.sbt?'](http://stackoverflow.com/questions/34965072/how-to-set-mainclass-in-scalajs-build-sbt) (specific to Scala.js) and the Stack Overflow entry ['How to set main class in build?'](http://stackoverflow.com/questions/6467423/how-to-set-main-class-in-build) (not specific to Scala.js). + The resulting file in the target folder will have the suffix `-launcher.js`.