sbt-coursier icon indicating copy to clipboard operation
sbt-coursier copied to clipboard

Overrride evicted task #170

Open timo-schmid opened this issue 5 years ago • 1 comments

Some shortcomings, for now

  • reverseDependencies doesn't seem to contain the versions, so some of them are missing
  • val conflicts: Seq[Conflict] = Conflict(resolution) returns an empty Seq, not sure why. It would be much nicer to use this.
  • The test is not yet very useful

timo-schmid avatar May 29 '19 16:05 timo-schmid

I did some more research:

  • reverseDependencies doesn't return the versions by design. Not sure why, but it's definitely inteded.
  • Conflict(resolution) will not return dependencies, that are set explicitly, e.g.:
libraryDependencies ++= Seq(
  "org.slf4s" %% "slf4s-api" % "1.7.12",         // depends on org.slf4j:slf4j-api:1.7.12
  "ch.qos.logback" % "logback-classic" % "1.1.2" // depends on org.slf4j:slf4j-api:1.7.6
)
// yields
// [warn] Using org.slf4j:slf4j-api:1.7.12 over 1.7.6
// [warn] (wanted by ch.qos.logback:logback-classic:1.1.2)

and

libraryDependencies ++= Seq(
  "org.typelevel" %% "cats-effect" % "1.3.1", // depends on cats-core 1.6.0
  "org.typelevel" %% "cats-core" % "1.5.0"
)
// yields no warnings

I'm not sure this is the expected behaviour for the evicted task. I think the evicted task should show all the dependencies that were "changed" in the process. Correct me if I'm wrong on that.

So my suggestion would be to add a parameter to coursier.graph.Conflict.apply to control whether or not to show all evicted dependencies. Is that a good solution?

timo-schmid avatar May 29 '19 22:05 timo-schmid