-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
82 lines (69 loc) · 2.67 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
71
72
73
74
75
76
77
78
79
80
81
82
import sbt.Project.projectToRef
lazy val clients = Seq(scalajsclient)
lazy val scalaV = "2.11.8"
lazy val playserver = (project in file("play")).settings(
scalaVersion := scalaV,
scalaJSProjects := clients,
libraryDependencies ++= Seq(
"com.lihaoyi" %% "scalatags" % "0.5.5",
"org.webjars" % "jquery" % "3.0.0"
)
).enablePlugins(PlayScala, LagomPlay).
aggregate(clients.map(projectToRef): _*).
dependsOn(sharedJvm)
lazy val scalajsclient = (project in file("scalajs")).settings(
scalaVersion := scalaV,
persistLauncher := true,
persistLauncher in Test := false,
unmanagedSourceDirectories in Compile := Seq((scalaSource in Compile).value),
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.1",
"com.lihaoyi" %%% "scalatags" % "0.5.5"
)
).enablePlugins(ScalaJSPlugin, ScalaJSPlay)
.dependsOn(sharedJs)
lazy val shared = (crossProject.crossType(CrossType.Pure) in file("shared")).
settings(scalaVersion := scalaV).
jsConfigure(_ enablePlugins ScalaJSPlay)
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js
lazy val timeApi = commonSettings("time-api")
.settings(
scalaVersion := scalaV,
libraryDependencies += lagomJavadslApi
)
lazy val timeImpl = commonSettings("time-impl")
.enablePlugins(LagomJava)
.settings(
scalaVersion := scalaV,
libraryDependencies ++= Seq(
//lagomJavadslPersistence,
lagomJavadslTestKit
)
)
.settings(lagomForkedTestSettings: _*)
.dependsOn(timeApi)
def commonSettings(id: String) = Project(id, base = file(id))
.settings(eclipseSettings: _*)
.settings(javacOptions in compile ++= Seq("-encoding", "UTF-8", "-source", "1.8", "-target", "1.8", "-Xlint:unchecked", "-Xlint:deprecation"))
.settings(jacksonParameterNamesJavacSettings: _*) // applying it to every project even if not strictly needed.
// loads the Play project at sbt startup
onLoad in Global := (Command.process("project playserver", _: State)) compose (onLoad in Global).value
//See https://github.com/FasterXML/jackson-module-parameter-names
lazy val jacksonParameterNamesJavacSettings = Seq(
javacOptions in compile += "-parameters"
)
//Configuration of sbteclipse
//Needed for importing the project into Eclipse
EclipseKeys.skipParents in ThisBuild := false
lazy val eclipseSettings = Seq(
EclipseKeys.projectFlavor := EclipseProjectFlavor.Scala,
EclipseKeys.withBundledScalaContainers := false,
EclipseKeys.createSrc := EclipseCreateSrc.Default + EclipseCreateSrc.Resource,
EclipseKeys.eclipseOutput := Some(".target"),
EclipseKeys.withSource := true,
EclipseKeys.withJavadoc := true
)
// do not delete database files on start
lagomCassandraCleanOnStart in ThisBuild := false
fork in run := true