From 42073628350002a9a202f54d691a58376f6905d6 Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Mon, 23 Dec 2019 13:48:40 -0800 Subject: [PATCH 1/2] Upgrade scala 2.13 version in scripted tests --- .../actions/cross-multiproject/build.sbt | 2 +- .../sbt-test/actions/cross-multiproject/test | 24 +++++++++---------- .../cross-strict-aggregation/build.sbt | 2 +- .../actions/cross-strict-aggregation/test | 6 ++--- .../separate-analysis-per-scala/build.sbt | 2 +- .../separate-analysis-per-scala/test | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sbt/src/sbt-test/actions/cross-multiproject/build.sbt b/sbt/src/sbt-test/actions/cross-multiproject/build.sbt index b03ecf9e0..99d00b5af 100644 --- a/sbt/src/sbt-test/actions/cross-multiproject/build.sbt +++ b/sbt/src/sbt-test/actions/cross-multiproject/build.sbt @@ -1,6 +1,6 @@ lazy val scala212 = "2.12.10" // keep this at M5 to test full version -lazy val scala213 = "2.13.0-M5" +lazy val scala213 = "2.13.1" ThisBuild / crossScalaVersions := Seq(scala212, scala213) ThisBuild / scalaVersion := scala212 diff --git a/sbt/src/sbt-test/actions/cross-multiproject/test b/sbt/src/sbt-test/actions/cross-multiproject/test index a2e08c9ae..c38a1b40a 100644 --- a/sbt/src/sbt-test/actions/cross-multiproject/test +++ b/sbt/src/sbt-test/actions/cross-multiproject/test @@ -1,43 +1,43 @@ > + compile $ exists lib/target/scala-2.12 -$ exists lib/target/scala-2.13.0-M5 +$ exists lib/target/scala-2.13 $ exists sbt-foo/target/scala-2.12 --$ exists sbt-foo/target/scala-2.13.0-M5 +-$ exists sbt-foo/target/scala-2.13 > clean > + libProj/compile $ exists lib/target/scala-2.12 -$ exists lib/target/scala-2.13.0-M5 +$ exists lib/target/scala-2.13 -$ exists sbt-foo/target/scala-2.12 --$ exists sbt-foo/target/scala-2.13.0-M5 +-$ exists sbt-foo/target/scala-2.13 # test safe switching > clean > ++ 2.12.10 -v compile $ exists lib/target/scala-2.12 --$ exists lib/target/scala-2.13.0-M5 +-$ exists lib/target/scala-2.13 $ exists sbt-foo/target/scala-2.12 --$ exists sbt-foo/target/scala-2.13.0-M5 +-$ exists sbt-foo/target/scala-2.13 # Test legacy cross build with command support # > clean # > + build # $ exists lib/target/scala-2.12 -# $ exists lib/target/scala-2.13.0-M5 +# $ exists lib/target/scala-2.13 # $ exists sbt-foo/target/scala-2.12 -# -$ exists sbt-foo/target/scala-2.13.0-M5 +# -$ exists sbt-foo/target/scala-2.13 # Test ++ leaves crossScalaVersions unchanged > clean > ++2.12.10 > +extrasProj/compile -$ exists extras/target/scala-2.13.0-M5 +$ exists extras/target/scala-2.13 $ exists extras/target/scala-2.12 # test safe switching > clean -> ++ 2.13.0-M5 -v compile -$ exists lib/target/scala-2.13.0-M5 +> ++ 2.13.1 -v compile +$ exists lib/target/scala-2.13 -$ exists lib/target/scala-2.12 # -$ exists sbt-foo/target/scala-2.12 --$ exists sbt-foo/target/scala-2.13.0-M5 +-$ exists sbt-foo/target/scala-2.13 diff --git a/sbt/src/sbt-test/actions/cross-strict-aggregation/build.sbt b/sbt/src/sbt-test/actions/cross-strict-aggregation/build.sbt index 84e4b5b9e..4f8fe9f91 100644 --- a/sbt/src/sbt-test/actions/cross-strict-aggregation/build.sbt +++ b/sbt/src/sbt-test/actions/cross-strict-aggregation/build.sbt @@ -1,5 +1,5 @@ lazy val scala212 = "2.12.10" -lazy val scala213 = "2.13.0-M5" +lazy val scala213 = "2.13.1" ThisBuild / scalaVersion := scala212 diff --git a/sbt/src/sbt-test/actions/cross-strict-aggregation/test b/sbt/src/sbt-test/actions/cross-strict-aggregation/test index d7bfc8b65..8767e4e22 100644 --- a/sbt/src/sbt-test/actions/cross-strict-aggregation/test +++ b/sbt/src/sbt-test/actions/cross-strict-aggregation/test @@ -1,7 +1,7 @@ -> ++2.12.0-magic -> ++2.13.0-M5 compile +> ++2.13.1 compile -$ exists core/target/scala-2.13.0-M5 --$ exists module/target/scala-2.13.0-M5 +$ exists core/target/scala-2.13 +-$ exists module/target/scala-2.13 -$ exists module/target/scala-2.12 diff --git a/sbt/src/sbt-test/compiler-project/separate-analysis-per-scala/build.sbt b/sbt/src/sbt-test/compiler-project/separate-analysis-per-scala/build.sbt index 7b5f37efa..bca947a21 100644 --- a/sbt/src/sbt-test/compiler-project/separate-analysis-per-scala/build.sbt +++ b/sbt/src/sbt-test/compiler-project/separate-analysis-per-scala/build.sbt @@ -1,5 +1,5 @@ lazy val scala212 = "2.12.10" -lazy val scala213 = "2.13.0-M5" +lazy val scala213 = "2.13.1" ThisBuild / scalaVersion := scala212 lazy val root = (project in file(".")) diff --git a/sbt/src/sbt-test/compiler-project/separate-analysis-per-scala/test b/sbt/src/sbt-test/compiler-project/separate-analysis-per-scala/test index 10391d966..40ef2a8c8 100644 --- a/sbt/src/sbt-test/compiler-project/separate-analysis-per-scala/test +++ b/sbt/src/sbt-test/compiler-project/separate-analysis-per-scala/test @@ -1,3 +1,3 @@ > + compile $ exists target/scala-2.12 -$ exists target/scala-2.13.0-M5 +$ exists target/scala-2.13 From d445590d9d4a14e7d29c90d309a1cf2f8eaf87f2 Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Mon, 23 Dec 2019 14:31:15 -0800 Subject: [PATCH 2/2] Fix cross multi command performance In 53788ba3561a4e79bc9c36c329f43540ad48814e, I changed the cross multi parser to issue all of the commands sequentially. This caused a performance regression for many use cases: https://github.com/sbt/sbt/issues/5321. This commit restores the old behavior of `+` if the command to run has no arguments. --- main/src/main/scala/sbt/Cross.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main/src/main/scala/sbt/Cross.scala b/main/src/main/scala/sbt/Cross.scala index ca2e8974a..2bdde84dd 100644 --- a/main/src/main/scala/sbt/Cross.scala +++ b/main/src/main/scala/sbt/Cross.scala @@ -194,7 +194,13 @@ object Cross { .sortBy(_._1) commandsByVersion.flatMap { case (v, commands) => - Seq(s"$SwitchCommand $verbose $v!") ++ commands + commands match { + case Seq(c) => Seq(s"$SwitchCommand $verbose $v! $c") + case Seq() => Nil // should be unreachable + case multi if fullArgs.isEmpty => + Seq(s"$SwitchCommand $verbose $v! all ${multi.mkString(" ")}") + case multi => Seq(s"$SwitchCommand $verbose $v!") ++ multi + } } } allCommands.toList ::: CrossRestoreSessionCommand :: captureCurrentSession(state, extracted)