Dmitry Lapshin
01/08/2025, 7:23 PMConfiguration.getResolvedConfiguration() to Configuration.getIncoming() ?
I've found an observable behaviour change, even though it's a bit small: if one adds file dependencies (like implementation(files("libs/a.jar"))):
• Old API wouldn't return them from ResolvedConfiguration.getResolvedArtifacts() but would return them in ResolvedConfiguration.getFiles(),
• But new one will return both from ResolvableConfiguration.getArtifacts(), but for standalone files their ResolvedArtifactResult.getId() would be (at 8.12 at least) of org.gradle.internal.component.local.model.OpaqueComponentArtifactIdentifier , and the only things accessible without using the internal class are `toString`/`displayName` and friends, and they aren't fully informative, for me they only contain file name.
On older API I've run through ResolvedConfiguration.getFiles() and for all files not found in .getResolvedArtifacts() I'd mark them down for my usage by their path, but in new API those are in artifacts, and the component name lacks full path.Dmitry Lapshin
01/08/2025, 7:29 PMResolvedArtifactResult.getVariant().getOwner() , at least for the files it's the same.Vampire
01/08/2025, 7:34 PMimplementation(files("libs/a.jar")) under your control?
Because files and fileTree for dependencies is almost always a bad idea and code smell.
If you really need to use local files as dependencies, you should usually at least use a flatdir repository instead, that mitigates at least some of the quirks the others have.Dmitry Lapshin
01/08/2025, 7:36 PMVampire
01/08/2025, 7:38 PMVampire
01/08/2025, 7:39 PMConfiguration.withDependencies instead.
This is called right before the configuration takes part in resolution first time, so you could maybe check there?Dmitry Lapshin
01/08/2025, 7:43 PMVampire
01/10/2025, 12:05 AMwithDependencies whether such a dependency is declared, it should be sufficient, shouldn't it?Dmitry Lapshin
01/10/2025, 11:22 AMVampire
01/10/2025, 12:38 PMDmitry Lapshin
01/10/2025, 12:41 PMDmitry Lapshin
01/10/2025, 12:42 PM