Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Stay on the Scala 3 LTS line (3.3.x), don't update to 3.4.x and later
updates.pin = [
{ groupId = "org.scala-lang", artifactId = "scala3-library", version = { prefix = "3.3." } },
{ groupId = "org.scala-lang", artifactId = "scala3-library_sjs1", version = { prefix = "3.3." } },
{ groupId = "org.scala-lang", artifactId = "scala3-library_native0.5", version = { prefix = "3.3." } },
{ groupId = "org.scala-lang", artifactId = "scala3-compiler", version = { prefix = "3.3." } }
]
21 changes: 17 additions & 4 deletions build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ trait VersionsPublishModule extends PublishModule with VersionsMima {
trait Versions extends Cross.Module[String] with ScalaModule with VersionsPublishModule {
def artifactName = "versions"
def scalaVersion = crossValue
// first version with Scala 3 artifacts
private def scala3CutOff = "0.6.0"
def mimaPreviousVersions = Task {
import _root_.coursier.version.Version
val previousVersions = super.mimaPreviousVersions()
if (scalaVersion().startsWith("3.")) {
val cutOff = Version("0.6.0")
val cutOff = Version(scala3CutOff)
previousVersions
.map(Version(_))
.filter(_ >= cutOff)
Expand All @@ -113,12 +115,23 @@ trait Versions extends Cross.Module[String] with ScalaModule with VersionsPublis
previousVersions
}
def mimaPreviousArtifacts = Task {
import _root_.coursier.version.Version
val artifacts = super.mimaPreviousArtifacts()
if (scalaVersion().startsWith("3.")) {
// Before the first Scala 3 artifacts, Scala 3 users relied on the Scala 2.13 ones,
// so check binary compatibility against those too. From that version on, the Scala 3
// artifacts above are the ones to check against - the Scala 2.13 ones differ from
// them in ways that are expected (case class unapply signature, default arguments
// getters, …).
val cutOff = Version(scala3CutOff)
val artifactId213 = artifactId().stripSuffix("_3") + "_2.13"
val artifacts213 = super.mimaPreviousVersions().distinct.map(version =>
mvn"${pomSettings().organization}:$artifactId213:$version"
)
val artifacts213 = super.mimaPreviousVersions()
.distinct
.map(Version(_))
.filter(_ < cutOff)
.map(version =>
mvn"${pomSettings().organization}:$artifactId213:${version.repr}"
)
artifacts ++ artifacts213
} else
artifacts
Expand Down