Skip to content

Instantly share code, notes, and snippets.

@eed3si9n
Created May 16, 2012 22:38
Show Gist options
  • Save eed3si9n/2714592 to your computer and use it in GitHub Desktop.
Save eed3si9n/2714592 to your computer and use it in GitHub Desktop.
import sbt._
import Keys._
import PlayProject._
import sbtbuildinfo.Plugin._
object ApplicationBuild extends Build {
val appName = "play-sbt-buildinfo-sample"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA,
settings = Defaults.defaultSettings ++ buildInfoSettings
).settings(
sourceGenerators in Compile <+= buildInfo,
buildInfoKeys := Seq[Scoped](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "hello"
)
}
@(message: String)
@("Welcome to %s %s" format (hello.BuildInfo.name, hello.BuildInfo.version))
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0.1")
resolvers += Resolver.url("artifactory", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.1.1")
@khein
Copy link

khein commented Jan 7, 2013

Is this still valid for sbt-buildinfo 0.2.0. Having issues.

@khein
Copy link

khein commented Jan 7, 2013

Figured it out. For 0.2.0 of the sbt-buildinfo plugin

buildInfoKeys := Seq[Scoped](name, version, scalaVersion, sbtVersion),

must be switched to

buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),

as noted on the github sbt-buildinfo git page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment