From 08d706fa93f3bc716a60e202fb0a2c1019e8dd3c Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Fri, 23 Sep 2022 10:48:11 +0200 Subject: [PATCH] chore: Update Scala versions to 2.12.17 and 2.13.9 Also set scala-xml to 2.1.0 to avoid issues with version conflict --- .github/workflows/ci.yml | 8 +++---- .github/workflows/mdoc.yml | 2 +- .mergify.yml | 12 +++++------ build.sbt | 21 ++++++++++++------- mdoc-sbt/src/main/scala/mdoc/MdocPlugin.scala | 3 ++- .../src/sbt-test/sbt-mdoc/basic/build.sbt | 4 ++-- mdoc-sbt/src/sbt-test/sbt-mdoc/basic/test | 4 ++-- .../sbt-test/sbt-mdoc/scalajs-1.7/build.sbt | 4 ++-- .../sbt-mdoc/scalajs-1.7/project/plugins.sbt | 2 +- .../src/sbt-test/sbt-mdoc/scalajs-1.7/test | 4 ++-- .../scala/tests/imports/DependencySuite.scala | 12 +++++------ 11 files changed, 41 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c09077c8..cc2551545 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: with: fetch-depth: 0 - uses: olafurpg/setup-scala@v13 - - run: sbt '++2.12.16 docs/mdoc' + - run: sbt '++2.12.17 docs/mdoc' test-windows: name: "Windows" runs-on: windows-latest @@ -29,7 +29,7 @@ jobs: - uses: olafurpg/setup-scala@v13 with: java-version: adopt@1.11 - - run: sbt '++2.13.8 test' + - run: sbt '++2.13.9 test' shell: bash test: name: ${{ matrix.command }} ${{ matrix.java }} @@ -41,8 +41,8 @@ jobs: command: # Test legacy Scala versions, where reporting API changed - "'++2.12.12! test'" - - "'++2.12.16 test'" - - "'++2.13.8 test'" + - "'++2.12.17 test'" + - "'++2.13.9 test'" - "'++3.1.3 test'" - "scripted" steps: diff --git a/.github/workflows/mdoc.yml b/.github/workflows/mdoc.yml index a5c2f5741..5d2079ffd 100644 --- a/.github/workflows/mdoc.yml +++ b/.github/workflows/mdoc.yml @@ -12,7 +12,7 @@ jobs: fetch-depth: 0 - uses: olafurpg/setup-scala@v13 - uses: olafurpg/setup-gpg@v3 - - run: sbt '++2.12.16 docs/docusaurusPublishGhpages' + - run: sbt '++2.12.17 docs/docusaurusPublishGhpages' env: GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }} - name: Check git diff diff --git a/.mergify.yml b/.mergify.yml index 5d6d1fe1f..b661ba10b 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -6,18 +6,18 @@ pull_request_rules: - check-success=Website - check-success=Windows - check-success="'++2.12.12! test' adopt@1.8" - - check-success="'++2.12.16 test' adopt@1.8" - - check-success="'++2.13.8 test' adopt@1.8" + - check-success="'++2.12.17 test' adopt@1.8" + - check-success="'++2.13.9 test' adopt@1.8" - check-success="'++3.1.3 test' adopt@1.8" - check-success="scripted adopt@1.8" - check-success="'++2.12.12! test' adopt@1.11" - - check-success="'++2.12.16 test' adopt@1.11" - - check-success="'++2.13.8 test' adopt@1.11" + - check-success="'++2.12.17 test' adopt@1.11" + - check-success="'++2.13.9 test' adopt@1.11" - check-success="'++3.1.3 test' adopt@1.11" - check-success="scripted adopt@1.11" - check-success="'++2.12.12! test' 17" - - check-success="'++2.12.16 test' 17" - - check-success="'++2.13.8 test' 17" + - check-success="'++2.12.17 test' 17" + - check-success="'++2.13.9 test' 17" - check-success="'++3.1.3 test' 17" - check-success=scripted 17 actions: diff --git a/build.sbt b/build.sbt index 3b1169012..8676e6426 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ import scala.collection.mutable -def scala212 = "2.12.16" -def scala213 = "2.13.8" +def scala212 = "2.12.17" +def scala213 = "2.13.9" def scala3 = "3.1.3" def scala2Versions = List(scala212, scala213) def allScalaVersions = scala2Versions :+ scala3 @@ -13,6 +13,7 @@ def scalajsDom = "2.0.0" def isScala2(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2) def isScala212(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2) && v.exists(_._2 == 12) +def isScala213(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2) && v.exists(_._2 == 13) def isScala3(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 3) val isScala212 = Def.setting { @@ -53,13 +54,14 @@ def crossSetting[A]( scalaVersion: String, if2: List[A] = Nil, if3: List[A] = Nil, - if211: List[A] = Nil, - if212: List[A] = Nil + if212: List[A] = Nil, + if213: List[A] = Nil ): List[A] = CrossVersion.partialVersion(scalaVersion) match { + case partialVersion if isScala213(partialVersion) => if2 ::: if213 + case partialVersion if isScala212(partialVersion) => if2 ::: if212 case partialVersion if isScala2(partialVersion) => if2 case partialVersion if isScala3(partialVersion) => if3 - case partialVersion if isScala212(partialVersion) => if2 ::: if212 case _ => Nil } @@ -102,9 +104,9 @@ crossScalaVersions := Nil lazy val sharedSettings = List( scalacOptions ++= crossSetting( scalaVersion.value, - if2 = List("-target:jvm-1.8", "-Yrangepos", "-deprecation"), - if212 = List("-Xexperimental"), - if211 = List("-Xexperimental"), + if2 = List("-Yrangepos", "-deprecation"), + if213 = List("-release", "8"), + if212 = List("-Xexperimental", "-target:jvm-1.8"), if3 = List("-language:implicitConversions", "-Ximport-suggestion-timeout", "0") ) ) @@ -473,6 +475,9 @@ lazy val docs = project Some(folders) }, + dependencyOverrides += { + "org.scala-lang.modules" %%% "scala-xml" % "2.1.0" + }, mdocVariables := { val stableVersion: String = version.value.replaceFirst("\\+.*", "") diff --git a/mdoc-sbt/src/main/scala/mdoc/MdocPlugin.scala b/mdoc-sbt/src/main/scala/mdoc/MdocPlugin.scala index b7ad68ace..c8d30c181 100644 --- a/mdoc-sbt/src/main/scala/mdoc/MdocPlugin.scala +++ b/mdoc-sbt/src/main/scala/mdoc/MdocPlugin.scala @@ -96,7 +96,8 @@ object MdocPlugin extends AutoPlugin { dependencyOverrides ++= List( "org.scala-lang" %% "scala3-library" % scalaVersion.value, "org.scala-lang" %% "scala3-compiler" % scalaVersion.value, - "org.scala-lang" %% "tasty-core" % scalaVersion.value + "org.scala-lang" %% "tasty-core" % scalaVersion.value, + "org.scala-lang.modules" %% "scala-xml" % "2.1.0" ), libraryDependencies ++= { val isJS = mdocJS.value.isDefined diff --git a/mdoc-sbt/src/sbt-test/sbt-mdoc/basic/build.sbt b/mdoc-sbt/src/sbt-test/sbt-mdoc/basic/build.sbt index 71f3a7627..af70e47c9 100644 --- a/mdoc-sbt/src/sbt-test/sbt-mdoc/basic/build.sbt +++ b/mdoc-sbt/src/sbt-test/sbt-mdoc/basic/build.sbt @@ -1,5 +1,5 @@ -ThisBuild / scalaVersion := "2.12.16" -ThisBuild / crossScalaVersions := List("2.12.16", "2.13.8", "3.1.3", "3.2.0", "3.2.1-RC1") +ThisBuild / scalaVersion := "2.12.17" +ThisBuild / crossScalaVersions := List("2.12.17", "2.13.9", "3.1.3", "3.2.0", "3.2.1-RC1") enablePlugins(MdocPlugin) mdocJS := Some(jsapp) diff --git a/mdoc-sbt/src/sbt-test/sbt-mdoc/basic/test b/mdoc-sbt/src/sbt-test/sbt-mdoc/basic/test index 382a5cded..23c99f4a0 100644 --- a/mdoc-sbt/src/sbt-test/sbt-mdoc/basic/test +++ b/mdoc-sbt/src/sbt-test/sbt-mdoc/basic/test @@ -1,6 +1,6 @@ -> ++2.12.16 mdoc +> ++2.12.17 mdoc > check -> ++2.13.8 mdoc +> ++2.13.9 mdoc > check > ++3.1.3 mdoc > check diff --git a/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/build.sbt b/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/build.sbt index b9c041d41..6d1f6c64d 100644 --- a/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/build.sbt +++ b/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/build.sbt @@ -1,5 +1,5 @@ -ThisBuild / scalaVersion := "2.12.16" -ThisBuild / crossScalaVersions := List("2.12.16", "2.13.8", "3.0.1") +ThisBuild / scalaVersion := "2.12.17" +ThisBuild / crossScalaVersions := List("2.12.17", "2.13.9", "3.0.1") enablePlugins(MdocPlugin) mdocJS := Some(jsapp) diff --git a/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/project/plugins.sbt b/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/project/plugins.sbt index 10568c170..003e95d9e 100644 --- a/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/project/plugins.sbt +++ b/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/project/plugins.sbt @@ -1,2 +1,2 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1") addSbtPlugin("org.scalameta" % "sbt-mdoc" % sys.props("plugin.version")) diff --git a/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/test b/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/test index afebc5ea1..78ec20841 100644 --- a/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/test +++ b/mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/test @@ -1,6 +1,6 @@ -> ++2.12.16 mdoc +> ++2.12.17 mdoc > check -> ++2.13.8 mdoc +> ++2.13.9 mdoc > check > ++3.1.3 mdoc > check diff --git a/tests/unit/src/test/scala/tests/imports/DependencySuite.scala b/tests/unit/src/test/scala/tests/imports/DependencySuite.scala index deef8fcce..e892b5cf2 100644 --- a/tests/unit/src/test/scala/tests/imports/DependencySuite.scala +++ b/tests/unit/src/test/scala/tests/imports/DependencySuite.scala @@ -82,12 +82,7 @@ class DependencySuite extends BaseMarkdownSuite { |println(42) |``` | """.stripMargin, - s"""|error: dep-error.md:4:13: Error downloading org.scalameta:not-exists_${BuildInfo.scalaVersion}:2.3.4 - | - | not found: https://repo1.maven.org/maven2/org/scalameta/not-exists_${BuildInfo.scalaVersion}/2.3.4/not-exists_${BuildInfo.scalaVersion}-2.3.4.pom - |import $$dep.`org.scalameta:::not-exists:2.3.4` - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - |error: dep-error.md:3:49: Error downloading org.scalameta:foobar:1.2.1 + s"""|error: dep-error.md:3:49: Error downloading org.scalameta:foobar:1.2.1 | | not found: https://repo1.maven.org/maven2/org/scalameta/foobar/1.2.1/foobar-1.2.1.pom |import $$dep.`org.scalameta::mmunit:2.3.4`, $$dep.`org.scalameta:foobar:1.2.1` @@ -97,6 +92,11 @@ class DependencySuite extends BaseMarkdownSuite { | not found: https://repo1.maven.org/maven2/org/scalameta/mmunit_2.13/2.3.4/mmunit_2.13-2.3.4.pom |import $$dep.`org.scalameta::mmunit:2.3.4`, $$dep.`org.scalameta:foobar:1.2.1` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + |error: dep-error.md:4:13: Error downloading org.scalameta:not-exists_${BuildInfo.scalaVersion}:2.3.4 + | + | not found: https://repo1.maven.org/maven2/org/scalameta/not-exists_${BuildInfo.scalaVersion}/2.3.4/not-exists_${BuildInfo.scalaVersion}-2.3.4.pom + |import $$dep.`org.scalameta:::not-exists:2.3.4` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |""".stripMargin )