-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.sbt
68 lines (56 loc) · 2.22 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
import sbt.Project.projectToRef
lazy val monixVersion = "2.2.4"
lazy val commonSettings = Seq(
version := "1.0",
organization := "io.monix",
scalaVersion := "2.11.9"
)
lazy val server = (project in file("server")).settings(commonSettings).settings(
name := "monix-sample-server",
scalaJSProjects := Seq(client),
pipelineStages in Assets := Seq(scalaJSPipeline),
pipelineStages := Seq(digest, gzip),
// triggers scalaJSPipeline when using compile or continuous compilation
compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value,
libraryDependencies ++= Seq(
"com.vmunier" %% "scalajs-scripts" % "1.0.0",
"org.webjars" % "jquery" % "1.12.4",
"org.webjars.bower" % "epoch" % "0.6.0",
"org.webjars" % "d3js" % "3.5.17",
"io.monix" %% "monix" % monixVersion,
"com.typesafe.scala-logging" %% "scala-logging" % "3.4.0"
),
// Heroku specific
herokuAppName in Compile := "monix-sample",
herokuSkipSubProjects in Compile := false,
// Play Framework
routesGenerator := InjectedRoutesGenerator)
.enablePlugins(PlayScala)
.aggregate(client)
.dependsOn(sharedJvm)
lazy val client = (project in file("client"))
.enablePlugins(ScalaJSPlugin, ScalaJSWeb)
.dependsOn(sharedJs)
.settings(commonSettings)
.settings(
name := "monix-sample-client",
scalaJSUseMainModuleInitializer := true,
scalaJSUseMainModuleInitializer in Test := false,
// sourceMapsDirectories += sharedJs.base / "..",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.1",
"io.monix" %%% "monix" % monixVersion
)
)
lazy val shared = (crossProject.crossType(CrossType.Pure) in file("shared"))
.settings(commonSettings)
.settings(name := "monix-sample-shared")
.jsConfigure(_ enablePlugins ScalaJSWeb)
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js
// loads the Play project at sbt startup
onLoad in Global := (Command.process("project server", _: State)) compose (onLoad in Global).value
// for Eclipse users
EclipseKeys.skipParents in ThisBuild := false
// Compile the project before generating Eclipse files, so that generated .scala or .class files for views and routes are present
EclipseKeys.preTasks := Seq(compile in (server, Compile))