mirror of https://github.com/sbt/sbt.git
overload autoPlugins for binary compatibility
This commit is contained in:
parent
adf045d4f8
commit
50f2ebce88
|
|
@ -2885,9 +2885,14 @@ object Classpaths {
|
|||
excl: FileFilter): Classpath =
|
||||
(base * (filter -- excl) +++ (base / config.name).descendantsExcept(filter, excl)).classpath
|
||||
|
||||
def autoPlugins(report: UpdateReport, internalPluginClasspath: Seq[File], scalaVersion: String): Seq[String] = {
|
||||
|
||||
@deprecated("The method only works for Scalac, use the overloaded version to support both Scalac and Dotty", "1.1.5")
|
||||
def autoPlugins(report: UpdateReport, internalPluginClasspath: Seq[File]): Seq[String] =
|
||||
autoPlugins(report, internalPluginClasspath, isDotty = false)
|
||||
|
||||
def autoPlugins(report: UpdateReport, internalPluginClasspath: Seq[File], isDotty: Boolean): Seq[String] = {
|
||||
val pluginClasspath = report.matching(configurationFilter(CompilerPlugin.name)) ++ internalPluginClasspath
|
||||
val plugins = sbt.internal.inc.classpath.ClasspathUtilities.compilerPlugins(pluginClasspath, ScalaInstance.isDotty(scalaVersion))
|
||||
val plugins = sbt.internal.inc.classpath.ClasspathUtilities.compilerPlugins(pluginClasspath, isDotty)
|
||||
plugins.map("-Xplugin:" + _.getAbsolutePath).toSeq
|
||||
}
|
||||
|
||||
|
|
@ -2907,7 +2912,7 @@ object Classpaths {
|
|||
lazy val compilerPluginConfig = Seq(
|
||||
scalacOptions := {
|
||||
val options = scalacOptions.value
|
||||
val newPlugins = autoPlugins(update.value, internalCompilerPluginClasspath.value.files, scalaVersion.value)
|
||||
val newPlugins = autoPlugins(update.value, internalCompilerPluginClasspath.value.files, ScalaInstance.isDotty(scalaVersion.value))
|
||||
val existing = options.toSet
|
||||
if (autoCompilerPlugins.value) options ++ newPlugins.filterNot(existing) else options
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue