Sha256: ce53e2446156c3638fa1db094047bd9e8971fc1187a42dd149a0677473e2feb3

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

import sbt._
import Keys._
import com.typesafe.startscript.StartScriptPlugin

object BuildSettings {
  val buildVersion      = "1.0.0-SNAPSHOT"
  val buildScalaVersion = "2.9.1"

  val buildSettings = Defaults.defaultSettings ++ Seq (
    version      := buildVersion,
    scalaVersion := buildScalaVersion,
    shellPrompt  := ShellPrompt.buildShellPrompt
  )
}

object ShellPrompt {
  object devnull extends ProcessLogger {
    def info (s: => String) {}
    def error (s: => String) { }
    def buffer[T] (f: => T): T = f
  }
  def currBranch = (
    ("git status -sb" lines_! devnull headOption)
      getOrElse "-" stripPrefix "## "
  )

  val buildShellPrompt = { 
    (state: State) => {
      val currProject = Project.extract (state).currentProject.id
      "%s:%s:%s> ".format (
        currProject, currBranch, BuildSettings.buildVersion
      )
    }
  }
}

object Resolvers {
  val transcriptic = "Transcriptic" at "https://raw.github.com/transcriptic/maven2/master/releases/"
  val autoprotocol = "Autoprotocol" at "http://transcriptic.s3.amazonaws.com/autoprotocol/"
  val typesafe = "Typesafe" at "http://repo.typesafe.com/typesafe/releases/"
}

object AutoprotocolBuild extends Build {
  import Resolvers._
  import BuildSettings._
  import Dependencies.dependencies

  lazy val root = Project(
    "<%= name %>",
    file("."),
    settings =
      buildSettings ++ Seq (libraryDependencies ++= (Seq("org.autoprotocol" %% "autoprotocol-library" % "<%= autoprotocol_version %>") ++
        dependencies), resolvers ++= Seq(transcriptic, autoprotocol, typesafe)) ++ Defaults.defaultSettings ++ 
        StartScriptPlugin.startScriptForClassesSettings
  ) settings (
    fork in run := true
  ) settings (
    unmanagedSourceDirectories in Compile <+=  baseDirectory { _ / "app" }
  )
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
transcriptic-0.2.4 lib/transcriptic/templates/project/Build.erb