diff --git a/project/Build.scala b/project/Build.scala index 89224bc2..1afc5f5d 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -167,13 +167,37 @@ object MimaBuild { settings(scriptedSettings) settings(name := "sbt-mima-plugin", sbtPlugin := true, + libraryDependencies += Defaults.sbtPluginExtra( + "com.dwijnand" % "sbt-compat" % "1.0.0", + (sbtBinaryVersion in pluginCrossBuild).value, + (scalaBinaryVersion in update).value + ), scriptedLaunchOpts := scriptedLaunchOpts.value :+ "-Dplugin.version=" + version.value, scriptedBufferLog := false, // Scripted locally publishes sbt plugin and then runs test projects with locally published version. // Therefore we also need to locally publish dependent projects on scripted test run. scripted := (scripted dependsOn (publishLocal in core, publishLocal in reporter)).evaluated) dependsOn(reporter) - settings(sbtPublishSettings:_*) + settings( + sbtPublishSettings, + mimaBinaryIssueFilters ++= { + import com.typesafe.tools.mima.core._ + Seq( + // sbt-compat has been created to define these and has been added as a dependency of sbt-mima-plugin + ProblemFilters.exclude[MissingClassProblem]("sbt.compat"), + ProblemFilters.exclude[MissingClassProblem]("sbt.compat$"), + ProblemFilters.exclude[MissingClassProblem]("sbt.librarymanagement.package"), + ProblemFilters.exclude[MissingClassProblem]("sbt.librarymanagement.package$"), + ProblemFilters.exclude[MissingClassProblem]("sbt.librarymanagement.package$UpdateConfigurationOps"), + ProblemFilters.exclude[MissingClassProblem]("sbt.librarymanagement.package$UpdateConfigurationOps$"), + ProblemFilters.exclude[MissingClassProblem]("sbt.librarymanagement.UpdateConfiguration"), + ProblemFilters.exclude[MissingClassProblem]("sbt.librarymanagement.UpdateConfiguration$"), + ProblemFilters.exclude[MissingClassProblem]("sbt.librarymanagement.DependencyResolution"), + ProblemFilters.exclude[MissingClassProblem]("sbt.librarymanagement.ivy.IvyDependencyResolution"), + ProblemFilters.exclude[MissingClassProblem]("sbt.librarymanagement.ivy.IvyDependencyResolution$") + ) + } + ) ) lazy val reporterFunctionalTests = project("reporter-functional-tests", diff --git a/project/plugins.sbt b/project/plugins.sbt index c09e321d..98b36df5 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -17,4 +17,4 @@ libraryDependencies += "com.typesafe" % "config" % "1.3.0" addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.15") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.17") diff --git a/sbtplugin/src/main/scala-sbt-0.13/compat.scala b/sbtplugin/src/main/scala-sbt-0.13/compat.scala deleted file mode 100644 index d5e5cff3..00000000 --- a/sbtplugin/src/main/scala-sbt-0.13/compat.scala +++ /dev/null @@ -1,73 +0,0 @@ -package sbt - -// sbt 1 -> sbt 0.13 compatibility -// Exposes (a minimal part) of the sbt 1 API using sbt 0.13 API -// Inspired by macro-compat - -object compat { - val scalaModuleInfo = SettingKey[Option[librarymanagement.ScalaModuleInfo]]("ivyScala") - - implicit class ModuleIdOps(val _m: ModuleID) extends AnyVal { - def withName(n: String): ModuleID = _m copy (name = n) - } -} - -package librarymanagement { - object `package` { - final val UpdateLogging = sbt.UpdateLogging - type ModuleDescriptor = IvySbt#Module - type UpdateLogging = UpdateLogging.Value - type UpdateConfiguration = sbt.UpdateConfiguration - type ScalaModuleInfo = IvyScala - - implicit class UpdateConfigurationOps(val _uc: UpdateConfiguration) extends AnyVal { - def withLogging(ul: UpdateLogging): UpdateConfiguration = _uc copy (logging = ul) - } - } - - object UpdateConfiguration { - def apply() = new UpdateConfiguration(None, false, UpdateLogging.Default) - } - - class DependencyResolution(ivy: IvySbt) { - def wrapDependencyInModule(m: ModuleID): ModuleDescriptor = { - val moduleSettings = InlineConfiguration( - "dummy" % "test" % "version", - ModuleInfo("dummy-test-project-for-resolving"), - dependencies = Seq(m) - ) - new ivy.Module(moduleSettings) - } - - def update( - module: ModuleDescriptor, - configuration: UpdateConfiguration, - uwconfig: UnresolvedWarningConfiguration, - log: Logger - ): Either[UnresolvedWarning, UpdateReport] = - IvyActions.updateEither( - module, - new UpdateConfiguration( - retrieve = None, - missingOk = false, - logging = UpdateLogging.DownloadOnly - ), - UnresolvedWarningConfiguration(), - LogicalClock.unknown, - None, - log - ) - } - - package ivy { - object IvyDependencyResolution { - def apply(configuration: IvyConfiguration): DependencyResolution = - new DependencyResolution(new IvySbt(configuration)) - } - } -} - -package internal { - package librarymanagement { - } -} diff --git a/sbtplugin/src/main/scala-sbt-1.0/compat.scala b/sbtplugin/src/main/scala-sbt-1.0/compat.scala deleted file mode 100644 index 8e4304ca..00000000 --- a/sbtplugin/src/main/scala-sbt-1.0/compat.scala +++ /dev/null @@ -1,3 +0,0 @@ -package sbt - -object compat