Closed ghale closed 6 years ago
@big-guy and I spoke about this and the fundamental question here is should an unrealized Provider
that provides a certain value respond if the realized value is removed from the container before the provider is realized? At least for now, I think the answer is no. DefaultArtifactPublicationSet
is a special case where the provider is kind of transparent to the user, but doesn't really reflect "normal" usage of a provider in a container like this. And, this construct will eventually be deprecated once the publishing plugins are stabilized.
Given this, we've just worked around the issue in the Gradle build where this was a problem. I don't think there's further work to be done here unless we come up with a solid use case demonstrating a need for different behavior here.
Prior to the changes we made to make
DefaultArtifactPublicationSet
lazy, if an artifact was added, it immediately went into thearchives
configuration. This meant that if the artifact was then later removed from thearchives
configuration, it would also be removed fromDefaultArtifactPublicationSet
. Now that this is a lazy provider, if the artifact is removed before the provider is realized, it won't get removed fromDefaultArtifactPublicationSet
, causing it to show up inarchives
again when it's realized.