-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
65 lines (58 loc) · 2.3 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
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
lazy val server = (project in file("server")).settings(commonSettings).settings(
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.1.4",
guice,
specs2 % Test
) ++ Seq(
"io.circe" %% "circe-core",
"io.circe" %% "circe-generic",
"io.circe" %% "circe-parser"
).map(_ % circeVersion),
// 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 Compile)
).enablePlugins(PlayScala).
dependsOn(sharedJvm)
lazy val client = (project in file("client")).settings(commonSettings).settings(
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.7",
"com.thoughtworks.binding" %%% "dom" % "11.8.1",
"com.thoughtworks.binding" %%% "route" % "11.8.1",
"org.scala-lang.modules" %% "scala-xml" % "1.0.5"
) ++ Seq(
"io.circe" %%% "circe-core",
"io.circe" %%% "circe-generic",
"io.circe" %%% "circe-parser"
).map(_ % circeVersion)
).enablePlugins(ScalaJSPlugin, ScalaJSWeb).
dependsOn(sharedJs)
lazy val shared = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("shared"))
.settings(commonSettings).settings(
libraryDependencies ++= Seq(
"io.circe" %% "circe-core",
"io.circe" %% "circe-generic",
"io.circe" %% "circe-parser"
).map(_ % circeVersion)
)
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js
val circeVersion = "0.12.0-M4"
lazy val commonSettings = Seq(
scalaVersion := "2.12.8",
organization := "com.vankempen",
resolvers += "Maven Repo" at "https://jcenter.bintray.com/",
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full),
libraryDependencies ++= Seq(
"be.teletask.onvif" % "onvif" % "1.0.2"
)
)
// loads the server project at sbt startup
onLoad in Global := (onLoad in Global).value andThen {s: State => "project server" :: s}