I have noticed that as soon as I add scala-js to a project in which I use sbt-start-script my default settings are overwritten with scala.js specific values. Seems that once I add a reference to an object that extends the JsApp it gets set as the MAINCLASS in the generated start script. Below is the code to reproduce the problem:
Build.scala:
import sbt._
import Keys._
import com.typesafe.sbt.SbtStartScript
import scala.scalajs.sbtplugin.ScalaJSPlugin._
import ScalaJSKeys._
object ScalizateBuild extends Build {
val Name = "test"
val Version = "0.1.0-SNAPSHOT"
val ScalaVersion = "2.11.4"
lazy val project = Project (
"test",
file("."),
settings = Defaults.defaultSettings
++ SbtStartScript.startScriptForClassesSettings
++ scalaJSSettings
++ Seq(
name := Name,
version := Version,
scalaVersion := ScalaVersion,
resolvers += Classpaths.typesafeReleases,
libraryDependencies ++= Seq(
)))
}
plugins.sbt:
addSbtPlugin("com.typesafe.sbt" % "sbt-start-script" % "0.10.0")
addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.6")
Test.scala:
import scala.scalajs.js.JSApp
object JQueryUIApp extends JSApp {
def main(): Unit = {
println("javascript")
}
}