How do I get the task dependencies necessary for a...
# dependency-management
v
How do I get the task dependencies necessary for a
ResolvableArtifact
? As
ResolvableArtifact
already is internal, it would be ok to use internal stuff for this specific need I have right now. In the end it will anyway land in a PR for Gradle code.
j
Can you go into more details on your use case? A ResolvableArtifact extends
extends TaskDependencyContainer
so
visitDependencies
is what you are looking for
Consuming those dependencies depends on when and when you want them. Usually you’d not instantiate a
TaskDependencyResolveContext
yourself, but would have one already passed to you since you are getting visited for your dependencies
v
This is the context where I need it: https://github.com/gradle/gradle/pull/29840 And even if this is not going to be merged, but the menioned more generic solution, I still want the according code in my projects up to then.
j
Is there a particular method you’d be in when wanting to get those dependencies?
v
For the version in my projects
ArtifactTransformListener#beforeTransformerInvocation
, in the PR
AbstractTransformExecution#execute
.