aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
Diffstat (limited to 'project')
-rw-r--r--project/Build.scala129
-rw-r--r--project/Dependencies.scala26
-rw-r--r--project/Js.scala24
-rw-r--r--project/MavigatorBuild.scala49
-rw-r--r--project/build.properties2
-rw-r--r--project/plugins.sbt19
6 files changed, 109 insertions, 140 deletions
diff --git a/project/Build.scala b/project/Build.scala
deleted file mode 100644
index be570b2..0000000
--- a/project/Build.scala
+++ /dev/null
@@ -1,129 +0,0 @@
-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._
-
-import sbtunidoc.Plugin._
-
-import com.typesafe.sbt.SbtSite._
-import com.typesafe.sbt.SbtGhPages._
-import com.typesafe.sbt.SbtGit._
-
-object ApplicationBuild extends Build {
-
- // settings common to all projects
- val commonSettings = Seq(
- scalaVersion := "2.11.6",
- scalacOptions ++= Seq("-feature", "-deprecation")
- )
-
- // root super-project
- lazy val root = (
- Project("root", file("."))
- settings(commonSettings: _*)
- settings(unidocSettings: _*)
- settings(site.settings: _*)
- settings(ghpages.settings: _*)
- settings(
- //goto main project on load
- onLoad in Global := (Command.process("project vfd-main", _: State)) compose (onLoad in Global).value,
- site.addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), "latest/api"),
- git.remoteRepo := "git@github.com:jodersky/vfd.git"
- )
- aggregate(
- bindings,
- main,
- uav,
- dashboard,
- index
- )
- )
-
- // empty project that uses SbtMavlink to generate protocol bindings
- lazy val bindings = (
- Project("vfd-bindings", file("vfd-bindings"))
- enablePlugins(SbtMavlink)
- enablePlugins(ScalaJSPlugin)
- settings(commonSettings: _*)
- settings(
- mavlinkDialect := baseDirectory.value / "mavlink" / "common.xml"
- )
- )
-
- // main play project
- lazy val main = (
- Project("vfd-main", file("vfd-main"))
- enablePlugins(PlayScala)
- dependsOn(bindings)
- dependsOn(uav)
- settings(commonSettings: _*)
- settings(
- scalaJSProjects := Seq(dashboard, index),
- pipelineStages := Seq(scalaJSProd),
- libraryDependencies ++= Seq(
- "org.webjars" % "bootstrap" % "3.3.4",
- "org.webjars" % "font-awesome" % "4.3.0"
- )
- )
- aggregate(
- projectToRef(dashboard),
- projectToRef(index)
- )
- )
-
- // communication backend
- lazy val uav = (
- Project("vfd-uav", file("vfd-uav"))
- dependsOn(bindings)
- settings(commonSettings: _*)
- settings(
- libraryDependencies ++= Seq(
- "com.typesafe.akka" %% "akka-actor" % "2.3.10",
- "com.github.jodersky" %% "flow" % "2.1.1",
- "com.github.jodersky" % "flow-native" % "2.1.1"
- )
- )
- )
-
- // web frontends
- val scalajsSettings = Seq(
- libraryDependencies ++= Seq(
- "org.scala-js" %%% "scalajs-dom" % "0.8.0",
- "com.lihaoyi" %%% "scalatags" % "0.5.2",
- "com.lihaoyi" %%% "scalarx" % "0.2.8"
- )
- )
-
- // main cockpit front-end
- lazy val dashboard = (
- Project("vfd-dashboard", file("vfd-dashboard"))
- enablePlugins(ScalaJSPlugin)
- enablePlugins(ScalaJSPlay)
- dependsOn(bindings)
- settings(commonSettings: _*)
- settings(scalajsSettings: _*)
- )
-
- // landing page providing selection of drone
- lazy val index = (
- Project("vfd-index", file("vfd-index"))
- enablePlugins(ScalaJSPlugin)
- enablePlugins(ScalaJSPlay)
- dependsOn(bindings)
- settings(commonSettings: _*)
- settings(scalajsSettings: _*)
- )
-
-}
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
new file mode 100644
index 0000000..02e11b5
--- /dev/null
+++ b/project/Dependencies.scala
@@ -0,0 +1,26 @@
+package mavigator
+
+import sbt._
+import sbt.Keys._
+import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
+
+object Dependencies {
+
+ final val AkkaVersion = "2.4.2-RC1"
+ val akkaActor = "com.typesafe.akka" %% "akka-actor" % AkkaVersion
+ val akkaHttp = "com.typesafe.akka" %% "akka-http-experimental" % AkkaVersion
+ val akkaHttpCore = "com.typesafe.akka" %% "akka-http-core" % AkkaVersion
+ val akkaStream = "com.typesafe.akka" %% "akka-stream" % AkkaVersion
+
+ val reactiveStreams = "org.reactivestreams" % "reactive-streams" % "1.0.0"
+
+ final val FlowVersion = "2.5.0-M1"
+ val flow = "com.github.jodersky" %% "flow-core" % FlowVersion
+ val flowNative = "com.github.jodersky" % "flow-native" % FlowVersion % Runtime
+ val flowStream = "com.github.jodersky" % "flow-stream" % FlowVersion
+
+ val jsDom = Def.setting{"org.scala-js" %%% "scalajs-dom" % "0.8.2"}
+ val scalatags = Def.setting{"com.lihaoyi" %%% "scalatags" % "0.5.4"}
+ val scalarx = Def.setting{"com.lihaoyi" %%% "scalarx" % "0.2.8"}
+
+}
diff --git a/project/Js.scala b/project/Js.scala
new file mode 100644
index 0000000..d665eab
--- /dev/null
+++ b/project/Js.scala
@@ -0,0 +1,24 @@
+package mavigator
+
+import sbt._
+import sbt.Keys._
+import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
+
+object Js {
+
+ def dependsOnJs(proj: Project): Seq[Setting[_]] = Seq(
+ resourceGenerators in Compile += Def.task{
+ val js: File = (fullOptJS in (proj, Compile)).value.data
+ val map = js.getParentFile / (js.name + ".map")
+
+ val out = (resourceManaged in Compile).value / "assets" / "js"
+
+ val toCopy = Seq(
+ js -> out / js.name,
+ map -> out / map.name
+ )
+ IO.copy(toCopy).toSeq
+ }.taskValue
+ )
+
+}
diff --git a/project/MavigatorBuild.scala b/project/MavigatorBuild.scala
new file mode 100644
index 0000000..e46d5f2
--- /dev/null
+++ b/project/MavigatorBuild.scala
@@ -0,0 +1,49 @@
+package mavigator
+
+import sbt._
+import sbt.Keys._
+import sbt.Project.projectToRef
+
+object MavigatorBuild extends Build {
+
+ // settings common to all projects
+ val defaultSettings = Seq(
+ scalaVersion := "2.11.7",
+ scalacOptions ++= Seq("-feature", "-deprecation")
+ )
+
+ // root super-project
+ lazy val root = Project(
+ id = "root",
+ base = file("."),
+ aggregate = Seq(bindings, uav, server, cockpit)
+ )
+
+ // empty project that uses SbtMavlink to generate protocol bindings
+ lazy val bindings = Project(
+ id = "mavigator-bindings",
+ base = file("mavigator-bindings")
+ )
+
+ // main akka http server project
+ lazy val server = Project(
+ id = "mavigator-server",
+ base = file("mavigator-server"),
+ dependencies = Seq(bindings, uav)
+ )
+
+ // communication backend
+ lazy val uav = Project(
+ id = "mavigator-uav",
+ base = file("mavigator-uav"),
+ dependencies = Seq(bindings)
+ )
+
+ // main cockpit front-end
+ lazy val cockpit = Project(
+ id = "mavigator-cockpit",
+ base = file("mavigator-cockpit"),
+ dependencies = Seq(bindings)
+ )
+
+}
diff --git a/project/build.properties b/project/build.properties
index a6e117b..817bc38 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1 +1 @@
-sbt.version=0.13.8
+sbt.version=0.13.9
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 06a9a7b..152f34e 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -11,17 +11,14 @@ resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
* Main plugins
*/
-// play web framework
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.9")
-
// add support for scalajs
-addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.2")
+addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.6")
-// enable "smooth" dependencies between play and scalajs projects
-addSbtPlugin("com.vmunier" % "sbt-play-scalajs" % "0.2.3")
+// twirl html templating
+addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.1.1")
// generate MAVLink protocol bindings
-addSbtPlugin("com.github.jodersky" % "sbt-mavlink" % "0.5.1")
+addSbtPlugin("com.github.jodersky" % "sbt-mavlink" % "0.5.2")
/*
@@ -29,10 +26,12 @@ addSbtPlugin("com.github.jodersky" % "sbt-mavlink" % "0.5.1")
*/
// automate publishing documentation
-addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1")
+//addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.2")
// publish to github pages
-addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3")
+//addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4")
// generate documentation for all projects
-addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.2")
+//addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.3")
+
+addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0")