From 17628d76e488ab60869ee59316400ac644549b31 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Wed, 25 Dec 2024 03:26:01 -0500 Subject: [PATCH 1/2] sbt 2.0.0-M3 --- build.sbt | 6 +++--- project/build.properties | 2 +- src/sbt-test/sbt-assembly/appendhash/build.sbt | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index b407c89..0e94636 100644 --- a/build.sbt +++ b/build.sbt @@ -7,7 +7,7 @@ ThisBuild / version := { ThisBuild / organization := "com.eed3si9n" def scala212 = "2.12.20" -def scala3 = "3.3.4" +def scala3 = "3.6.2" ThisBuild / crossScalaVersions := Seq(scala212, scala3) ThisBuild / scalaVersion := scala3 @@ -37,13 +37,13 @@ lazy val root = (project in file(".")) (pluginCrossBuild / sbtVersion) := { scalaBinaryVersion.value match { case "2.12" => "1.5.8" - case _ => "2.0.0-M2" + case _ => "2.0.0-M3" } } scriptedSbt := { scalaBinaryVersion.value match { case "2.12" => "1.10.2" - case _ => "2.0.0-M2" + case _ => "2.0.0-M3" } } Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "scala" diff --git a/project/build.properties b/project/build.properties index 0b699c3..73df629 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.2 +sbt.version=1.10.7 diff --git a/src/sbt-test/sbt-assembly/appendhash/build.sbt b/src/sbt-test/sbt-assembly/appendhash/build.sbt index 290e0ae..ea0605c 100644 --- a/src/sbt-test/sbt-assembly/appendhash/build.sbt +++ b/src/sbt-test/sbt-assembly/appendhash/build.sbt @@ -23,8 +23,9 @@ lazy val root = (project in file(".")) }, TaskKey[Unit]("checkPrevious") := { - import sbinary.DefaultProtocol._ - import CacheImplicits._ + import sbinary.DefaultProtocol.* + import CacheImplicits.{given, *} + import Def.* assert(Some(assembly.value) == assembly.previous) } ) From de284815f0e9a14ed7e6b048632dcf6dfc2c1f80 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Wed, 25 Dec 2024 03:48:30 -0500 Subject: [PATCH 2/2] Use glob for testing --- build.sbt | 2 +- src/sbt-test/caching/caching/build.sbt | 8 -------- src/sbt-test/caching/caching/test | 4 ++-- src/sbt-test/caching/custommergestrat/build.sbt | 4 ---- src/sbt-test/caching/custommergestrat/test | 4 ++-- src/sbt-test/merging/merging/test | 2 +- src/sbt-test/sbt-assembly/config/build.sbt | 4 ---- src/sbt-test/sbt-assembly/config/test | 2 +- src/sbt-test/sbt-assembly/deps/build.sbt | 4 ---- src/sbt-test/sbt-assembly/deps/test | 2 +- src/sbt-test/sbt-assembly/piecemeal/build.sbt | 4 ---- src/sbt-test/sbt-assembly/piecemeal/test | 6 +++--- src/sbt-test/sbt-assembly/simple/build.sbt | 4 ---- src/sbt-test/sbt-assembly/simple/test | 2 +- src/sbt-test/shading/shading/test | 1 + 15 files changed, 13 insertions(+), 40 deletions(-) diff --git a/build.sbt b/build.sbt index 0e94636..076d393 100644 --- a/build.sbt +++ b/build.sbt @@ -42,7 +42,7 @@ lazy val root = (project in file(".")) } scriptedSbt := { scalaBinaryVersion.value match { - case "2.12" => "1.10.2" + case "2.12" => "1.10.7" case _ => "2.0.0-M3" } } diff --git a/src/sbt-test/caching/caching/build.sbt b/src/sbt-test/caching/caching/build.sbt index d3b9c2c..c33904e 100644 --- a/src/sbt-test/caching/caching/build.sbt +++ b/src/sbt-test/caching/caching/build.sbt @@ -44,11 +44,3 @@ lazy val root = (project in file(".")). () } ) - -TaskKey[Unit]("fileCheck1") := { - assert((crossTarget.value / "foo.jar").exists()) -} - -TaskKey[Unit]("fileCheck2") := { - assert((crossTarget.value / "jarHash.txt").exists()) -} diff --git a/src/sbt-test/caching/caching/test b/src/sbt-test/caching/caching/test index e355e27..5a61a92 100644 --- a/src/sbt-test/caching/caching/test +++ b/src/sbt-test/caching/caching/test @@ -1,12 +1,12 @@ # check if the file gets created > clean > assembly -> fileCheck1 +$ exists target/**/foo.jar # run to cache the hash, then check it's consistent > check > checkhash -> fileCheck2 +$ exists target/**/jarHash.txt > checkhash > assembly diff --git a/src/sbt-test/caching/custommergestrat/build.sbt b/src/sbt-test/caching/custommergestrat/build.sbt index 7fcec62..d892c0d 100644 --- a/src/sbt-test/caching/custommergestrat/build.sbt +++ b/src/sbt-test/caching/custommergestrat/build.sbt @@ -40,7 +40,3 @@ def mustContain(f: File, l: Seq[String]): Unit = { TaskKey[Unit]("copy-preserve-last-modified") := { IO.copy(Seq((crossTarget.value / "foo.jar") -> (crossTarget.value / "foo-1.jar")), true, true, true) } - -TaskKey[Unit]("fileCheck1") := { - assert((crossTarget.value / "foo.jar").exists()) -} diff --git a/src/sbt-test/caching/custommergestrat/test b/src/sbt-test/caching/custommergestrat/test index a18a86b..340b39e 100644 --- a/src/sbt-test/caching/custommergestrat/test +++ b/src/sbt-test/caching/custommergestrat/test @@ -1,5 +1,5 @@ > assembly -> fileCheck1 +$ exists target/**/foo.jar > check > copyPreserveLastModified @@ -8,6 +8,6 @@ # assembly should run again, invalidating the cache because of the custom merge strategy > assembly -> fileCheck1 +$ exists target/**/foo.jar > check # $ newer target/scala-2.12/foo.jar target/scala-2.12/foo-1.jar diff --git a/src/sbt-test/merging/merging/test b/src/sbt-test/merging/merging/test index b7a2eeb..ceec1be 100644 --- a/src/sbt-test/merging/merging/test +++ b/src/sbt-test/merging/merging/test @@ -1,6 +1,6 @@ # check if the file gets created -> debug > assembly +$ exists target/**/foo.jar # check if it says hello > check diff --git a/src/sbt-test/sbt-assembly/config/build.sbt b/src/sbt-test/sbt-assembly/config/build.sbt index b7e0f09..b10eb31 100644 --- a/src/sbt-test/sbt-assembly/config/build.sbt +++ b/src/sbt-test/sbt-assembly/config/build.sbt @@ -12,7 +12,3 @@ lazy val root = (project in file(".")) () } ) - -TaskKey[Unit]("fileCheck") := { - assert((crossTarget.value / "foo.jar").exists()) -} diff --git a/src/sbt-test/sbt-assembly/config/test b/src/sbt-test/sbt-assembly/config/test index 4aaab03..50a9b01 100644 --- a/src/sbt-test/sbt-assembly/config/test +++ b/src/sbt-test/sbt-assembly/config/test @@ -1,6 +1,6 @@ # check if the file gets created > Test/assembly -> fileCheck +$ exists target/**/foo.jar # check if it says hello > check diff --git a/src/sbt-test/sbt-assembly/deps/build.sbt b/src/sbt-test/sbt-assembly/deps/build.sbt index bbecb1b..393773a 100644 --- a/src/sbt-test/sbt-assembly/deps/build.sbt +++ b/src/sbt-test/sbt-assembly/deps/build.sbt @@ -31,7 +31,3 @@ lazy val root = (project in file(".")) () } ) - -TaskKey[Unit]("fileCheck") := { - assert((crossTarget.value / "foo.jar").exists()) -} diff --git a/src/sbt-test/sbt-assembly/deps/test b/src/sbt-test/sbt-assembly/deps/test index 9f48c65..ceec1be 100644 --- a/src/sbt-test/sbt-assembly/deps/test +++ b/src/sbt-test/sbt-assembly/deps/test @@ -1,6 +1,6 @@ # check if the file gets created > assembly -> fileCheck +$ exists target/**/foo.jar # check if it says hello > check diff --git a/src/sbt-test/sbt-assembly/piecemeal/build.sbt b/src/sbt-test/sbt-assembly/piecemeal/build.sbt index 7f0b9b2..deb2ac7 100644 --- a/src/sbt-test/sbt-assembly/piecemeal/build.sbt +++ b/src/sbt-test/sbt-assembly/piecemeal/build.sbt @@ -33,10 +33,6 @@ lazy val root = (project in file(".")) } ) -TaskKey[Unit]("fileCheck1") := { - assert((crossTarget.value / "foo-assembly-0.1.jar").exists()) -} - TaskKey[Unit]("fileCheck2") := { assert((crossTarget.value / "foo-assembly-0.1-deps.jar").exists()) } diff --git a/src/sbt-test/sbt-assembly/piecemeal/test b/src/sbt-test/sbt-assembly/piecemeal/test index 03501bf..509ba3f 100644 --- a/src/sbt-test/sbt-assembly/piecemeal/test +++ b/src/sbt-test/sbt-assembly/piecemeal/test @@ -1,17 +1,17 @@ # check if the file gets created > assembly -> fileCheck1 +$ exists target/**/foo-assembly-0.1.jar # try running this JAR. this should fail -> check1 # check if the file gets created > assemblyPackageDependency -> fileCheck2 +$ exists target/**/foo-assembly-0.1-deps.jar # check if the file gets created > assemblyPackageScala -> fileCheck3 +$ exists target/**/scala-library-2.12.18-assembly.jar # check if it says hello > check2 diff --git a/src/sbt-test/sbt-assembly/simple/build.sbt b/src/sbt-test/sbt-assembly/simple/build.sbt index 96a6e50..bca221c 100644 --- a/src/sbt-test/sbt-assembly/simple/build.sbt +++ b/src/sbt-test/sbt-assembly/simple/build.sbt @@ -8,7 +8,3 @@ TaskKey[Unit]("check") := { if (out.trim != "hello") sys.error("unexpected output: " + out) () } - -TaskKey[Unit]("fileCheck") := { - assert((crossTarget.value / "foo.jar").exists()) -} diff --git a/src/sbt-test/sbt-assembly/simple/test b/src/sbt-test/sbt-assembly/simple/test index 9f48c65..ceec1be 100644 --- a/src/sbt-test/sbt-assembly/simple/test +++ b/src/sbt-test/sbt-assembly/simple/test @@ -1,6 +1,6 @@ # check if the file gets created > assembly -> fileCheck +$ exists target/**/foo.jar # check if it says hello > check diff --git a/src/sbt-test/shading/shading/test b/src/sbt-test/shading/shading/test index 8f0400c..ceec1be 100644 --- a/src/sbt-test/shading/shading/test +++ b/src/sbt-test/shading/shading/test @@ -1,5 +1,6 @@ # check if the file gets created > assembly +$ exists target/**/foo.jar # check if it says hello > check