From dab476ab932f87b2de7e2fd92541c72e7929311d Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Mon, 4 Mar 2019 12:12:41 +0100 Subject: [PATCH] Add extra check The size == 1 check just below is required for scripted to work fine. (The first module report must correspond to the passed dependency for scripted to find the sbt launcher JAR.) It seems under some conditions, the sbt launcher dependency ends up being duplicated (it's already duplicated in the allDependencies task, that should be set by sbt). This in turn makes the check fail, and makes scripted not find the sbt launcher. This happens with playframework/interplay at commit d782b75. The call to distinct circumvents that case. --- .../src/main/scala/coursier/lmcoursier/ToSbt.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/lm-coursier/src/main/scala/coursier/lmcoursier/ToSbt.scala b/modules/lm-coursier/src/main/scala/coursier/lmcoursier/ToSbt.scala index 258dd163b..53143405e 100644 --- a/modules/lm-coursier/src/main/scala/coursier/lmcoursier/ToSbt.scala +++ b/modules/lm-coursier/src/main/scala/coursier/lmcoursier/ToSbt.scala @@ -218,7 +218,11 @@ object ToSbt { val configReports = configs.map { case (config, extends0) => - val configDeps = extends0.toSeq.sortBy(_.value).flatMap(configDependencies.getOrElse(_, Nil)) + val configDeps = extends0 + .toSeq + .sortBy(_.value) + .flatMap(configDependencies.getOrElse(_, Nil)) + .distinct val subRes = resolutions(config).subset(configDeps) val reports = ToSbt.moduleReports(