Skip to content

Instantly share code, notes, and snippets.

@RSchulz
Created August 10, 2012 18:14
Show Gist options
  • Save RSchulz/3316351 to your computer and use it in GitHub Desktop.
Save RSchulz/3316351 to your computer and use it in GitHub Desktop.
package net.box.sbt
import sbt._
import Keys._
/**
* Generic settings for Box projects
*/
object BoxSettings extends Plugin {
val buildOrganization = "net.box"
val buildScalaVersion = "2.9.0-1"
// Master of development dependencies
val boxMavenUrl = "http://maven.dev.box.net:8081/nexus/content/"
val boxMaven = Seq("Box Dev Repo" at boxMavenUrl + "groups/public")
val boxSettings = Seq(
organization := buildOrganization,
scalaVersion := buildScalaVersion,
scalacOptions ++= Seq("-unchecked", "-deprecation"),
externalResolvers <<= resolvers map { rs => Resolver.withDefaultResolvers(rs, mavenCentral = false, scalaTools = false) },
resolvers ++= boxMaven,
resolvers <+= sbtResolver,
version := "1.0-SNAPSHOT",
publishTo <<= (version) {
version: String =>
if (version.trim.endsWith("SNAPSHOT")) Some("snapshots" at boxMavenUrl + "repositories/snapshots/")
else Some("releases" at boxMavenUrl + "repositories/releases/")
},
credentials += Credentials("Sonatype Nexus Repository Manager", "maven.dev.box.net", "deployment", "deploy"),
// Use specs2 junit xml reporter for jenkins integration
// This tells Specs2 to direct output to both console and JUnit-type xml files
testOptions in Test += Tests.Argument("junitxml", "console"),
// Command line flag to request Specifications be run sequentially
parallelExecution in Test := System.getProperty("sbt.sequentialTests") != "true",
// log4j has unnecessary dependencies not needed at runtime but are not available in upstream maven repos
ivyXML := <dependencies>
<exclude org="org.slf4j" module="slf4j-log4j12"/>
<exclude org="com.sun.jmx" module="jmxri"/>
<exclude org="com.sun.jdmk" module="jmxtools"/>
<exclude org="javax.jms" module="jms"/>
</dependencies>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment