Fetching contributors…
Cannot retrieve contributors at this time
69 lines (57 sloc) 2.24 KB
name := "rogue"
version := "1.0.24-SNAPSHOT"
organization := "com.foursquare"
crossScalaVersions := Seq("2.8.1", "2.9.0", "2.9.0-1", "2.9.1", "2.8.0")
libraryDependencies <++= (scalaVersion) { scalaVersion =>
val specsVersion = scalaVersion match {
case "2.8.0" => "1.6.5"
case "2.9.1" => "1.6.9"
case _ => "1.6.8"
}
val liftVersion = scalaVersion match {
case "2.9.1" => "2.4-M4"
case _ => "2.4-M2"
}
Seq(
"net.liftweb" %% "lift-mongodb-record" % liftVersion % "compile",
"junit" % "junit" % "4.5" % "test",
"com.novocode" % "junit-interface" % "0.6" % "test",
"ch.qos.logback" % "logback-classic" % "0.9.26" % "provided",
"org.scala-tools.testing" %% "specs" % specsVersion % "test",
"org.scala-lang" % "scala-compiler" % scalaVersion % "test"
)
}
publishTo <<= (version) { v =>
val nexus = "http://nexus.scala-tools.org/content/repositories/"
if (v.endsWith("-SNAPSHOT"))
Some("snapshots" at nexus+"snapshots/")
else
Some("releases" at nexus+"releases/")
}
resolvers += "Bryan J Swift Repository" at "http://repos.bryanjswift.com/maven2/"
resolvers <++= (version) { v =>
if (v.endsWith("-SNAPSHOT"))
Seq(ScalaToolsSnapshots)
else
Seq()
}
scalacOptions ++= Seq("-deprecation", "-unchecked")
testFrameworks += new TestFramework("com.novocode.junit.JUnitFrameworkNoMarker")
defaultExcludes ~= (_ || "*~")
credentials ++= {
val scalaTools = ("Sonatype Nexus Repository Manager", "nexus.scala-tools.org")
def loadMavenCredentials(file: java.io.File) : Seq[Credentials] = {
xml.XML.loadFile(file) \ "servers" \ "server" map (s => {
val host = (s \ "id").text
val realm = if (host == scalaTools._2) scalaTools._1 else "Unknown"
Credentials(realm, host, (s \ "username").text, (s \ "password").text)
})
}
val ivyCredentials = Path.userHome / ".ivy2" / ".credentials"
val mavenCredentials = Path.userHome / ".m2" / "settings.xml"
(ivyCredentials.asFile, mavenCredentials.asFile) match {
case (ivy, _) if ivy.canRead => Credentials(ivy) :: Nil
case (_, mvn) if mvn.canRead => loadMavenCredentials(mvn)
case _ => Nil
}
}