diff options
author | Jakob Odersky <jodersky@gmail.com> | 2015-03-31 13:58:03 +0200 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2015-04-01 14:23:00 +0200 |
commit | 6f76598ae4306c22f84571655c885fc570b897a6 (patch) | |
tree | d0c0b7006df08f8c56307b6b064ccd793a2b89d4 /project/Build.scala | |
parent | e47400b340fc9533058cfaf1ce0b695d9f9bd0eb (diff) | |
download | mavigator-6f76598ae4306c22f84571655c885fc570b897a6.tar.gz mavigator-6f76598ae4306c22f84571655c885fc570b897a6.tar.bz2 mavigator-6f76598ae4306c22f84571655c885fc570b897a6.zip |
Move bindings to central project and generate scaladoc
Diffstat (limited to 'project/Build.scala')
-rw-r--r-- | project/Build.scala | 79 |
1 files changed, 51 insertions, 28 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 |