Skip to content

Commit

Permalink
Scala 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
joan38 committed Jun 10, 2021
1 parent 4be5724 commit 0aab704
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import mill.{Agg, T}
import mill.api.{Logger, Loose, Result}
import mill.scalalib.{Dep, DepSyntax, ScalaModule}
import mill.define.{Command, Target}
import mill.scalalib.api.Util.isScala3
import os._
import scalafix.interfaces.Scalafix
import scalafix.interfaces.ScalafixError._
Expand All @@ -13,8 +14,12 @@ import scala.compat.java8.OptionConverters._
import scala.jdk.CollectionConverters._

trait ScalafixModule extends ScalaModule {
override def scalacPluginIvyDeps: Target[Loose.Agg[Dep]] =
super.scalacPluginIvyDeps() ++ Agg(ivy"org.scalameta:::semanticdb-scalac:${Versions.semanticdbScalac}")
override def scalacPluginIvyDeps: Target[Loose.Agg[Dep]] = super.scalacPluginIvyDeps() ++
(if (isScala3(scalaVersion())) Agg.empty
else Agg(ivy"org.scalameta:::semanticdb-scalac:${Versions.semanticdbScalac}"))

override def scalacOptions: Target[Seq[String]] = super.scalacOptions() ++
(if (isScala3(scalaVersion())) Seq("-Xsemanticdb") else Seq.empty)

def scalafixConfig: T[Option[Path]] = T(None)
def scalafixIvyDeps: T[Agg[Dep]] = Agg.empty[Dep]
Expand Down

0 comments on commit 0aab704

Please sign in to comment.