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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
import sbt._
import sbt.Keys._
import sbt.Project.projectToRef
import play._
import play.PlayImport.PlayKeys._
import org.scalajs.sbtplugin.ScalaJSPlugin
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import com.github.jodersky.mavlink.sbt._
import com.github.jodersky.mavlink.sbt.MavlinkKeys._
import playscalajs.ScalaJSPlay
import playscalajs.PlayScalaJS.autoImport._
import com.typesafe.sbt.web.Import._
object ApplicationBuild extends Build {
//settings common to all projects
val common = Seq(
scalaVersion := "2.11.6",
scalacOptions ++= Seq("-feature", "-deprecation"),
mavlinkDialect := (baseDirectory in ThisBuild).value / "mavlink" / "common.xml"
)
//root super-project
lazy val root = (
Project("root", file(".")).aggregate(
main,
uav,
dashboard,
index
)
settings(common: _*)
settings(
//goto main project on load
onLoad in Global := (Command.process("project vfd-main", _: State)) compose (onLoad in Global).value
)
)
//main play project
lazy val main = (
Project("vfd-main", file("vfd-main"))
enablePlugins(PlayScala)
enablePlugins(SbtMavlink)
settings(common: _*)
settings(
resolvers += Resolver.url("scala-js-releases", url("http://dl.bintray.com/content/scala-js/scala-js-releases"))(Resolver.ivyStylePatterns),
scalaJSProjects := Seq(dashboard, index),
pipelineStages := Seq(scalaJSProd),
libraryDependencies ++= Seq(
"org.webjars" % "bootstrap" % "3.3.1",
"org.webjars" % "font-awesome" % "4.2.0",
"org.webjars" % "jquery" % "2.1.3"
)
)
dependsOn(uav)
aggregate(
projectToRef(dashboard),
projectToRef(index)
)
)
//communication backend
lazy val uav = (
Project("vfd-uav", file("vfd-uav"))
enablePlugins(SbtMavlink)
settings(common: _*)
settings(
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.3.9",
"com.github.jodersky" %% "flow" % "2.1.0",
"com.github.jodersky" % "flow-native" % "2.1.0"
)
)
)
//web frontends
val scalajs = Seq(
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.8.0",
"com.lihaoyi" %%% "scalatags" % "0.4.6",
"com.lihaoyi" %%% "scalarx" % "0.2.8"
)
)
lazy val dashboard = (
Project("vfd-dashboard", file("vfd-dashboard"))
enablePlugins(ScalaJSPlugin)
enablePlugins(ScalaJSPlay)
enablePlugins(SbtMavlink)
settings(common: _*)
settings(scalajs: _*)
)
lazy val index = (
Project("vfd-index", file("vfd-index"))
enablePlugins(ScalaJSPlugin)
enablePlugins(ScalaJSPlay)
enablePlugins(SbtMavlink)
settings(common: _*)
settings(scalajs: _*)
)
}
|