Skip to content

Commit

Permalink
chore: Update Scala versions to 2.12.17 and 2.13.9
Browse files Browse the repository at this point in the history
Also set scala-xml to 2.1.0 to avoid issues with version conflict
  • Loading branch information
tgodzik committed Sep 23, 2022
1 parent 458aee2 commit 767c3b0
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 35 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 13 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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")
)
)
Expand Down Expand Up @@ -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("\\+.*", "")
Expand Down
3 changes: 2 additions & 1 deletion mdoc-sbt/src/main/scala/mdoc/MdocPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mdoc-sbt/src/sbt-test/sbt-mdoc/basic/build.sbt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions mdoc-sbt/src/sbt-test/sbt-mdoc/basic/test
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/build.sbt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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"))
4 changes: 2 additions & 2 deletions mdoc-sbt/src/sbt-test/sbt-mdoc/scalajs-1.7/test
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/src/test/scala/tests/imports/DependencySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
|<redacted user.home>
| 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
|<redacted user.home>
| 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`
Expand All @@ -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
|<redacted user.home>
| 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
)

Expand Down

0 comments on commit 767c3b0

Please sign in to comment.