aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2015-03-31 13:58:03 +0200
committerJakob Odersky <jodersky@gmail.com>2015-04-01 14:23:00 +0200
commit6f76598ae4306c22f84571655c885fc570b897a6 (patch)
treed0c0b7006df08f8c56307b6b064ccd793a2b89d4 /project
parente47400b340fc9533058cfaf1ce0b695d9f9bd0eb (diff)
downloadmavigator-6f76598ae4306c22f84571655c885fc570b897a6.tar.gz
mavigator-6f76598ae4306c22f84571655c885fc570b897a6.tar.bz2
mavigator-6f76598ae4306c22f84571655c885fc570b897a6.zip
Move bindings to central project and generate scaladoc
Diffstat (limited to 'project')
-rw-r--r--project/Build.scala79
-rw-r--r--project/plugins.sbt31
2 files changed, 81 insertions, 29 deletions
diff --git a/project/Build.scala b/project/Build.scala
index c99b088..10dd228 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -15,39 +15,61 @@ 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 common = Seq(
+ // settings common to all projects
+ val commonSettings = Seq(
scalaVersion := "2.11.6",
- scalacOptions ++= Seq("-feature", "-deprecation"),
- mavlinkDialect := (baseDirectory in ThisBuild).value / "mavlink" / "common.xml"
+ scalacOptions ++= Seq("-feature", "-deprecation")
)
- //root super-project
+ // root super-project
lazy val root = (
- Project("root", file(".")).aggregate(
+ 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
)
- settings(common: _*)
+ )
+
+ // 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(
- //goto main project on load
- onLoad in Global := (Command.process("project vfd-main", _: State)) compose (onLoad in Global).value
+ mavlinkDialect := baseDirectory.value / "mavlink" / "common.xml"
)
)
- //main play project
+ // main play project
lazy val main = (
Project("vfd-main", file("vfd-main"))
enablePlugins(PlayScala)
- enablePlugins(SbtMavlink)
- settings(common: _*)
+ dependsOn(bindings)
+ dependsOn(uav)
+ settings(commonSettings: _*)
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(
@@ -56,18 +78,17 @@ object ApplicationBuild extends Build {
"org.webjars" % "jquery" % "2.1.3"
)
)
- dependsOn(uav)
aggregate(
projectToRef(dashboard),
projectToRef(index)
)
)
- //communication backend
+ // communication backend
lazy val uav = (
Project("vfd-uav", file("vfd-uav"))
- enablePlugins(SbtMavlink)
- settings(common: _*)
+ dependsOn(bindings)
+ settings(commonSettings: _*)
settings(
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.3.9",
@@ -77,31 +98,33 @@ object ApplicationBuild extends Build {
)
)
- //web frontends
- val scalajs = Seq(
+ // web frontends
+ val scalajsSettings = Seq(
libraryDependencies ++= Seq(
- "org.scala-js" %%% "scalajs-dom" % "0.8.0",
- "com.lihaoyi" %%% "scalatags" % "0.5.0",
- "com.lihaoyi" %%% "scalarx" % "0.2.8"
+ "org.scala-js" %%% "scalajs-dom" % "0.8.0",
+ "com.lihaoyi" %%% "scalatags" % "0.5.0",
+ "com.lihaoyi" %%% "scalarx" % "0.2.8"
)
)
+ // main cockpit front-end
lazy val dashboard = (
Project("vfd-dashboard", file("vfd-dashboard"))
enablePlugins(ScalaJSPlugin)
enablePlugins(ScalaJSPlay)
- enablePlugins(SbtMavlink)
- settings(common: _*)
- settings(scalajs: _*)
+ 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)
- enablePlugins(SbtMavlink)
- settings(common: _*)
- settings(scalajs: _*)
+ dependsOn(bindings)
+ settings(commonSettings: _*)
+ settings(scalajsSettings: _*)
)
} \ No newline at end of file
diff --git a/project/plugins.sbt b/project/plugins.sbt
index d47ecca..4a09da5 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,9 +1,38 @@
+/*
+ * Additional resolvers
+ */
+
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"
+resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
+
+
+/*
+ * Main plugins
+ */
+
+// play web framework
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")
+// add support for scalajs
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.2")
+// enable "smooth" dependencies between play and scalajs projects
addSbtPlugin("com.vmunier" % "sbt-play-scalajs" % "0.2.3")
-addSbtPlugin("com.github.jodersky" % "sbt-mavlink" % "0.5.0")
+// generate MAVLink protocol bindings
+addSbtPlugin("com.github.jodersky" % "sbt-mavlink" % "0.5.1")
+
+
+/*
+ * Utility or meta plugins
+ */
+
+// automate publishing documentation
+addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1")
+
+// publish to github pages
+addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3")
+
+// generate documentation for all projects
+addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.2") \ No newline at end of file