-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scala 2.13.9 #1676
Merged
Merged
scala 2.13.9 #1676
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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.") | ||
|
@@ -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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
else Seq("-target:jvm-1.8") | ||
} | ||
val warnAdaptedArgs = Def.setting { | ||
if (isScala3.value) Nil | ||
|
@@ -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", | ||
|
@@ -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( | ||
|
@@ -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"), | ||
|
@@ -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)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By changing the order of plugin execution, this had a sneaky effect on publishing releases to sonatype as the (incorrect)
publishTo
defined inScalafixBuildPlugin
was effectively ignored until now.This prevents publishing releases
https://github.com/scalacenter/scalafix/actions/runs/3093699216/jobs/5006465269
#1678 (review) should address that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it’s a problem that comes from sbt-version-policy? Please let me know if I need to fix something there :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, thanks for chiming in! The
publishTo
issue was unrelated, the build was clearly wrong, and the change in plugin order accidentally made it visible. We can follow up on scalacenter/sbt-version-policy#138 though.