summaryrefslogtreecommitdiff
path: root/integration/test/resources/play-json/mima.sc
diff options
context:
space:
mode:
authorNikolay Tatarinov <5min4eq.unity@gmail.com>2018-03-28 01:33:11 +0300
committerGitHub <noreply@github.com>2018-03-28 01:33:11 +0300
commit83aeb8976d90ad1637243953a9af37e6d4206c52 (patch)
tree346e52db0d80c7fb7bdab8013acb38ef8be55fbb /integration/test/resources/play-json/mima.sc
parenta796f0a1381632560b6251a93466957319065966 (diff)
downloadmill-83aeb8976d90ad1637243953a9af37e6d4206c52.tar.gz
mill-83aeb8976d90ad1637243953a9af37e6d4206c52.tar.bz2
mill-83aeb8976d90ad1637243953a9af37e6d4206c52.zip
WIP: Play json build (#182)
* play json build * build progress * add check task * try to make play json js build * scalariform and mima plugins in separate files. check mima * better error message for mima compatibility check * fix scala 2.10 compilation * license headers support * add jmh support * fix reformat on compile; fix code validation; extract base module * remove scala 2.13 from cross versions * include play-json in integration tests * add example .travis.yml * bring back scala 2.13 support * make reformat target, not command * add release task * update mill version in travis.yml * update release script * update release process * add README.md for play json build
Diffstat (limited to 'integration/test/resources/play-json/mima.sc')
-rw-r--r--integration/test/resources/play-json/mima.sc58
1 files changed, 58 insertions, 0 deletions
diff --git a/integration/test/resources/play-json/mima.sc b/integration/test/resources/play-json/mima.sc
new file mode 100644
index 00000000..ebab2c72
--- /dev/null
+++ b/integration/test/resources/play-json/mima.sc
@@ -0,0 +1,58 @@
+import ammonite.ops._
+import $ivy.`com.typesafe::mima-reporter:0.1.18`
+import com.typesafe.tools.mima.lib.MiMaLib
+import com.typesafe.tools.mima.core._
+import mill._, scalalib._
+
+trait MiMa extends ScalaModule with PublishModule {
+ def previousVersions = T {
+ scalaVersion().split('.')(1) match {
+ case "10" => Seq("2.6.0")
+ case "11" => Seq("2.6.0")
+ case "12" => Seq("2.6.0")
+ case _ => Nil
+ }
+ }
+
+ def mimaBinaryIssueFilters: Seq[ProblemFilter] = Seq.empty
+
+ def previousDeps = T {
+ Agg.from(previousVersions().map { version =>
+ Dep.Java(
+ pomSettings().organization,
+ artifactId(),
+ version,
+ cross = false
+ )
+ })
+ }
+
+ def previousArtifacts = T {
+ resolveDeps(previousDeps)().filter(_.path.segments.contains(artifactId()))
+ }
+
+ def mimaReportBinaryIssues: T[List[(String, List[String])]] = T {
+ val currentClassfiles = compile().classes.path
+ val classpath = runClasspath()
+
+ val lib = {
+ com.typesafe.tools.mima.core.Config.setup("sbt-mima-plugin", Array.empty)
+ val cpstring = classpath
+ .map(_.path)
+ .filter(exists)
+ .mkString(System.getProperty("path.separator"))
+ new MiMaLib(
+ com.typesafe.tools.mima.core.reporterClassPath(cpstring)
+ )
+ }
+
+ previousArtifacts().toList.map { path =>
+ val problems =
+ lib.collectProblems(path.path.toString, currentClassfiles.toString)
+ path.path.toString -> problems.filter { problem =>
+ mimaBinaryIssueFilters.forall(_.apply(problem))
+ }.map(_.description("current"))
+ }
+ }
+
+}