Slackbot
10/13/2023, 8:21 PMtony
10/13/2023, 8:53 PMConfiguration.incoming.artifactView {
attributes.attribute(attributeKey, "jar")
}.artifacts.artifacts.map { it.file }
does resolve at least some files during configuration. The docs are really unclear on thisTom Tresansky
10/16/2023, 7:02 PMartifacts.artifactFiles does NOT automatically perform resolution, it returns a ResolutionBackedFileCollection which will perform resolution only when its selected artifacts or dependencies are accessed. And artifacts just returns a DefaultArtifactCollection that contains a ResolutionBackedFileCollection, so it behaves in the same lazy manner because it is the same type doing the work.
I agree the docs here aren't great. Where would you expect to find this information: in the Gradle documentation or inline as javadoc?tony
10/16/2023, 7:08 PMartifacts is confusing. It just says something about how it's mainly for use as wiring as a task input, but what does that mean? What is it for? I care about the semantics of these APIs, because I'm trying to actually understand the whole system.
Regarding documentation, in particular, I want to know which method calls result in dependency resolution and which do not. I think that should be called out explicitly everywheretony
10/16/2023, 7:09 PMTom Tresansky
10/16/2023, 7:42 PMgetArtifactFiles() is trying to encourage you to use other methods like getArtifacts() - which provide other information in addition to the artifact files. It is indeed confusing that getArtifacts() suggests it is lazy and getArtifactFiles() does not.
@Laura Kassovic - some feedback to consider here