From ae02b495e69244feecbcf84843440410b0662cd5 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Mon, 19 May 2014 09:30:39 -0400 Subject: [PATCH 1/3] Fix bug in release script due to typo. * Fix collection typo * Create shared command to setup 2.11 builds * Alter snapshot detection to allow more flexible milestone versioning. * Remove cusotm isSnapshot key for new sbt 0.13.2 isSnapshot key. --- project/Docs.scala | 2 +- project/Release.scala | 2 +- project/Sbt.scala | 39 +++++++++++++++++++++------------------ project/Status.scala | 5 +++-- project/Transform.scala | 2 +- project/Util.scala | 4 ++-- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/project/Docs.scala b/project/Docs.scala index f4a9c85cc..565ccf3b3 100644 --- a/project/Docs.scala +++ b/project/Docs.scala @@ -1,6 +1,6 @@ import sbt._ import Keys._ -import Status.{ isSnapshot, publishStatus } +import Status.{ publishStatus } import com.typesafe.sbt.{ SbtGhPages, SbtGit, SbtSite, site => sbtsite } import SbtSite.{ site, SiteKeys } import SbtGhPages.{ ghpages, GhPagesKeys => ghkeys } diff --git a/project/Release.scala b/project/Release.scala index b3e52a57f..6d80f5b50 100644 --- a/project/Release.scala +++ b/project/Release.scala @@ -1,6 +1,6 @@ import sbt._ import Keys._ -import Status.{ isSnapshot, publishStatus } +import Status.{ publishStatus } import org.apache.ivy.util.url.CredentialsStore object Release extends Build { diff --git a/project/Sbt.scala b/project/Sbt.scala index 215ccffb0..eddbf6669 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -24,9 +24,13 @@ object Sbt extends Build { testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"), javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"), incOptions := incOptions.value.withNameHashing(true), - commands += Command.command("checkBuildScala211") { state => + commands += Command.command("setupBuildScala211") { state => """set scalaVersion in ThisBuild := "2.11.0" """ :: "set Util.includeTestDependencies in ThisBuild := true" :: + state + }, + commands += Command.command("checkBuildScala211") { state => + "setupBuildScala211" :: // First compile everything before attempting to test "all compile test:compile" :: // Now run known working tests. @@ -39,23 +43,22 @@ object Sbt extends Build { }, // TODO - To some extent these should take args to figure out what to do. commands += Command.command("release-libs-211") { state => - def lameAgregateTask(task: String): String = - s"all control/$task collectoins/$task io/$task" - // TODO - Pull scala version from setting somewhere useful - "++ 2.11.0" :: - /// First test - lameAgregateTask("test") :: - // Note: You need the sbt-pgp plugin installed to release. - lameAgregateTask("publishSigned") :: - // Now restore the defaults. - "reload" :: state + def lameAgregateTask(task: String): String = + s"all control/$task collections/$task io/$task" + "setupBuildScala211" :: + /// First test + lameAgregateTask("test") :: + // Note: You need the sbt-pgp plugin installed to release. + lameAgregateTask("publishSigned") :: + // Now restore the defaults. + "reload" :: state }, commands += Command.command("release-sbt") { state => // TODO - Any sort of validation - "publishSigned" :: - "publishLauncher" :: - "release-libs-211" :: - state + "publishSigned" :: + "publishLauncher" :: + "release-libs-211" :: + state } ) @@ -85,13 +88,13 @@ object Sbt extends Build { /* **** Utilities **** */ - lazy val controlSub = baseProject(utilPath / "control", "Control") settings (Util.crossBuild:_*) - lazy val collectionSub = testedBaseProject(utilPath / "collection", "Collections") settings (Util.keywordsSettings: _*) settings (Util.crossBuild:_*) + lazy val controlSub = baseProject(utilPath / "control", "Control") settings (Util.crossBuild: _*) + lazy val collectionSub = testedBaseProject(utilPath / "collection", "Collections") settings (Util.keywordsSettings: _*) settings (Util.crossBuild: _*) lazy val applyMacroSub = testedBaseProject(utilPath / "appmacro", "Apply Macro") dependsOn (collectionSub) settings (scalaCompiler) // The API for forking, combining, and doing I/O with system processes lazy val processSub = baseProject(utilPath / "process", "Process") dependsOn (ioSub % "test->test") settings (scalaXml) // Path, IO (formerly FileUtilities), NameFilter and other I/O utility classes - lazy val ioSub = testedBaseProject(utilPath / "io", "IO") dependsOn (controlSub) settings (ioSettings: _*) settings (Util.crossBuild:_*) + lazy val ioSub = testedBaseProject(utilPath / "io", "IO") dependsOn (controlSub) settings (ioSettings: _*) settings (Util.crossBuild: _*) // Utilities related to reflection, managing Scala versions, and custom class loaders lazy val classpathSub = testedBaseProject(utilPath / "classpath", "Classpath") dependsOn (launchInterfaceSub, interfaceSub, ioSub) settings (scalaCompiler) // Command line-related utilities. diff --git a/project/Status.scala b/project/Status.scala index ee6aaec6b..73ef5ab66 100644 --- a/project/Status.scala +++ b/project/Status.scala @@ -3,7 +3,6 @@ import Keys._ import java.util.regex.Pattern object Status { - lazy val isSnapshot = SettingKey[Boolean]("is-snapshot") lazy val publishStatus = SettingKey[String]("publish-status") def settings: Seq[Setting[_]] = Seq( @@ -25,5 +24,7 @@ object Status { format.format(new java.util.Date(time)) } final val Snapshot = "-SNAPSHOT" - def snapshotQualifier(v: String) = !Pattern.matches(""".+-(M|Alpha|Beta|RC)\d*""", v) + // NOte: This moved into sbt itself... But we need to add semantic knowledge of how + // we stamp our nightlies. + def snapshotQualifier(v: String) = Pattern.matches(""".+-.*SNAPSHOT.*""", v) } \ No newline at end of file diff --git a/project/Transform.scala b/project/Transform.scala index b45d47dfe..ae1ad02fd 100644 --- a/project/Transform.scala +++ b/project/Transform.scala @@ -59,7 +59,7 @@ object Transform { (ss --- sdirs) x (rebase(sdirs, sm) | flat(sm)) toSeq } def configSettings = transResourceSettings ++ seq( - resourceProperties <<= (organization, version, scalaVersion, Status.isSnapshot) map { (org, v, sv, isSnapshot) => + resourceProperties <<= (organization, version, scalaVersion, isSnapshot) map { (org, v, sv, isSnapshot) => Map("org" -> org, "sbt.version" -> v, "scala.version" -> sv, "repositories" -> repositories(isSnapshot).mkString(IO.Newline)) } ) diff --git a/project/Util.scala b/project/Util.scala index ee2d34c17..987d80096 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -29,11 +29,11 @@ object Util { nightly211 <<= scalaVersion(_.startsWith("2.11.")), includeTestDependencies <<= nightly211(x => !x) ) - def crossBuild: Seq[Setting[_]] = + def crossBuild: Seq[Setting[_]] = Seq( crossPaths := (scalaBinaryVersion.value match { case "2.11" => true - case _ => false + case _ => false }) ) def commonSettings(nameString: String) = Seq( From e0a96e3d7fac5c3ccea627baa5adb0e2343f6cc7 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Mon, 19 May 2014 09:30:39 -0400 Subject: [PATCH 2/3] Fix bug in release script due to typo. * Fix collection typo * Create shared command to setup 2.11 builds * Alter snapshot detection to allow more flexible milestone versioning. * Remove cusotm isSnapshot key for new sbt 0.13.2 isSnapshot key. --- project/Docs.scala | 2 +- project/Release.scala | 2 +- project/Sbt.scala | 11 +++++++---- project/Status.scala | 5 +++-- project/Transform.scala | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/project/Docs.scala b/project/Docs.scala index f4a9c85cc..565ccf3b3 100644 --- a/project/Docs.scala +++ b/project/Docs.scala @@ -1,6 +1,6 @@ import sbt._ import Keys._ -import Status.{ isSnapshot, publishStatus } +import Status.{ publishStatus } import com.typesafe.sbt.{ SbtGhPages, SbtGit, SbtSite, site => sbtsite } import SbtSite.{ site, SiteKeys } import SbtGhPages.{ ghpages, GhPagesKeys => ghkeys } diff --git a/project/Release.scala b/project/Release.scala index b3e52a57f..6d80f5b50 100644 --- a/project/Release.scala +++ b/project/Release.scala @@ -1,6 +1,6 @@ import sbt._ import Keys._ -import Status.{ isSnapshot, publishStatus } +import Status.{ publishStatus } import org.apache.ivy.util.url.CredentialsStore object Release extends Build { diff --git a/project/Sbt.scala b/project/Sbt.scala index 925d3b5cc..1c7e1d628 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -24,9 +24,13 @@ object Sbt extends Build { testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"), javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"), incOptions := incOptions.value.withNameHashing(true), - commands += Command.command("checkBuildScala211") { state => + commands += Command.command("setupBuildScala211") { state => """set scalaVersion in ThisBuild := "2.11.0" """ :: "set Util.includeTestDependencies in ThisBuild := true" :: + state + }, + commands += Command.command("checkBuildScala211") { state => + "setupBuildScala211" :: // First compile everything before attempting to test "all compile test:compile" :: // Now run known working tests. @@ -40,9 +44,8 @@ object Sbt extends Build { // TODO - To some extent these should take args to figure out what to do. commands += Command.command("release-libs-211") { state => def lameAgregateTask(task: String): String = - s"all control/$task collectoins/$task io/$task" - // TODO - Pull scala version from setting somewhere useful - "++ 2.11.0" :: + s"all control/$task collections/$task io/$task" + "setupBuildScala211" :: /// First test lameAgregateTask("test") :: // Note: You need the sbt-pgp plugin installed to release. diff --git a/project/Status.scala b/project/Status.scala index ee6aaec6b..73ef5ab66 100644 --- a/project/Status.scala +++ b/project/Status.scala @@ -3,7 +3,6 @@ import Keys._ import java.util.regex.Pattern object Status { - lazy val isSnapshot = SettingKey[Boolean]("is-snapshot") lazy val publishStatus = SettingKey[String]("publish-status") def settings: Seq[Setting[_]] = Seq( @@ -25,5 +24,7 @@ object Status { format.format(new java.util.Date(time)) } final val Snapshot = "-SNAPSHOT" - def snapshotQualifier(v: String) = !Pattern.matches(""".+-(M|Alpha|Beta|RC)\d*""", v) + // NOte: This moved into sbt itself... But we need to add semantic knowledge of how + // we stamp our nightlies. + def snapshotQualifier(v: String) = Pattern.matches(""".+-.*SNAPSHOT.*""", v) } \ No newline at end of file diff --git a/project/Transform.scala b/project/Transform.scala index b45d47dfe..ae1ad02fd 100644 --- a/project/Transform.scala +++ b/project/Transform.scala @@ -59,7 +59,7 @@ object Transform { (ss --- sdirs) x (rebase(sdirs, sm) | flat(sm)) toSeq } def configSettings = transResourceSettings ++ seq( - resourceProperties <<= (organization, version, scalaVersion, Status.isSnapshot) map { (org, v, sv, isSnapshot) => + resourceProperties <<= (organization, version, scalaVersion, isSnapshot) map { (org, v, sv, isSnapshot) => Map("org" -> org, "sbt.version" -> v, "scala.version" -> sv, "repositories" -> repositories(isSnapshot).mkString(IO.Newline)) } ) From f568e710ce13812c24195425911b0a4b007cce9c Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Mon, 2 Jun 2014 13:42:27 -0400 Subject: [PATCH 3/3] Also publish completions library for 2.11. --- project/Sbt.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Sbt.scala b/project/Sbt.scala index eddbf6669..ddac000c3 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -44,7 +44,7 @@ object Sbt extends Build { // TODO - To some extent these should take args to figure out what to do. commands += Command.command("release-libs-211") { state => def lameAgregateTask(task: String): String = - s"all control/$task collections/$task io/$task" + s"all control/$task collections/$task io/$task completion/$task" "setupBuildScala211" :: /// First test lameAgregateTask("test") ::