aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2014-11-06 10:28:36 +0100
committerJakob Odersky <jodersky@gmail.com>2014-11-06 10:28:36 +0100
commit2915f8bf09b4d4db6f5e1b574ba988a0fc0fb90a (patch)
treefe5da7fd7b93feb8682a0beb65bc501482d75839 /project
parent850863823caf3c33e7f020d43877143ce8de00f5 (diff)
downloadmavigator-2915f8bf09b4d4db6f5e1b574ba988a0fc0fb90a.tar.gz
mavigator-2915f8bf09b4d4db6f5e1b574ba988a0fc0fb90a.tar.bz2
mavigator-2915f8bf09b4d4db6f5e1b574ba988a0fc0fb90a.zip
migrate to using mavlink
Diffstat (limited to 'project')
-rw-r--r--project/Build.scala13
-rw-r--r--project/Dependencies.scala2
-rw-r--r--project/plugins.sbt2
-rw-r--r--project/util.scala36
4 files changed, 28 insertions, 25 deletions
diff --git a/project/Build.scala b/project/Build.scala
index fe249df..fe49146 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -10,20 +10,31 @@ import Dependencies._
object ApplicationBuild extends Build {
+ //settings common to all projects
val common = Seq(
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature", "-deprecation")
)
+ //settings for js/jvm projects using shared sources
+ val shared = Seq(
+ unmanagedSourceDirectories in Compile += (scalaSource in (mavlink, Compile)).value
+ )
+
lazy val root = Project("root", file(".")).aggregate(
uav,
backend,
frontend
)
+ lazy val mavlink = (
+ Project("vfd-mavlink", file("vfd-mavlink"))
+ )
+
lazy val uav = (
Project("vfd-uav", file("vfd-uav"))
settings(common: _*)
+ settings(shared: _*)
settings(
libraryDependencies ++= Seq(
akkaActor,
@@ -38,7 +49,6 @@ object ApplicationBuild extends Build {
enablePlugins(PlayScala)
settings(common: _*)
settings(
- relativeSourceMaps := true,
resolvers += Resolver.url("scala-js-releases", url("http://dl.bintray.com/content/scala-js/scala-js-releases"))(Resolver.ivyStylePatterns),
libraryDependencies ++= Seq(
bootstrap,
@@ -54,6 +64,7 @@ object ApplicationBuild extends Build {
Project("vfd-frontend", file("vfd-frontend"))
settings(ScalaJSPlugin.scalaJSSettings: _*)
settings(common: _*)
+ settings(shared: _*)
settings(
libraryDependencies ++= Seq(
rx,
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 6c705eb..8aa8e03 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -15,5 +15,5 @@ object Dependencies {
val dom = "org.scala-lang.modules.scalajs" %%%! "scalajs-dom" % "0.6"
val tag = "com.scalatags" %%%! "scalatags" % "0.4.1"
val rx = "com.scalarx" %%%! "scalarx" % "0.2.6"
-
+
} \ No newline at end of file
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 6678905..2c768c0 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,7 +1,7 @@
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// The Play plugin
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.6")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.4")
// Scala.js plugin
addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.5") \ No newline at end of file
diff --git a/project/util.scala b/project/util.scala
index 993fa40..497adc1 100644
--- a/project/util.scala
+++ b/project/util.scala
@@ -1,35 +1,27 @@
import sbt._
-import Keys._
-import play.Play._
-import scala.scalajs.sbtplugin.ScalaJSPlugin._
-import ScalaJSKeys._
+import sbt.Keys._
+import play._
+import play.PlayImport.PlayKeys._
+import scala.scalajs.sbtplugin.ScalaJSPlugin
+import scala.scalajs.sbtplugin.ScalaJSPlugin.ScalaJSKeys._
import com.typesafe.sbt.packager.universal.UniversalKeys
package object util extends UniversalKeys {
- val scalajsOutputDir = Def.settingKey[File]("directory for javascript files output by scalajs")
+ implicit class ScalaJSPlayProject(val scalajvm: Project) {
+ val jsOutputDir = settingKey[File]("Directory for javascript files")
- implicit class ScalaJSPlayProject(val project: Project) {
-
- private def copySourceMapsTask(scalajs: Project) = Def.task {
- val scalaFiles = (Seq(scalajs.base) ** ("*.scala")).get
- for (scalaFile <- scalaFiles) {
- val target = new File((classDirectory in Compile).value, scalaFile.getPath)
- IO.copyFile(scalaFile, target)
- }
- }
-
- def dependsOnJs(scalajs: Project): Project = project.settings(
- scalajsOutputDir := (classDirectory in Compile).value / "public" / "lib",
- compile in Compile <<= (compile in Compile) dependsOn (fastOptJS in (scalajs, Compile)) dependsOn copySourceMapsTask(scalajs),
+ def dependsOnJs(scalajs: Project): Project = scalajvm.settings(
+ jsOutputDir := (classDirectory in Compile).value / "public" / "lib",
+ compile in Compile <<= (compile in Compile) dependsOn (fastOptJS in (scalajs, Compile)),
dist <<= dist dependsOn (fullOptJS in (scalajs, Compile)),
- stage <<= stage dependsOn (fullOptJS in (scalajs, Compile))
+ stage <<= stage dependsOn (fullOptJS in (scalajs, Compile)),
+ playMonitoredFiles += (scalaSource in (scalajs, Compile)).value.getCanonicalPath
).settings(
- // ask scalajs project to put its outputs in scalajsOutputDir
Seq(packageLauncher, fastOptJS, fullOptJS) map { packageJSKey =>
- crossTarget in (scalajs, Compile, packageJSKey) := scalajsOutputDir.value
- } : _*
+ crossTarget in (scalajs, Compile, packageJSKey) := jsOutputDir.value
+ }: _*
)
}