-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.sbt
70 lines (60 loc) · 2.38 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 root = (project in file(".")).aggregate(gvCoreJs, gvCoreJvm, gvClientServerJs, gvClientServerJvm).settings(
publish := {},
publishLocal := {}
)
lazy val sharedSettings = Seq(
organization := "uk.co.turingatemyhamster",
scalaVersion := "2.11.7",
scalacOptions ++= Seq("-deprecation", "-unchecked"),
version := "0.4.1",
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html"))
)
lazy val gvCore = crossProject.in(file("gv-core")).settings(sharedSettings :_*).settings(
name := "gv-core",
libraryDependencies += "com.lihaoyi" %%% "fastparse" % "0.3.4",
libraryDependencies += "com.lihaoyi" %% "utest" % "0.4.3" % "test",
testFrameworks += new TestFramework("utest.runner.Framework")
)
lazy val gvCoreJs = gvCore.js
lazy val gvCoreJvm = gvCore.jvm.settings(
libraryDependencies ++= Seq("org.specs2" %% "specs2-core" % "3.8.3" % "test"),
scalacOptions in Test ++= Seq("-Yrangepos")
)
lazy val gvClientServer = crossProject.in(file("gv-clientServer")).settings(sharedSettings :_*).settings(
name := "gv-clientServer"
).dependsOn(gvCore)
lazy val gvClientServerJs = gvClientServer.js.settings(
persistLauncher in Compile := true,
persistLauncher in Test := false,
libraryDependencies += "io.github.widok" %%% "widok" % "0.3.0-SNAPSHOT"
)
lazy val gvClientServerJvm = gvClientServer.jvm
.enablePlugins(SbtWeb, sbtdocker.DockerPlugin, JavaAppPackaging)
.dependsOn(gvClientServerJs)
.settings(
libraryDependencies += "com.typesafe.akka" %% "akka-http-experimental" % "2.4.5",
(resources in Assets) += {
(fastOptJS in (gvClientServerJs, Compile)).value
(artifactPath in (gvClientServerJs, Compile, fastOptJS)).value
},
(resources in Assets) += {
(fastOptJS in (gvClientServerJs, Compile)).value
(artifactPath in (gvClientServerJs, Compile, packageScalaJSLauncher)).value
},
(resources in Assets) += {
(fastOptJS in (gvClientServerJs, Compile)).value
(artifactPath in (gvClientServerJs, Compile, packageJSDependencies)).value
},
(managedClasspath in Runtime) += (packageBin in Assets).value,
dockerfile in docker := {
val appDir: File = stage.value
val targetDir = "/app"
new Dockerfile {
from("java:8-jre")
runRaw("""apt-get update && apt-get install -y graphviz""")
entryPoint(s"$targetDir/bin/${executableScriptName.value}")
copy(appDir, targetDir)
expose(10080)
}
}
)