Skip to content

Instantly share code, notes, and snippets.

@ASRagab
Last active February 22, 2016 02:48
Show Gist options
  • Save ASRagab/d80c43366f490a538cde to your computer and use it in GitHub Desktop.
Save ASRagab/d80c43366f490a538cde to your computer and use it in GitHub Desktop.
Sample build.sbt for cross compiled scala.js project with scalatest
name := "scalajs root project"
scalaVersion := "2.11.7"
lazy val root = project.in(file(".")).
aggregate(crossedJVM, crossedJS).
settings(
publish := {},
publishLocal := {}
)
lazy val crossed = crossProject.in(file(".")).
settings(
name := "scalajs-cross-project",
version := "0.1-SNAPSHOT",
scalaVersion := "2.11.7",
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % "3.0.0-M15" % "test"
)
).
jvmSettings(
).
jsSettings(
libraryDependencies += "be.doeraene" %%% "scalajs-jquery" % "0.9.0",
jsDependencies += "org.webjars" % "jquery" % "2.1.1" / "jquery.js",
jsDependencies += RuntimeDOM,
skip in packageJSDependencies := false,
scalaJSUseRhino in Global := false,
persistLauncher in Compile := true,
persistLauncher in Test := false
)
lazy val crossedJVM = crossed.jvm
lazy val crossedJS = crossed.js.enablePlugins(ScalaJSPlugin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment