File: ScriptCommands.scala

package info (click to toggle)
scala 2.11.12-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 62,828 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,250; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (32 lines) | stat: -rw-r--r-- 1,628 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import sbt._
import Keys._
import BuildSettings.autoImport._

/** Custom commands for use by the Jenkins scripts. This keeps the surface area and call syntax small. */
object ScriptCommands {
  def all = Seq(setupPublishCore, setupValidateTest)

  /** Set up the environment for `validate/publish-core`. The argument is the Artifactory snapshot repository URL. */
  def setupPublishCore = Command.single("setupPublishCore") { case (state, url) =>
      Project.extract(state).append(Seq(
        baseVersionSuffix in Global := "SHA-SNAPSHOT",
        // Append build.timestamp to Artifactory URL to get consistent build numbers (see https://github.com/sbt/sbt/issues/2088):
        publishTo in Global := Some("scala-pr" at url.replaceAll("/$", "") + ";build.timestamp=" + System.currentTimeMillis),
        publishArtifact in (Compile, packageDoc) in ThisBuild := false,
        scalacOptions in Compile in ThisBuild += "-optimise",
        logLevel in ThisBuild := Level.Info,
        logLevel in update in ThisBuild := Level.Warn
      ), state)
    }

  /** Set up the environment for `validate/test`. The argument is the Artifactory snapshot repository URL. */
  def setupValidateTest = Command.single("setupValidateTest") { case (state, url) =>
    //TODO When ant is gone, pass starr version as an argument to this command instead of using version.properties
    Project.extract(state).append(Seq(
      resolvers in Global += "scala-pr" at url,
      scalacOptions in Compile in ThisBuild += "-optimise",
      logLevel in ThisBuild := Level.Info,
      logLevel in update in ThisBuild := Level.Warn
    ), state)
  }
}