From 27c2f2b63bfbe245d45f476f1ebb0b9907f47d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CRazvan?= Date: Fri, 5 Aug 2022 14:25:55 +0200 Subject: [PATCH] Squashed commits: scalafix-cli3 cross compiled for scala3 This is the commit message #2: build dbt cli This is the commit message #2: removed cli3 duplicate entry for TPrintImplicits --- build.sbt | 11 ++++++++--- project/ScalafixBuild.scala | 1 + .../interfaces/ScalafixFileEvaluationImpl.scala | 2 +- .../internal/interfaces/ScalafixInputImpl.scala | 1 + .../src/main/scala/scalafix/internal/v1/MainOps.scala | 1 + .../scala/scalafix/internal/v1/ValidatedArgs.scala | 1 + 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 8b609307a..006753ea8 100644 --- a/build.sbt +++ b/build.sbt @@ -137,13 +137,18 @@ lazy val cli = projectMatrix moduleName := "scalafix-cli", isFullCrossVersion, libraryDependencies ++= Seq( - java8Compat, nailgunServer, jgit, commonText ), libraryDependencies ++= { - if (isScala211.value) Seq() + if (!isScala3.value) + Seq(java8Compat) + else + Seq() + }, + libraryDependencies ++= { + if (isScala211.value || isScala3.value) Seq() else Seq( // metaconfig 0.10.0 shaded pprint but rules built with an old @@ -158,7 +163,7 @@ lazy val cli = projectMatrix }.value ) .defaultAxes(VirtualAxis.jvm) - .jvmPlatform(buildScalaVersions) + .jvmPlatform(buildScalaVersions :+ scala3) .dependsOn(reflect, interfaces, rules) lazy val testsShared = projectMatrix diff --git a/project/ScalafixBuild.scala b/project/ScalafixBuild.scala index 25a280ba7..f8c4cf229 100644 --- a/project/ScalafixBuild.scala +++ b/project/ScalafixBuild.scala @@ -146,6 +146,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys { "core3/compile" :: "rules3/compile" :: "reflect3/compile" :: + "cli3/compile" :: // TODO replace core rules and reflect with unit3 in the end s }, commands += Command.command("ci-213") { s => diff --git a/scalafix-cli/src/main/scala/scalafix/internal/interfaces/ScalafixFileEvaluationImpl.scala b/scalafix-cli/src/main/scala/scalafix/internal/interfaces/ScalafixFileEvaluationImpl.scala index 8e72226a9..62515ab13 100644 --- a/scalafix-cli/src/main/scala/scalafix/internal/interfaces/ScalafixFileEvaluationImpl.scala +++ b/scalafix-cli/src/main/scala/scalafix/internal/interfaces/ScalafixFileEvaluationImpl.scala @@ -143,7 +143,7 @@ object ScalafixFileEvaluationImpl { ctx: RuleCtx, index: Option[v0.SemanticdbIndex] ): ScalafixFileEvaluationImpl = { - val scalafixPatches = patches.map(ScalafixPatchImpl) + val scalafixPatches = patches.map(ScalafixPatchImpl.apply) ScalafixFileEvaluationImpl( originalPath = originalPath, fixedOpt = fixed, diff --git a/scalafix-cli/src/main/scala/scalafix/internal/interfaces/ScalafixInputImpl.scala b/scalafix-cli/src/main/scala/scalafix/internal/interfaces/ScalafixInputImpl.scala index 4840f7cbc..691d99bc2 100644 --- a/scalafix-cli/src/main/scala/scalafix/internal/interfaces/ScalafixInputImpl.scala +++ b/scalafix-cli/src/main/scala/scalafix/internal/interfaces/ScalafixInputImpl.scala @@ -7,6 +7,7 @@ import java.util.Optional import scala.{meta => m} import scala.meta.inputs.Input +import scala.meta.internal.inputs.XtensionInputSyntaxStructure import scalafix.interfaces.ScalafixInput diff --git a/scalafix-cli/src/main/scala/scalafix/internal/v1/MainOps.scala b/scalafix-cli/src/main/scala/scalafix/internal/v1/MainOps.scala index b322f862c..bac970b01 100644 --- a/scalafix-cli/src/main/scala/scalafix/internal/v1/MainOps.scala +++ b/scalafix-cli/src/main/scala/scalafix/internal/v1/MainOps.scala @@ -19,6 +19,7 @@ import scala.util.control.NoStackTrace import scala.util.control.NonFatal import scala.meta.inputs.Input +import scala.meta.internal.inputs.XtensionInputSyntaxStructure import scala.meta.internal.semanticdb.TextDocument import scala.meta.io.AbsolutePath import scala.meta.parsers.ParseException diff --git a/scalafix-cli/src/main/scala/scalafix/internal/v1/ValidatedArgs.scala b/scalafix-cli/src/main/scala/scalafix/internal/v1/ValidatedArgs.scala index bf7a3f43e..be0a0b784 100644 --- a/scalafix-cli/src/main/scala/scalafix/internal/v1/ValidatedArgs.scala +++ b/scalafix-cli/src/main/scala/scalafix/internal/v1/ValidatedArgs.scala @@ -3,6 +3,7 @@ package scalafix.internal.v1 import scala.meta.AbsolutePath import scala.meta.Input import scala.meta.Source +import scala.meta.internal.inputs.XtensionInputSyntaxStructure import scala.meta.internal.io.FileIO import scala.meta.internal.symtab.SymbolTable import scala.meta.io.RelativePath