Skip to content

Commit

Permalink
bugfix: Pin mdoc versions for different Scala versions and JDK ones
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Nov 17, 2023
1 parent 1870547 commit a07ab91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import java.nio.file.Path
import java.util.ServiceLoader

import scala.collection.concurrent.TrieMap
import scala.util.Properties

import scala.meta.internal.metals.MetalsEnrichments._
import scala.meta.internal.pc.ScalaPresentationCompiler
Expand Down Expand Up @@ -170,6 +171,7 @@ final class Embedded(
}

object Embedded {
private val jdkVersion = JdkVersion.parse(Properties.javaVersion)

lazy val repositories: List[Repository] =
Repository.defaults().asScala.toList ++
Expand Down Expand Up @@ -270,6 +272,13 @@ object Embedded {
if (scalaBinaryVersion == "2.11") "2.2.24"
// from 2.2.24 mdoc is compiled with 3.1.x which is incompatible with 3.0.x
else if (scalaVersion.exists(_.startsWith("3.0"))) "2.2.23"
// from 2.4.0 mdoc is released with Scala LTS 3.3.x
else if (
scalaVersion.exists(_.startsWith("3.1")) ||
scalaVersion.exists(_.startsWith("3.2"))
) "2.3.8"
// from 2.5.0 mdoc is released with JDK 11
else if (jdkVersion.exists(_.major < 11)) "2.4.0"
else BuildInfo.mdocVersion,
)
}
Expand Down
2 changes: 1 addition & 1 deletion project/V.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object V {
val lsp4jV = "0.20.1"
val mavenBloop = "2.0.0"
val mill = "0.11.5"
val mdoc = "2.5.0"
val mdoc = "2.5.1"
val munit = "1.0.0-M10"
val pprint = "0.7.3"
val sbtBloop = bloop
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.6")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.github.reibitto" % "sbt-welcome" % "0.4.0")

Expand Down

0 comments on commit a07ab91

Please sign in to comment.