-
Notifications
You must be signed in to change notification settings - Fork 43
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
Support Scala 3 in ScalafixTestkitPlugin #219
Conversation
9d87478
to
8d18f65
Compare
val values = Map[String, Seq[File]]( | ||
"sourceroot" -> | ||
List(baseDirectory.in(ThisBuild).value), | ||
"inputClasspath" -> | ||
(scalafixTestkitInputClasspath.value | ||
.map(_.data) ++ targetrootClasspath), | ||
scalafixTestkitInputClasspath.value.map(_.data), |
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.
I don't understand everything, we still need to retrieve semanticdbTargetRoot.value.toPath
no to pass it in withTargetRootDirs
?
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.
no, it's captured by parsing scalacOptions
just like the CLI has been doing for years in Scala 2 (that echoes my second bullet on scalacenter/scalafix#1406 (comment))
lazy val testsScala3 = project | ||
.aggregate(tests) | ||
.settings( | ||
crossScalaVersions := List(scala3InputOutputVersion) | ||
) |
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.
this is very confusing - I am working on a sbt-projectmatrix
-based variant locally as I feel like this is hitting the limits of crossScalaVersions
, will push that during the day
6425737
to
58b8255
Compare
@@ -2,7 +2,7 @@ import sbt._ | |||
|
|||
object Dependencies { | |||
val x = List(1) // scalafix:ok | |||
def scalafixVersion: String = "0.9.27+52-6c9eeec9-SNAPSHOT" | |||
def scalafixVersion: String = "0.9.27+78-f41dec8f-SNAPSHOT" |
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.
8afb937
to
98b1695
Compare
* rely on scalafix-testkit to add semanticdbTargetRoot to classpath based on scalacOptions * use sbt-projectmatrix (sbt 1.x only) to make it possible to test Scala 3 input with Scala 2.x * introduce testsAggregate to avoid updating the docs referencing `tests/test` and introducing a breaking change for CI statements
@@ -13,4 +13,8 @@ object Dependencies { | |||
"com.geirsson" %% "coursier-small" % "1.3.3", | |||
"io.get-coursier" % "interface" % "1.0.4" | |||
) | |||
|
|||
val sbt1Plugins = List( | |||
"com.eed3si9n" % "sbt-projectmatrix" % "0.8.0" |
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.
Unfortunately, this is adding a new dependency also for scalafix users (not just rule authors). It does not look like there is a MiMa on it, so this could be a problem if it evicts the user's potential version. I think the risk is very limited, so unless we have such reports, I don't think it's worth creating a separate sbt-scalafix-testkit
artifact.
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.
scalaVersions = Seq(V.scala212), | ||
axisValues = Seq(InputAxis(scala3Version), VirtualAxis.jvm), |
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.
I chose Scala 2.12 because of
scalafixScalaBinaryVersion := "2.12" |
.defaultAxes(VirtualAxis.jvm) | ||
.jvmPlatform(scalaVersions = rulesCrossVersions :+ scala3Version) | ||
|
||
lazy val testsAggregate = Project("tests", file("tests/aggregate")) |
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.
arbitrary path to avoid recompiling, we just want this for tests/test
to aggregate over the tests*
Integrating iterations of scalacenter/scalafix.g8#19 for a proper way to test against different scala versions.
This effectively drops support of sbt 0.13 in
ScalafixTestkitPlugin
, since it now depends on sbt-projectmatrix which is not available.