From 87d8cac4ece8328d807c493749d2da33ffe59a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Mickevi=C4=8Dius?= Date: Fri, 26 Feb 2016 12:07:53 +0200 Subject: [PATCH] Added abstract method test. --- .../sbt-mima-plugin/backward-abstract-method/build.sbt | 8 ++++++++ .../backward-abstract-method/project/plugins.sbt | 1 + .../backward-abstract-method/src/main/A.scala | 4 ++++ .../backward-abstract-method/src/v1/A.scala | 3 +++ .../sbt-mima-plugin/backward-abstract-method/test | 10 ++++++++++ 5 files changed, 26 insertions(+) create mode 100644 sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/build.sbt create mode 100644 sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/project/plugins.sbt create mode 100644 sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/src/main/A.scala create mode 100644 sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/src/v1/A.scala create mode 100644 sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/test diff --git a/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/build.sbt b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/build.sbt new file mode 100644 index 00000000..1b0c3511 --- /dev/null +++ b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/build.sbt @@ -0,0 +1,8 @@ +import com.typesafe.tools.mima.core._ + +mimaPreviousArtifacts := Set("0.0.1-SNAPSHOT") map { v => organization.value %% name.value % v } + +val issueFilters = SettingKey[Map[String, Seq[ProblemFilter]]]("") +issueFilters := Map( + "0.0.1-SNAPSHOT" -> Seq(ProblemFilters.exclude[MissingMethodProblem]("A.bar")) +) diff --git a/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/project/plugins.sbt b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/project/plugins.sbt new file mode 100644 index 00000000..3a6fa8ab --- /dev/null +++ b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % System.getProperty("plugin.version")) diff --git a/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/src/main/A.scala b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/src/main/A.scala new file mode 100644 index 00000000..a0c044a0 --- /dev/null +++ b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/src/main/A.scala @@ -0,0 +1,4 @@ +abstract class A { + def foo: Int + def bar: Int +} diff --git a/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/src/v1/A.scala b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/src/v1/A.scala new file mode 100644 index 00000000..9ddfdc21 --- /dev/null +++ b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/src/v1/A.scala @@ -0,0 +1,3 @@ +abstract class A { + def foo: Int +} diff --git a/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/test b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/test new file mode 100644 index 00000000..31a014ca --- /dev/null +++ b/sbtplugin/src/sbt-test/sbt-mima-plugin/backward-abstract-method/test @@ -0,0 +1,10 @@ +> set scalaSource in Compile := baseDirectory.value /"src" /"v1" +> set version := s"0.0.1-SNAPSHOT" +> publishLocal + +> set scalaSource in Compile := baseDirectory.value /"src" /"main" +> set version := s"0.0.2-SNAPSHOT" + +-> mimaReportBinaryIssues +> set mimaBackwardIssueFilters := issueFilters.value +> mimaReportBinaryIssues