From 8bd4073ec21ece145331e55e72f1761fec2d3257 Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Mon, 1 Jul 2019 10:17:53 +0200 Subject: [PATCH 1/2] Switch to sbt-coursier 2.0.0-RC2 --- project/project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/project/plugins.sbt b/project/project/plugins.sbt index c1f826708..7a05b6941 100644 --- a/project/project/plugins.sbt +++ b/project/project/plugins.sbt @@ -1 +1 @@ -addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.1.0-M14-4") +addSbtPlugin("io.get-coursier" % "sbt-coursier" % "2.0.0-RC2") From 50c69c36344f2e89195f5e5d57a6f3b3376145f9 Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Tue, 2 Jul 2019 14:01:08 +0200 Subject: [PATCH 2/2] Fix mima checks --- build.sbt | 3 +++ .../credentials/DirectCredentials.scala | 7 ------ project/Mima.scala | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 740d2528c..245010973 100644 --- a/build.sbt +++ b/build.sbt @@ -23,6 +23,7 @@ lazy val `lm-coursier` = project .settings( shared, Mima.settings, + Mima.lmCoursierFilters, libraryDependencies ++= Seq( "io.get-coursier" %% "coursier" % coursierVersion0, // We depend on librarymanagement-ivy rather than just @@ -41,6 +42,8 @@ lazy val `lm-coursier-shaded` = project .settings( shared, Mima.settings, + Mima.lmCoursierFilters, + Mima.lmCoursierShadedFilters, unmanagedSourceDirectories.in(Compile) := unmanagedSourceDirectories.in(Compile).in(`lm-coursier`).value, shading, shadingNamespace := "lmcoursier.internal.shaded", diff --git a/modules/lm-coursier/src/main/scala/lmcoursier/credentials/DirectCredentials.scala b/modules/lm-coursier/src/main/scala/lmcoursier/credentials/DirectCredentials.scala index 476863e73..e05cbe93c 100644 --- a/modules/lm-coursier/src/main/scala/lmcoursier/credentials/DirectCredentials.scala +++ b/modules/lm-coursier/src/main/scala/lmcoursier/credentials/DirectCredentials.scala @@ -2,8 +2,6 @@ package lmcoursier.credentials import java.net.URI -import coursier.core.Authentication - final class DirectCredentials private( val host: String, val username: String, @@ -77,11 +75,6 @@ final class DirectCredentials private( user == username } - def authentication: Authentication = - Authentication(username, password) - .withRealm(realm) - .withOptional(optional) - def get(): Seq[DirectCredentials] = Seq(this) diff --git a/project/Mima.scala b/project/Mima.scala index bdb5dfb02..7326f5eea 100644 --- a/project/Mima.scala +++ b/project/Mima.scala @@ -1,5 +1,6 @@ import com.typesafe.tools.mima.plugin.MimaPlugin +import com.typesafe.tools.mima.plugin.MimaKeys._ import sbt._ import sbt.Keys._ import sys.process._ @@ -30,4 +31,28 @@ object Mima { } ) + lazy val lmCoursierFilters = { + mimaBinaryIssueFilters ++= { + import com.typesafe.tools.mima.core._ + + Seq( + // Removed unused method, shouldn't have been there in the first place + ProblemFilters.exclude[DirectMissingMethodProblem]("lmcoursier.credentials.DirectCredentials.authentication") + ) + } + } + + lazy val lmCoursierShadedFilters = { + mimaBinaryIssueFilters ++= { + import com.typesafe.tools.mima.core._ + + Seq( + // Should have been put under lmcoursier.internal? + (pb: Problem) => pb.matchName.forall(!_.startsWith("lmcoursier.definitions.ToCoursier.")), + // ignore shaded and internal stuff related errors + (pb: Problem) => pb.matchName.forall(!_.startsWith("lmcoursier.internal.")) + ) + } + } + }