-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
68 lines (57 loc) · 2.37 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
val akkaVersion = "2.5.3"
val akkaHttpVersion = "10.0.9"
val app = crossProject.in(file(".")).settings(
unmanagedSourceDirectories in Compile += baseDirectory.value / "shared" / "main" / "scala",
libraryDependencies ++= Seq(
"com.lihaoyi" %%% "scalatags" % "0.6.5",
"com.lihaoyi" %%% "upickle" % "0.4.4"
),
scalaVersion := "2.12.3",
name := "bard2"
).jsSettings(
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.2",
"be.doeraene" %%% "scalajs-jquery" % "0.9.1"
)
).jvmSettings(
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-persistence" % akkaVersion,
"com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion,
"com.github.romix.akka" %% "akka-kryo-serialization" % "0.5.2",
"org.iq80.leveldb" % "leveldb" % "0.7",
"org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8",
"com.github.scullxbones" %% "akka-persistence-mongo-casbah" % "1.4.1",
"org.mongodb" %% "casbah" % "3.1.1",
"ch.qos.logback" % "logback-classic" % "1.1.3"
)
)
lazy val fastOptJSDev = TaskKey[Unit]("fastOptJSDev")
lazy val appJS = app.js
.disablePlugins(RevolverPlugin)
.enablePlugins(WorkbenchPlugin)
.settings(
fastOptJSDev := {
// resources
val targetRes = "../target/scala-2.12/classes/"
IO.copyDirectory((resourceDirectory in Compile).value, new File(baseDirectory.value, targetRes))
// fastopt.js
val fastOptFrom = (fastOptJS in Compile).value.data
val fastOptTo = new File(baseDirectory.value, targetRes + fastOptFrom.name)
IO.copyFile(fastOptFrom, fastOptTo)
// fastopt.js.map
val mapFileName = fastOptFrom.name + ".map"
val fastOptMapFrom = fastOptFrom.getParentFile / mapFileName
val fastOptMapTo = new File(baseDirectory.value, targetRes + mapFileName)
IO.copyFile(fastOptMapFrom, fastOptMapTo)
}
)
lazy val appJVM = app.jvm.settings(
(resources in Compile) += (fullOptJS in (appJS, Compile)).value.data,
(unmanagedResourceDirectories in Compile) += (resourceDirectory in (appJS, Compile)).value,
target := baseDirectory.value / ".." / "target"
).enablePlugins(JavaAppPackaging)
disablePlugins(RevolverPlugin)