Skip to content

Instantly share code, notes, and snippets.

@wfaler
Last active December 18, 2015 01:29
Show Gist options
  • Save wfaler/5704359 to your computer and use it in GitHub Desktop.
Save wfaler/5704359 to your computer and use it in GitHub Desktop.
SBT template build
import sbt._
import Keys._
object TemplateBuild extends Build {
val description = SettingKey[String]("description")
resolvers ++= repos
val parentSettings = Defaults.defaultSettings ++ Seq(
parallelExecution := false,
organization := "com.recursivity",
version := "1.0.0-SNAPSHOT",
crossScalaVersions := Seq("2.10.2"),
scalaVersion <<= (crossScalaVersions) {
versions => versions.head
},
packageOptions <<= (packageOptions, name, version, organization) map {
(opts, title, version, vendor) =>
opts :+ Package.ManifestAttributes(
"Created-By" -> "Simple Build Tool",
"Built-By" -> System.getProperty("user.name"),
"Build-Jdk" -> System.getProperty("java.version"),
"Specification-Title" -> title,
"Specification-Version" -> version,
"Specification-Vendor" -> vendor,
"Implementation-Title" -> title,
"Implementation-Version" -> version,
"Implementation-Vendor-Id" -> vendor,
"Implementation-Vendor" -> vendor
)
}
)
val repos = Seq("Sonatype Nexus releases" at "https://oss.sonatype.org/content/repositories/releases",
"Sonatype Nexus snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
val sonatypeSnapshots = "Sonatype Nexus Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
object Dependencies {
val scalaz = "org.scalaz" %% "scalaz-core" % "7.0.1"
val specs2 = "org.specs2" %% "specs2" % "1.12.3" % "test"
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.10.1" % "test"
}
import Dependencies._
lazy val coreSandbox = Project("core", file("."),
settings = parentSettings)
.settings(libraryDependencies := Seq(scalaz,specs2,scalacheck),
description := "Parent project",
resolvers ++= repos)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment