This repository has been archived by the owner on Jun 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
70 lines (61 loc) · 1.89 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
lazy val clients = Seq(client)
lazy val scalaV = "2.11.7"
lazy val sharedSettings = Seq(
organization := "tmt",
scalaVersion := scalaV,
transitiveClassifiers in Global := Seq(Artifact.SourceClassifier),
updateOptions := updateOptions.value.withCachedResolution(true),
libraryDependencies ++= Dependencies.sharedLibs.value,
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-feature",
"-Xlint",
"-Ywarn-dead-code",
"-encoding", "UTF-8" // yes, this is 2 args
)
) ++ net.virtualvoid.sbt.graph.Plugin.graphSettings
lazy val client = project
.enablePlugins(ScalaJSPlugin, ScalaJSPlay)
.dependsOn(sharedJs)
.settings(sharedSettings: _*)
.settings(
persistLauncher := true,
persistLauncher in Test := false,
libraryDependencies ++= Dependencies.clientLibs.value
)
lazy val common = project
.dependsOn(sharedJvm)
.settings(sharedSettings: _*)
.settings(
fork := true,
libraryDependencies ++= Dependencies.commonLibs
)
lazy val aggProjects = (clients :+ backend :+ common).map(Project.projectToRef)
lazy val frontend = project
.enablePlugins(PlayScala)
.dependsOn(common)
.aggregate(aggProjects: _*)
.settings(sharedSettings: _*)
.settings(
routesGenerator := InjectedRoutesGenerator,
scalaJSProjects := clients,
pipelineStages := Seq(scalaJSProd, gzip),
libraryDependencies ++= Dependencies.frontendLibs
)
lazy val backend = project
.dependsOn(common)
.settings(sharedSettings: _*)
.settings(
fork := true,
libraryDependencies ++= Dependencies.backendLibs
)
lazy val shared = crossProject.crossType(CrossType.Pure)
.jsConfigure(_ enablePlugins ScalaJSPlay)
.settings(sharedSettings: _*)
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js
// loads the Play project at sbt startup
onLoad in Global := (onLoad in Global).value.andThen { state =>
Command.process("project frontend", state)
}