Q: When registering artifact transforms for artifa...
# plugin-development
m
Q: When registering artifact transforms for artifacts shared by a producer to a consumer, should the transform be registered on the producer or on the consumer?
I've got a producer module which publishes an artifact with attribute=A. I've got a consumer module which would like to consume that artifact but as attribute=B. I have a transform to convert from A->B.
I've tried registering on either/both but can't seem to get things to wire up correctly. I'd like to know what the expected norm is here so that I can leave that one in place to debug further
for context: the artifact with attribute=A is a directory containing a set of well known filenames. attribute=B is a single file artifact representing one of those individual files (only)
I'm trying to wire up the individual file to be used as an input on a task implementation
p
On the consumer.
👌 1
m
Looks like I'm running into https://github.com/gradle/gradle/issues/8386 for the other half of my problem. 😞
v
Are you sure? I wouldn't expect that issue here. Your use-case sounds perfectly valid.
Artifact transform and variant selection are not an easy topic
2 days ago the docs about this were greatly improved actually
Maybe you can share an MCVE of what you try, then maybe someone can point out the problem you are hitting, in case it is not that ticket
m
No, I'm not sure. Still learning this approach and as you've called out, it's not trivial. That said, I read through the doc link you provided and found reference to something that got me past the issue: I was able to use
artifactView
to force the transform to engage. That seemed to do the trick, so thanks!
There's probably more that I could do to improve upon this, but it's working for now!
👌 1
v
It's not so much "force the transform". Just now the initial component selection can successfully finish and then with the artifact view you say "but I want other artifacts of that component" and there the transform then can do its work. 🙂
👌 1