Skip to content

Commit

Permalink
force usage of custom scalameta for mdoc
Browse files Browse the repository at this point in the history
Coursier seems to prefer mdoc's scalameta 4.8.15 over core2_13's scalameta
4.8.15+150-a7c0baa0-SNAPSHOT. Adding scalameta as a top-level docs2_13
libraryDependencies does change this behavior, so I suspect Coursier is
following nearest-wins semantics for some reason, while we expect it to
following latest-wins semantics.

http://eed3si9n.com/dependency-resolver-semantics#coursiers-latest-wins-semantics

By using dependencyOverrides, we ensure that docs run are generated with the
actual scalameta version used in scalafix, rather than the one used in mdoc.
  • Loading branch information
bjaglin committed Feb 15, 2024
1 parent 2b0d32d commit 0816e76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ lazy val docs = projectMatrix
scalacOptions += "-Wconf:msg='match may not be exhaustive':s", // silence exhaustive pattern matching warning for documentation
scalacOptions += "-Xfatal-warnings",
mdoc := (Compile / run).evaluated,
libraryDependencies += metaconfigDoc
libraryDependencies += metaconfigDoc,
dependencyOverrides += scalameta // force eviction of mdoc transitive dependency
)
.defaultAxes(VirtualAxis.jvm)
.jvmPlatform(scalaVersions = Seq(scala213))
Expand Down

0 comments on commit 0816e76

Please sign in to comment.