Skip to content

Instantly share code, notes, and snippets.

@gregghz
Created July 4, 2016 18:09
Show Gist options
  • Save gregghz/0086cd6b82eb2680a41b356e07b296ca to your computer and use it in GitHub Desktop.
Save gregghz/0086cd6b82eb2680a41b356e07b296ca to your computer and use it in GitHub Desktop.
build.sbt for Play 2.5 + Angulate2
import Angulate2Plugin._
lazy val commonSettings = Seq(
organization := "com.gregghz",
version := "1.0.0",
scalaVersion := "2.11.8",
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-Xfatal-warnings"
),
resolvers += Resolver.sonatypeRepo("snapshots")
)
lazy val server = project.in(file("server")).
enablePlugins(PlayScala, PlayScalaJS, SbtWeb).
settings(commonSettings: _*).
settings(
compile in Compile <<= (compile in Compile) dependsOn (fastOptJS in (ngClient, Compile)),
unmanagedResources in Assets += baseDirectory.value / "../ngClient/target/scala-2.11/ngclient-sjsx.js",
scalaJSProjects := Seq(ngClient),
routesGenerator := InjectedRoutesGenerator,
pipelineStages := Seq(scalaJSProd),
libraryDependencies ++= Seq(
"com.softwaremill.macwire" %% "macros" % "2.2.2" % "provided"
)
).
aggregate(Project.projectToRef(ngClient)).
dependsOn(sharedJvm)
lazy val ngClient = project.in(file("ngClient")).
settings(commonSettings: _*).
enablePlugins(Angulate2Plugin, ScalaJSPlugin, ScalaJSPlay).
dependsOn(sharedJs).
settings(relativeSourceMaps := true)
lazy val shared = (crossProject.crossType(CrossType.Pure) in file("shared")).
settings(commonSettings: _*).
jsConfigure(_ enablePlugins ScalaJSPlay)
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment