Created
September 3, 2014 22:56
-
-
Save benjaminjackman/6b902781e9aa542375d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import Keys._ | |
import scala.scalajs.sbtplugin.env.nodejs.NodeJSEnv | |
import scala.scalajs.sbtplugin.ScalaJSPlugin._ | |
import scala.scalajs.sbtplugin.ScalaJSPlugin.ScalaJSKeys._ | |
object Build extends sbt.Build{ | |
val commonSettings = Seq[Setting[_]]( | |
scalaVersion := "2.11.2", | |
version := "0.1.0", | |
organization := "uk.co.turingatemyhamster", | |
autoCompilerPlugins := true, | |
addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.2"), | |
// Sonatype | |
publishArtifact in Test := false, | |
publishTo <<= version { (v: String) => | |
Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2") | |
}, | |
libraryDependencies ++= Seq( | |
"com.lihaoyi" %% "acyclic" % "0.1.2" % "provided" | |
), | |
pomExtra := | |
<url>https://github.com/turingatemyhamster/datatree</url> | |
<developers> | |
<developer> | |
<id>turingatemyhamster</id> | |
<name>Matthew Pocock</name> | |
<url>https://github.com/turingatemyhamster</url> | |
</developer> | |
</developers> | |
) | |
val cross = new utest.jsrunner.JsCrossBuild( | |
organization := "uk.co.turingatemyhamster", | |
name := "datatree", | |
commonSettings : _* | |
) | |
val sharedSettings = Seq( | |
target := target.value / "shared", | |
libraryDependencies ++= Seq( | |
"com.lihaoyi" %% "acyclic" % "0.1.2" % "provided", | |
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided", | |
"com.lihaoyi" %%% "utest" % "0.2.0" | |
) | |
) ++ commonSettings | |
lazy val sharedJvm = project.in(file("shared")).settings(sharedSettings:_*).settings( | |
target := target.value / "jvm", | |
moduleName := "datatree-shared" | |
) | |
lazy val sharedJs = project.in(file("shared")).settings(scalaJSSettings ++ sharedSettings:_*).settings( | |
target := target.value / "js", | |
moduleName := "datatree-shared" | |
) | |
lazy val jvm = cross.jvm.dependsOn(sharedJvm % "compile->compile;test->test").settings( | |
resolvers += "bintray/non" at "http://dl.bintray.com/non/maven", | |
libraryDependencies += "org.jsawn" %% "jawn-parser" % "0.5.4" | |
) | |
lazy val js = cross.js.dependsOn(sharedJs % "compile->compile;test->test").settings( | |
(jsEnv in Test) := new NodeJSEnv | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment