Skip to content

Conversation

bjaglin
Copy link
Contributor

@bjaglin bjaglin commented Mar 23, 2022

It looks like #5094 didn't really address #5070 as the coursier behavior was not updated (only ivy which relies on fullResolvers).

I haven't found any active usage of includePluginResolvers in open-source, but gitter-badger/bqtest@aa75c2b seems to confirm it does not work as expected.

if (isSbtPlugin) sbtResolvers.value ++ extRes
else extRes
}
val result0 = fullResolvers.value.filterNot(_ == projectResolver.value)
Copy link
Contributor Author

@bjaglin bjaglin Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fullResolvers :=
(Def.task {
val proj = projectResolver.value
val rs = externalResolvers.value
def pluginResolvers: Vector[Resolver] =
buildStructure.value
.units(thisProjectRef.value.build)
.unit
.plugins
.pluginData
.resolvers
.getOrElse(Vector.empty)
val pr =
if (includePluginResolvers.value) pluginResolvers
else Vector.empty
bootResolvers.value match {
case Some(repos) if overrideBuildResolvers.value => proj +: repos
case _ =>
val base = if (sbtPlugin.value) sbtResolvers.value ++ rs ++ pr else rs ++ pr
(proj +: base).distinct
}
}).value,

The filter is not strictly mandatory as https://github.com/coursier/sbt-coursier/blob/fb19697c573489d1ddbd6c3afd9d8609a70c4fec/modules/lm-coursier/src/main/scala/lmcoursier/internal/Resolvers.scala#L114-L115 seems to ignore projectResolver, but I thought it was better not to change the behavior of csrResolvers, particularly if this is backported to 1.6.x.

@bjaglin bjaglin force-pushed the includePluginResolvers branch from 5545516 to fb479ef Compare March 23, 2022 11:25
@bjaglin bjaglin marked this pull request as ready for review March 23, 2022 11:55
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants