Skip to content

Commit

Permalink
update scalameta version (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlachkar committed Jun 14, 2021
1 parent 3a645b3 commit 4005462
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inThisBuild(
List(
scalaVersion := V.scala213,
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision, // use Scalafix compatible version
semanticdbVersion := V.scalameta,
scalafixScalaBinaryVersion := V.scala213BinaryVersion,
scalafixDependencies ++= List("com.github.liancheng" %% "organize-imports" % V.organizeImports),
organization := "ch.epfl.scala",
Expand Down Expand Up @@ -110,7 +110,7 @@ lazy val `sbt-plugin` = project
name,
"scala3Version" -> V.scala3,
"scalaBinaryVersion" -> V.scala213BinaryVersion,
"semanticdbVersion" -> V.semanticdbVersion,
"scalametaVersion" -> V.scalameta,
version
)
)
Expand Down Expand Up @@ -216,7 +216,7 @@ lazy val V = new {
val kindProjector = "0.13.0"
val coursierApi = "2.0.16"
val coursierInterface = "1.0.4"
val semanticdbVersion = "4.4.10"
val scalameta = "4.4.21"
val localSnapshotVersion = "0.4.0-SNAPSHOT"
val zio = "1.0.8"
}
20 changes: 11 additions & 9 deletions plugin/src/main/scala/migrate/ScalaMigratePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ case class Scala2Inputs(
)

object ScalaMigratePlugin extends AutoPlugin {
private[migrate] val syntheticsOn = "-P:semanticdb:synthetics:on"
private[migrate] val migrationOn = "-source:3.0-migration"
private[migrate] val scalaBinaryVersion = BuildInfo.scalaBinaryVersion
private[migrate] val migrateVersion = BuildInfo.version
private[migrate] val scala3Version = BuildInfo.scala3Version
private[migrate] val migrateSemanticdbVersion = BuildInfo.semanticdbVersion
private[migrate] val migrateAPI = Migrate.fetchAndClassloadInstance(migrateVersion, scalaBinaryVersion)
private[migrate] val syntheticsOn = "-P:semanticdb:synthetics:on"
private[migrate] val migrationOn = "-source:3.0-migration"
private[migrate] val scalaBinaryVersion = BuildInfo.scalaBinaryVersion
private[migrate] val migrateVersion = BuildInfo.version
private[migrate] val scala3Version = BuildInfo.scala3Version
private[migrate] val migrateScalametaVersion = BuildInfo.scalametaVersion
private[migrate] val migrateAPI = Migrate.fetchAndClassloadInstance(migrateVersion, scalaBinaryVersion)

private[migrate] val inputsStore: mutable.Map[Scope, Scala2Inputs] = mutable.Map()

Expand Down Expand Up @@ -72,8 +72,10 @@ object ScalaMigratePlugin extends AutoPlugin {
},
semanticdbVersion := {
val sv = scalaVersion.value
if (sv.startsWith("2.13.")) migrateSemanticdbVersion
else semanticdbVersion.value
if (sv.startsWith("2.13.")) {
val actual = semanticdbVersion.value
if (actual > migrateScalametaVersion) actual else migrateScalametaVersion
} else semanticdbVersion.value
},
migrationConfigs := migrationConfigsImpl.value,
migrationConfigs / aggregate := false,
Expand Down

0 comments on commit 4005462

Please sign in to comment.