Skip to content

Instantly share code, notes, and snippets.

@mauricio
Created February 19, 2012 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mauricio/1865332 to your computer and use it in GitHub Desktop.
Save mauricio/1865332 to your computer and use it in GitHub Desktop.
import sbt._
import Keys._
object Build extends sbt.Build {
val unmanagedJars = TaskKey[Keys.Classpath]("unmanaged-jars")
unmanagedJars := {
Configuration.listUnmanaged( file(".").getAbsoluteFile )
}
lazy val jobsProject = Project( "some-company-jobs", file(".").getAbsoluteFile )
.settings(
organization := "com.some-company",
version := "1.0.0",
scalaVersion := "2.9.1",
scalacOptions := Seq("-deprecation", "-encoding", "utf8"),
resolvers ++= Configuration.resolutionRepos,
libraryDependencies ++= Configuration.dependencies,
unmanagedBase := file( "custom-libs" ).getAbsoluteFile
)
}
object Configuration {
def listUnmanaged( base : RichFile ) : Keys.Classpath = {
val baseDirectories = (base / "custom_libs") +++ ( base / "executables" )
(baseDirectories ** "*.jar").classpath
}
object Repos {
val SonatypeSnapshots = ("sonatype-snapshots" at "http://oss.sonatype.org/content/repositories/snapshots")
val SonatypeReleases = "sonatype-releases" at "http://oss.sonatype.org/content/repositories/releases"
val SpringSource = "spring-source" at "http://repository.springsource.com/ivy/bundles/release"
val SpringExternal = "spring-external" at "http://repository.springsource.com/maven/bundles/external"
}
val resolutionRepos = Seq[Resolver](
ScalaToolsReleases,
ScalaToolsSnapshots,
Repos.SonatypeReleases,
Repos.SonatypeSnapshots,
Repos.SpringExternal,
Repos.SpringSource
)
val dependencies = Seq(
"commons-lang" % "commons-lang" % "2.6",
"commons-cli" % "commons-cli" % "1.2",
"commons-pool" % "commons-pool" % "1.5.6",
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment