From 27def9a7b092e36e984283d7183b5f8125267ae4 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Mon, 4 Jul 2022 07:18:36 +0200 Subject: [PATCH 1/3] deps: update all sorts of stuff This pr goes through and makes the various updates: - Bumps mill to the latest 0.10.5 - Bumps to the latest Scala versions for 2 and latest 3.1.x version - Drops 0.x support for ScalaJS - Move Scala native to 0.4.x - Adds in dependabot - Starts to cross test on 8 and 17 - Updates checkout and java actions --- .github/dependabot.yml | 7 +++++++ .github/workflows/actions.yml | 22 +++++++++++++------- .mill-version | 1 + build.sc | 39 ++++++++++++++++++----------------- mill | 2 +- 5 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .mill-version diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e33811f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 56b74d4..0e4420b 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -13,21 +13,27 @@ on: jobs: test: runs-on: ubuntu-latest + strategy: + matrix: + java: ['8', '17'] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: - java-version: 8 + distribution: 'temurin' + java-version: ${{ matrix.java }} - name: Run tests run: ./mill -i all __.publishArtifacts __.test + check-binary-compatibility: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: 8 - name: Check Binary Compatibility run: ./mill -i __.mimaReportBinaryIssues @@ -45,9 +51,10 @@ jobs: LC_MESSAGES: "en_US.UTF-8" LC_ALL: "en_US.UTF-8" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: 8 - name: Publish to Maven Central run: | @@ -72,5 +79,4 @@ jobs: with: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} - body: draft: false diff --git a/.mill-version b/.mill-version new file mode 100644 index 0000000..9028ec6 --- /dev/null +++ b/.mill-version @@ -0,0 +1 @@ +0.10.5 diff --git a/build.sc b/build.sc index 49ba916..2bdbb74 100644 --- a/build.sc +++ b/build.sc @@ -2,37 +2,38 @@ import mill._, scalalib._, scalajslib._, scalanativelib._, publish._ import mill.scalalib.api.Util.isScala3 import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.1.4` import de.tobiasroeser.mill.vcs.version.VcsVersion -import $ivy.`com.github.lolgab::mill-mima::0.0.9` +import $ivy.`com.github.lolgab::mill-mima::0.0.10` import com.github.lolgab.mill.mima._ +import mill.scalalib.api.Util.isScala3 -val dottyVersions = sys.props.get("dottyVersion").toList +val dottyCommunityBuildVersion = sys.props.get("dottyVersion").toList -val scala2VersionsAndDotty = "2.12.13" :: "2.13.4" :: "2.11.12" :: dottyVersions -val scala30 = "3.0.2" -val scala31 = "3.1.1" +val scalaVersions = + "2.12.16" :: "2.13.8" :: "2.11.12" :: "3.1.3" :: dottyCommunityBuildVersion -val scalaJSVersions = for { - scalaV <- scala30 :: scala2VersionsAndDotty - scalaJSV <- Seq("0.6.33", "1.5.1") - if scalaV.startsWith("2.") || scalaJSV.startsWith("1.") -} yield (scalaV, scalaJSV) +val scalaJSVersions = scalaVersions.map((_, "1.10.1")) +val scalaNativeVersions = scalaVersions.map((_, "0.4.5")) -val scalaNativeVersions = for { - scalaV <- scala31 :: scala2VersionsAndDotty - scalaNativeV <- Seq("0.4.4") -} yield (scalaV, scalaNativeV) +trait MimaCheck extends Mima { + def mimaPreviousVersions = VcsVersion.vcsState().lastTag.toSeq +} -trait PPrintModule extends PublishModule with Mima { +trait PPrintModule extends PublishModule with MimaCheck { def artifactName = "pprint" def publishVersion = VcsVersion.vcsState().format() - def mimaPreviousVersions = VcsVersion.vcsState().lastTag.toSeq + def crossScalaVersion: String + + // Temporary until the next version of Mima gets released with + // https://github.com/lightbend/mima/issues/693 included in the release. + def mimaPreviousArtifacts = + if(isScala3(crossScalaVersion)) Agg.empty[Dep] else super.mimaPreviousArtifacts() def pomSettings = PomSettings( description = artifactName(), organization = "com.lihaoyi", - url = "https://github.com/lihaoyi/PPrint", + url = "https://github.com/com-lihaoyi/PPrint", licenses = Seq(License.MIT), versionControl = VersionControl.github( owner = "com-lihaoyi", @@ -88,7 +89,7 @@ trait PPrintTestModule extends ScalaModule with TestModule.Utest { } object pprint extends Module { - object jvm extends Cross[JvmPPrintModule](scala30 :: scala2VersionsAndDotty:_*) + object jvm extends Cross[JvmPPrintModule](scalaVersions:_*) class JvmPPrintModule(val crossScalaVersion: String) extends PPrintMainModule with ScalaModule with PPrintModule { object test extends Tests with PPrintTestModule{ @@ -113,7 +114,7 @@ object pprint extends Module { def offset = os.up def scalaNativeVersion = crossScalaNativeVersion // Remove after Scala Native Scala 3 artifacts are published - def mimaPreviousArtifacts = T{ if(isScala3(scalaVersion())) Seq() else super.mimaPreviousArtifacts() } + //def mimaPreviousArtifacts = T{ if(isScala3(scalaVersion())) Seq() else super.mimaPreviousArtifacts() } object test extends Tests with PPrintTestModule{ def offset = os.up val crossScalaVersion = NativePPrintModule.this.crossScalaVersion diff --git a/mill b/mill index 4d3405d..e616548 100755 --- a/mill +++ b/mill @@ -3,7 +3,7 @@ # This is a wrapper script, that automatically download mill from GitHub release pages # You can give the required mill version with MILL_VERSION env variable # If no version is given, it falls back to the value of DEFAULT_MILL_VERSION -DEFAULT_MILL_VERSION=0.10.0-35-11bc3c +DEFAULT_MILL_VERSION=0.10.5 set -e From e69b4c0a0b44753c83ae9ed81148183293becdeb Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Mon, 4 Jul 2022 13:29:39 +0200 Subject: [PATCH 2/3] add issue filter for StringPrefix.apply --- build.sc | 16 ++++++++++++++-- pprint/src-2.13/pprint/StringPrefix.scala | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build.sc b/build.sc index 2bdbb74..ca737fb 100644 --- a/build.sc +++ b/build.sc @@ -15,7 +15,20 @@ val scalaJSVersions = scalaVersions.map((_, "1.10.1")) val scalaNativeVersions = scalaVersions.map((_, "0.4.5")) trait MimaCheck extends Mima { + def crossScalaVersion: String + def mimaPreviousVersions = VcsVersion.vcsState().lastTag.toSeq + + // By default in sbt-mima IncompatibleSignatureProblem is actually turned off + // by default due to false positives. We hit on this with 2.13 > 2.13.6 with + // * static method apply(scala.collection.Iterable)java.lang.String in class pprint.StringPrefix has a different generic signature in current version, where it is (Lscala/collection/Iterable;)Ljava/lang/String; rather than (Lscala/collection/Iterable<*>;)Ljava/lang/String;. See https://github.com/lightbend/mima#incompatiblesignatureproblem + def mimaBinaryIssueFilters = if (crossScalaVersion.startsWith("2.13")) { + super.mimaBinaryIssueFilters() ++ Seq( + ProblemFilter.exclude[IncompatibleSignatureProblem]("pprint.StringPrefix.apply") + ) + } else { + super.mimaBinaryIssueFilters() + } } trait PPrintModule extends PublishModule with MimaCheck { @@ -100,6 +113,7 @@ object pprint extends Module { object js extends Cross[JsPPrintModule](scalaJSVersions:_*) class JsPPrintModule(val crossScalaVersion: String, crossJSVersion: String) extends PPrintMainModule with ScalaJSModule with PPrintModule { + def offset = os.up def scalaJSVersion = crossJSVersion object test extends Tests with PPrintTestModule{ @@ -113,8 +127,6 @@ object pprint extends Module { extends PPrintMainModule with ScalaNativeModule with PPrintModule { def offset = os.up def scalaNativeVersion = crossScalaNativeVersion - // Remove after Scala Native Scala 3 artifacts are published - //def mimaPreviousArtifacts = T{ if(isScala3(scalaVersion())) Seq() else super.mimaPreviousArtifacts() } object test extends Tests with PPrintTestModule{ def offset = os.up val crossScalaVersion = NativePPrintModule.this.crossScalaVersion diff --git a/pprint/src-2.13/pprint/StringPrefix.scala b/pprint/src-2.13/pprint/StringPrefix.scala index 11f1872..76d8f3e 100644 --- a/pprint/src-2.13/pprint/StringPrefix.scala +++ b/pprint/src-2.13/pprint/StringPrefix.scala @@ -2,4 +2,4 @@ package pprint object StringPrefix{ def apply(i: Iterable[_]) = i.asInstanceOf[{ def collectionClassName: String }].collectionClassName -} \ No newline at end of file +} From db155db42682e2cf22953f5597887ec34fee15e8 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Mon, 4 Jul 2022 13:43:39 +0200 Subject: [PATCH 3/3] dep: update utest to 0.8.0 --- build.sc | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/build.sc b/build.sc index ca737fb..5ddc1b1 100644 --- a/build.sc +++ b/build.sc @@ -2,9 +2,8 @@ import mill._, scalalib._, scalajslib._, scalanativelib._, publish._ import mill.scalalib.api.Util.isScala3 import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.1.4` import de.tobiasroeser.mill.vcs.version.VcsVersion -import $ivy.`com.github.lolgab::mill-mima::0.0.10` +import $ivy.`com.github.lolgab::mill-mima::0.0.11` import com.github.lolgab.mill.mima._ -import mill.scalalib.api.Util.isScala3 val dottyCommunityBuildVersion = sys.props.get("dottyVersion").toList @@ -14,28 +13,13 @@ val scalaVersions = val scalaJSVersions = scalaVersions.map((_, "1.10.1")) val scalaNativeVersions = scalaVersions.map((_, "0.4.5")) -trait MimaCheck extends Mima { - def crossScalaVersion: String - - def mimaPreviousVersions = VcsVersion.vcsState().lastTag.toSeq - - // By default in sbt-mima IncompatibleSignatureProblem is actually turned off - // by default due to false positives. We hit on this with 2.13 > 2.13.6 with - // * static method apply(scala.collection.Iterable)java.lang.String in class pprint.StringPrefix has a different generic signature in current version, where it is (Lscala/collection/Iterable;)Ljava/lang/String; rather than (Lscala/collection/Iterable<*>;)Ljava/lang/String;. See https://github.com/lightbend/mima#incompatiblesignatureproblem - def mimaBinaryIssueFilters = if (crossScalaVersion.startsWith("2.13")) { - super.mimaBinaryIssueFilters() ++ Seq( - ProblemFilter.exclude[IncompatibleSignatureProblem]("pprint.StringPrefix.apply") - ) - } else { - super.mimaBinaryIssueFilters() - } -} - -trait PPrintModule extends PublishModule with MimaCheck { +trait PPrintModule extends PublishModule with Mima { def artifactName = "pprint" def publishVersion = VcsVersion.vcsState().format() + def mimaPreviousVersions = VcsVersion.vcsState().lastTag.toSeq + def crossScalaVersion: String // Temporary until the next version of Mima gets released with @@ -60,8 +44,8 @@ trait PPrintModule extends PublishModule with MimaCheck { trait PPrintMainModule extends CrossScalaModule { def millSourcePath = super.millSourcePath / offset def ivyDeps = Agg( - ivy"com.lihaoyi::fansi::0.3.1", - ivy"com.lihaoyi::sourcecode::0.2.8" + ivy"com.lihaoyi::fansi::0.4.0", + ivy"com.lihaoyi::sourcecode::0.3.0" ) def compileIvyDeps = if (crossScalaVersion.startsWith("2")) Agg( @@ -84,7 +68,7 @@ trait PPrintMainModule extends CrossScalaModule { trait PPrintTestModule extends ScalaModule with TestModule.Utest { def crossScalaVersion: String - def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.7.11") + def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.8.0") def offset: os.RelPath = os.rel def millSourcePath = super.millSourcePath / os.up