-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #219 from bjaglin/scala3-testkit
Support Scala 3 in ScalafixTestkitPlugin
- Loading branch information
Showing
24 changed files
with
139 additions
and
157 deletions.
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
lazy val V = _root_.scalafix.sbt.BuildInfo | ||
|
||
lazy val rulesCrossVersions = Seq(V.scala213, V.scala212, V.scala211) | ||
lazy val scala3Version = "3.0.0" | ||
|
||
inThisBuild( | ||
List( | ||
semanticdbEnabled := true, | ||
semanticdbVersion := scalafixSemanticdb.revision | ||
) | ||
) | ||
|
||
lazy val rules = projectMatrix | ||
.settings( | ||
libraryDependencies += "ch.epfl.scala" %% "scalafix-core" % V.scalafixVersion | ||
) | ||
.defaultAxes(VirtualAxis.jvm) | ||
.jvmPlatform(rulesCrossVersions) | ||
|
||
lazy val input = projectMatrix | ||
.defaultAxes(VirtualAxis.jvm) | ||
.jvmPlatform( | ||
scalaVersions = rulesCrossVersions, | ||
settings = Seq( | ||
scalacOptions += "-P:semanticdb:synthetics:on" | ||
) | ||
) | ||
.jvmPlatform(scalaVersions = Seq(scala3Version)) | ||
|
||
lazy val output = projectMatrix | ||
.defaultAxes(VirtualAxis.jvm) | ||
.jvmPlatform(scalaVersions = rulesCrossVersions :+ scala3Version) | ||
|
||
lazy val testsAggregate = Project("tests", file("tests/aggregate")) | ||
.aggregate(tests.projectRefs: _*) | ||
|
||
lazy val tests = projectMatrix | ||
.settings( | ||
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % V.scalafixVersion % Test cross CrossVersion.full, | ||
scalafixTestkitOutputSourceDirectories := | ||
resolveByInputAxis(output, Compile / unmanagedSourceDirectories).value, | ||
scalafixTestkitInputSourceDirectories := | ||
resolveByInputAxis( | ||
input, | ||
Compile / unmanagedSourceDirectories | ||
).value.distinct, // https://github.com/sbt/sbt/pull/6511 | ||
scalafixTestkitInputClasspath := | ||
resolveByInputAxis(input, Compile / fullClasspath).value, | ||
scalafixTestkitInputScalacOptions := | ||
resolveByInputAxis(input, Compile / scalacOptions).value, | ||
scalafixTestkitInputScalaVersion := | ||
resolveByInputAxis(input, Compile / scalaVersion).value | ||
) | ||
.defaultAxes( | ||
rulesCrossVersions.map(VirtualAxis.scalaABIVersion) :+ VirtualAxis.jvm: _* | ||
) | ||
.customRow( | ||
scalaVersions = Seq(V.scala212), | ||
axisValues = Seq(InputAxis(scala3Version), VirtualAxis.jvm), | ||
settings = Seq() | ||
) | ||
.customRow( | ||
scalaVersions = Seq(V.scala213), | ||
axisValues = Seq(InputAxis(V.scala213), VirtualAxis.jvm), | ||
settings = Seq() | ||
) | ||
.customRow( | ||
scalaVersions = Seq(V.scala212), | ||
axisValues = Seq(InputAxis(V.scala212), VirtualAxis.jvm), | ||
settings = Seq() | ||
) | ||
.customRow( | ||
scalaVersions = Seq(V.scala211), | ||
axisValues = Seq(InputAxis(V.scala211), VirtualAxis.jvm), | ||
settings = Seq() | ||
) | ||
.dependsOn(rules) | ||
.enablePlugins(ScalafixTestkitPlugin) |
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.5.2 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-> tests/test | ||
> testsInput3/test:run --save-expect | ||
> tests/test |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/sbt-test/sbt-scalafix/testkit/input/src/main/scala/fix/SemanticBasic.scala
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
src/sbt-test/sbt-scalafix/testkit/output/src/main/scala/fix/SemanticBasic.scala
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...sbt-test/sbt-scalafix/testkit/rules/src/main/resources/META-INF/services/scalafix.v1.Rule
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/sbt-test/sbt-scalafix/testkit/rules/src/main/scala/fix/Semantic.scala
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
src/sbt-test/sbt-scalafix/testkit/tests/src/test/scala/fix/InputOutputSuite.scala
This file was deleted.
Oops, something went wrong.