diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2016-07-28 08:43:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-28 08:43:13 -0700 |
commit | 16fd63b8db61fa08d7da1e125fbd1dff3384ff67 (patch) | |
tree | 73da51e80b0c94d680279ffd60f8ea65dffe34f3 /project | |
parent | efb74b73aa7ec157eb83c6cbf1fe341842357b2e (diff) | |
parent | faa4110fc7d8b92cac1e50a6952cdf3bc85d1cdf (diff) | |
download | scala-16fd63b8db61fa08d7da1e125fbd1dff3384ff67.tar.gz scala-16fd63b8db61fa08d7da1e125fbd1dff3384ff67.tar.bz2 scala-16fd63b8db61fa08d7da1e125fbd1dff3384ff67.zip |
Merge pull request #5292 from szeiger/wip/sbt-windows
Switch Windows CI build to sbt (w/ some sbt build improvements) [ci: last-only]
Diffstat (limited to 'project')
-rw-r--r-- | project/ScriptCommands.scala | 58 | ||||
-rw-r--r-- | project/VersionUtil.scala | 2 |
2 files changed, 28 insertions, 32 deletions
diff --git a/project/ScriptCommands.scala b/project/ScriptCommands.scala index accbadbbf6..8d5d09943a 100644 --- a/project/ScriptCommands.scala +++ b/project/ScriptCommands.scala @@ -7,24 +7,29 @@ object ScriptCommands { def all = Seq( setupPublishCore, setupValidateTest, - setupBootstrapStarr, setupBootstrapLocker, setupBootstrapQuick, setupBootstrapPublish, - testAll + setupBootstrapStarr, setupBootstrapLocker, setupBootstrapQuick, setupBootstrapPublish ) - /** Set up the environment for `validate/publish-core`. The argument is the Artifactory snapshot repository URL. */ - def setupPublishCore = setup("setupPublishCore") { case Seq(url) => + /** Set up the environment for `validate/publish-core`. + * The optional argument is the Artifactory snapshot repository URL. */ + def setupPublishCore = setup("setupPublishCore") { args => Seq( baseVersionSuffix in Global := "SHA-SNAPSHOT" - ) ++ publishTarget(url) ++ noDocs ++ enableOptimizer + ) ++ (args match { + case Seq(url) => publishTarget(url) + case Nil => Nil + }) ++ noDocs ++ enableOptimizer } - /** Set up the environment for `validate/test`. The argument is the Artifactory snapshot repository URL. */ - def setupValidateTest = setup("setupValidateTest") { case Seq(url) => - //TODO When ant is gone, pass starr version as an argument to this command instead of using version.properties + /** Set up the environment for `validate/test`. + * The optional argument is the Artifactory snapshot repository URL. */ + def setupValidateTest = setup("setupValidateTest") { args => Seq( - resolvers in Global += "scala-pr" at url, testOptions in IntegrationTest in LocalProject("test") ++= Seq(Tests.Argument("--show-log"), Tests.Argument("--show-diff")) - ) ++ enableOptimizer + ) ++ (args match { + case Seq(url) => Seq(resolvers in Global += "scala-pr" at url) + case Nil => Nil + }) ++ enableOptimizer } /** Set up the environment for building STARR in `validate/bootstrap`. The arguments are: @@ -63,9 +68,7 @@ object ScriptCommands { /** Set up the environment for publishing in `validate/bootstrap`. The arguments are: * - Temporary bootstrap repository URL for resolving modules * - Version number to publish - * All artifacts are published to Sonatype. GPG signing has to be configured from the - * shell script after `setupBootstrapPublish` because we don't pull the GPG plugin in - * by default, so we cannot reference its keys statically. */ + * All artifacts are published to Sonatype. */ def setupBootstrapPublish = setup("setupBootstrapPublish") { case Seq(url, ver) => // Define a copy of the setting key here in case the plugin is not part of the build val pgpPassphrase = SettingKey[Option[Array[Char]]]("pgp-passphrase", "The passphrase associated with the secret used to sign artifacts.", KeyRanks.BSetting) @@ -95,25 +98,18 @@ object ScriptCommands { publishArtifact in (Compile, packageDoc) in ThisBuild := false ) - private[this] def publishTarget(url: String) = Seq( + private[this] def publishTarget(url: String) = { // 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-publish" at url.replaceAll("/$", "") + ";build.timestamp=" + System.currentTimeMillis) - ) + val url2 = if(url.startsWith("file:")) url else url.replaceAll("/$", "") + ";build.timestamp=" + System.currentTimeMillis + Seq(publishTo in Global := Some("scala-pr-publish" at url2)) + } - def testAll = Command.command("testAll") { state => - val cmds = Seq( - "test", - "partest run pos neg jvm", - "partest res scalap specialized scalacheck", - "partest instrumented presentation", - "partest --srcpath scaladoc", - "osgiTestFelix/test", - "osgiTestEclipse/test", - "library/mima", - "reflect/mima", - "doc" - ) - state.log.info(cmds.mkString("Running all tests: \"", "\", \"", "\"")) - cmds ::: state + /** Like `Def.sequential` but accumulate all results */ + def sequence[B](tasks: List[Def.Initialize[Task[B]]]): Def.Initialize[Task[List[B]]] = tasks match { + case Nil => Def.task { Nil } + case x :: xs => Def.taskDyn { + val v = x.value + sequence(xs).apply((t: Task[List[B]]) => t.map(l => v :: l)) + } } } diff --git a/project/VersionUtil.scala b/project/VersionUtil.scala index 148fdfbc23..6fe2b004f7 100644 --- a/project/VersionUtil.scala +++ b/project/VersionUtil.scala @@ -94,7 +94,7 @@ object VersionUtil { } private lazy val generateBuildCharacterPropertiesFileImpl: Def.Initialize[Task[File]] = Def.task { - writeProps(versionProperties.value.toMap, (baseDirectory in ThisBuild).value / "buildcharacter.properties") + writeProps(versionProperties.value.toMap ++ versionProps, (baseDirectory in ThisBuild).value / "buildcharacter.properties") } private def writeProps(m: Map[String, String], propFile: File): File = { |