Skip to content

Commit

Permalink
Merge pull request #1676 from bjaglin/scala2139
Browse files Browse the repository at this point in the history
scala 2.13.9
  • Loading branch information
bjaglin authored Sep 20, 2022
2 parents 480cda1 + 7c158ed commit e3d4b24
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
6 changes: 3 additions & 3 deletions bin/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ cs resolve \
ch.epfl.scala:scalafix-core_2.13:$version \
ch.epfl.scala:scalafix-reflect_2.11.12:$version \
ch.epfl.scala:scalafix-reflect_2.12.17:$version \
ch.epfl.scala:scalafix-reflect_2.13.8:$version \
ch.epfl.scala:scalafix-reflect_2.13.9:$version \
ch.epfl.scala:scalafix-cli_2.11.12:$version \
ch.epfl.scala:scalafix-cli_2.12.17:$version \
ch.epfl.scala:scalafix-cli_2.13.8:$version \
ch.epfl.scala:scalafix-cli_2.13.9:$version \
ch.epfl.scala:scalafix-testkit_2.11.12:$version \
ch.epfl.scala:scalafix-testkit_2.12.17:$version \
ch.epfl.scala:scalafix-testkit_2.13.8:$version \
ch.epfl.scala:scalafix-testkit_2.13.9:$version \
-r sonatype:public
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import scala.util.Try
object Dependencies {
val scala211 = "2.11.12"
val scala212 = "2.12.17"
val scala213 = "2.13.8"
val scala213 = "2.13.9"
val scala3 = "3.1.3"

val buildScalaVersions = Seq(scala211, scala212, scala213)
Expand Down
33 changes: 22 additions & 11 deletions project/ScalafixBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import sbt.plugins.JvmPlugin
import com.typesafe.tools.mima.plugin.MimaPlugin.autoImport._
import sbtbuildinfo.BuildInfoKey
import sbtbuildinfo.BuildInfoPlugin.autoImport._
import sbtversionpolicy.SbtVersionPolicyPlugin
import sbtversionpolicy.SbtVersionPolicyPlugin.autoImport._
import scalafix.sbt.ScalafixPlugin.autoImport._
import com.typesafe.sbt.sbtghpages.GhpagesKeys
Expand All @@ -15,7 +16,9 @@ import sbt.plugins.IvyPlugin

object ScalafixBuild extends AutoPlugin with GhpagesKeys {
override def trigger = allRequirements
override def requires = JvmPlugin && IvyPlugin
override def requires =
JvmPlugin &&
SbtVersionPolicyPlugin // don't let it override our mimaPreviousArtifacts
object autoImport {
lazy val stableVersion =
settingKey[String]("Version of latest release to Maven.")
Expand Down Expand Up @@ -55,8 +58,9 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
else Nil
}
lazy val targetJvm = Def.setting {
if (isScala3.value) "-Xtarget:8"
else "-target:jvm-1.8"
if (isScala3.value) Seq("-Xtarget:8")
else if (isScala213.value) Seq("-release", "8")
else Seq("-target:jvm-1.8")
}
val warnAdaptedArgs = Def.setting {
if (isScala3.value) Nil
Expand All @@ -80,8 +84,8 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
}
lazy val compilerOptions = Def.setting(
warnUnusedImports.value ++
targetJvm.value ++
Seq(
targetJvm.value,
"-encoding",
"UTF-8",
"-feature",
Expand Down Expand Up @@ -174,6 +178,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
)

private val PreviousScalaVersion: Map[String, String] = Map(
"2.13.9" -> "2.13.8"
)

override def buildSettings: Seq[Setting[_]] = List(
Expand All @@ -191,6 +196,19 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
)

override def projectSettings: Seq[Def.Setting[_]] = List(
// avoid "missing dependency" on artifacts with full scala version when bumping scala
versionPolicyIgnored ++= {
PreviousScalaVersion.get(scalaVersion.value) match {
case Some(previous) =>
// all transitive dependencies with full scala version we know about
Seq(
"org.scalameta" % s"semanticdb-scalac-core_$previous",
"ch.epfl.scala" % s"scalafix-cli_$previous",
"ch.epfl.scala" % s"scalafix-reflect_$previous"
)
case None => Seq()
}
},
// don't publish scala 3 artifacts for now
publish / skip := (if ((publish / skip).value) true
else scalaBinaryVersion.value == "3"),
Expand Down Expand Up @@ -235,13 +253,6 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
organizationName.value % previousScalaVCrossName % stableVersion.value
)
},
mimaDependencyResolution := {
// effectively reverts https://github.com/lightbend/mima/pull/508 since the
// Coursier resolution ignores/overrides the explicit scala full version set
// in mimaPreviousArtifacts
val ivy = sbt.Keys.ivySbt.value
IvyDependencyResolution(ivy.configuration)
},
mimaBinaryIssueFilters ++= Mima.ignoredABIProblems
) ++ Seq(Compile, Test).flatMap(conf => inConfig(conf)(configSettings))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
[116:12..116:22]: test/Test.C#ByNameType. => final object ByNameType extends AnyRef { +1 decls }
[117:11..117:13]: test/Test.C#ByNameType.m1(). => method m1(x: => Int): Int
[117:14..117:15]: test/Test.C#ByNameType.m1().(x) => param x: => Int
[120:16..120:28]: test/Test.C#RepeatedType# => case class RepeatedType extends AnyRef with Product with Serializable { +12 decls }
[120:16..120:28]: test/Test.C#RepeatedType# => case class RepeatedType extends AnyRef with Product with Serializable { +11 decls }
[120:28..120:28]: test/Test.C#RepeatedType#`<init>`(). => primary ctor <init>(val s: String*)
[120:29..120:30]: test/Test.C#RepeatedType#s. => val method s: String*
[121:11..121:13]: test/Test.C#RepeatedType#m1(). => method m1(x: Int*): Int
Expand Down

0 comments on commit e3d4b24

Please sign in to comment.