From c77bf21e7f4c197d34d23b2aebe5953a75d099e2 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Tue, 22 Dec 2015 14:52:11 +0100 Subject: Update versions and build confuguration --- build.sbt | 2 + project/Build.scala | 129 ----------------------------------------------- project/ScalaJS.scala | 16 ++++++ project/VfdBuild.scala | 60 ++++++++++++++++++++++ project/build.properties | 2 +- project/plugins.sbt | 12 ++--- vfd-bindings/build.sbt | 8 +++ vfd-dashboard/build.sbt | 8 +++ vfd-index/build.sbt | 8 +++ vfd-main/build.sbt | 12 +++++ vfd-uav/build.sbt | 9 ++++ 11 files changed, 130 insertions(+), 136 deletions(-) create mode 100644 build.sbt delete mode 100644 project/Build.scala create mode 100644 project/ScalaJS.scala create mode 100644 project/VfdBuild.scala create mode 100644 vfd-bindings/build.sbt create mode 100644 vfd-dashboard/build.sbt create mode 100644 vfd-index/build.sbt create mode 100644 vfd-main/build.sbt create mode 100644 vfd-uav/build.sbt diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..0941ea1 --- /dev/null +++ b/build.sbt @@ -0,0 +1,2 @@ +//goto main project on load +onLoad in Global := (Command.process("project vfd-main", _: State)) compose (onLoad in Global).value 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/ScalaJS.scala b/project/ScalaJS.scala new file mode 100644 index 0000000..49f23ad --- /dev/null +++ b/project/ScalaJS.scala @@ -0,0 +1,16 @@ +package vfd + +import sbt.Keys._ +import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ + +object ScalaJS { + + val settings = Seq( + libraryDependencies ++= Seq( + "org.scala-js" %%% "scalajs-dom" % "0.8.0", + "com.lihaoyi" %%% "scalatags" % "0.5.2", + "com.lihaoyi" %%% "scalarx" % "0.2.8" + ) + ) + +} diff --git a/project/VfdBuild.scala b/project/VfdBuild.scala new file mode 100644 index 0000000..a80d62c --- /dev/null +++ b/project/VfdBuild.scala @@ -0,0 +1,60 @@ +package vfd + +import sbt._ +import sbt.Keys._ +import sbt.Project.projectToRef + +object VfdBuild 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, main, uav, dashboard, index) + ) + + // empty project that uses SbtMavlink to generate protocol bindings + lazy val bindings = Project( + id = "vfd-bindings", + base = file("vfd-bindings") + ) + + // main play project + lazy val main = Project( + id = "vfd-main", + base = file("vfd-main"), + dependencies = Seq(bindings, uav), + aggregate = Seq( + projectToRef(dashboard), + projectToRef(index) + ) + ) + + // communication backend + lazy val uav = Project( + id = "vfd-uav", + base = file("vfd-uav"), + dependencies = Seq(bindings) + ) + + // main cockpit front-end + lazy val dashboard = Project( + id = "vfd-dashboard", + base = file("vfd-dashboard"), + dependencies = Seq(bindings) + ) + + // landing page providing selection of drone + lazy val index = Project( + id = "vfd-index", + base = file("vfd-index"), + 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..71b5073 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -12,16 +12,16 @@ resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven" */ // play web framework -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.9") +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.6") // add support for scalajs -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.2") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.5") // enable "smooth" dependencies between play and scalajs projects addSbtPlugin("com.vmunier" % "sbt-play-scalajs" % "0.2.3") // generate MAVLink protocol bindings -addSbtPlugin("com.github.jodersky" % "sbt-mavlink" % "0.5.1") +addSbtPlugin("com.github.jodersky" % "sbt-mavlink" % "0.5.2") /* @@ -29,10 +29,10 @@ 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") diff --git a/vfd-bindings/build.sbt b/vfd-bindings/build.sbt new file mode 100644 index 0000000..d5870e1 --- /dev/null +++ b/vfd-bindings/build.sbt @@ -0,0 +1,8 @@ +import vfd.VfdBuild + +enablePlugins(SbtMavlink) +enablePlugins(ScalaJSPlugin) + +VfdBuild.defaultSettings + +mavlinkDialect := baseDirectory.value / "mavlink" / "common.xml" diff --git a/vfd-dashboard/build.sbt b/vfd-dashboard/build.sbt new file mode 100644 index 0000000..31b502d --- /dev/null +++ b/vfd-dashboard/build.sbt @@ -0,0 +1,8 @@ +import vfd.{ScalaJS, VfdBuild} + +enablePlugins(ScalaJSPlugin) +enablePlugins(ScalaJSPlay) + +VfdBuild.defaultSettings + +ScalaJS.settings diff --git a/vfd-index/build.sbt b/vfd-index/build.sbt new file mode 100644 index 0000000..31b502d --- /dev/null +++ b/vfd-index/build.sbt @@ -0,0 +1,8 @@ +import vfd.{ScalaJS, VfdBuild} + +enablePlugins(ScalaJSPlugin) +enablePlugins(ScalaJSPlay) + +VfdBuild.defaultSettings + +ScalaJS.settings diff --git a/vfd-main/build.sbt b/vfd-main/build.sbt new file mode 100644 index 0000000..4357a93 --- /dev/null +++ b/vfd-main/build.sbt @@ -0,0 +1,12 @@ +import vfd.VfdBuild + +enablePlugins(PlayScala) + +VfdBuild.defaultSettings + +scalaJSProjects := Seq(dashboard, index) +pipelineStages := Seq(scalaJSProd) +libraryDependencies ++= Seq( + "org.webjars" % "bootstrap" % "3.3.4", + "org.webjars" % "font-awesome" % "4.3.0" +) diff --git a/vfd-uav/build.sbt b/vfd-uav/build.sbt new file mode 100644 index 0000000..40d2182 --- /dev/null +++ b/vfd-uav/build.sbt @@ -0,0 +1,9 @@ +import vfd.VfdBuild + +VfdBuild.defaultSettings + +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" +) -- cgit v1.2.3