Skip to content

Instantly share code, notes, and snippets.

@ubourdon
Created February 4, 2014 18:47
Show Gist options
  • Select an option

  • Save ubourdon/8809798 to your computer and use it in GitHub Desktop.

Select an option

Save ubourdon/8809798 to your computer and use it in GitHub Desktop.
example cross building sbt config file
import sbt._
import sbt.Keys._
object ScalaTestEmbededMongoBuild extends Build {
lazy val root = Project(id = "simplyscala-server", base = file("."),
settings = Project.defaultSettings ++ Seq(
name := "scalatest-embedmongo",
organization := "com.github.simplyscala",
description := "API to use embeded mongoDb database for testing in Scala",
version := "0.2.2",
scalaVersion := "2.10.1",
crossScalaVersions := Seq("2.9.1", "2.9.2", "2.10"),
libraryDependencies <++= (scalaVersion) { scalaVersion => Seq(
"de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "1.41",
"org.scalatest" %% "scalatest" % CrossDependencies.scalatest_version(scalaVersion) % "test",
"com.novus" %% "salat" % CrossDependencies.salat_version(scalaVersion) % "test")
)},
)
)
object CrossDependencies {
def scalatest_version(scala_version: String) = if(scala_version startsWith "2.9") "1.8" else "1.9.1"
def salat_version(scala_version: String) = if(scala_version startsWith "2.9") "1.9.2-SNAPSHOT" else "1.9.5"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment