我注意到,只要将scala-js添加到我使用sbt-start-script的项目中,我的默认设置就会被scala.js特定值覆盖。似乎一旦我添加对扩展JsApp的对象的引用,它就会在生成的启动脚本中设置为MAINCLASS。以下是重现问题的代码:
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")
}
}