This message was deleted.
# dependency-management
s
This message was deleted.
🙌 1
🧵 1
c
Sounds like you want the third-parties to apply a plugin that publishes a new variant with a some custom attributes defined by your plugin… then you have a resolvable configuration in your consuming project that requests those attributes.
e
yeah exactly. within my own build logic, how can I configure my build that for any dependency added in
implementation
with gav
a:b:c
, if a variant at same coordinates with my attributes exist, add that variant automatically as a dependency to my custom configuration
myMetadata
for example
c
you create a resolvable configuration that extends implementation and requires that attribute
you may then need a artifact view or a lenient configuration to resolve it since you know some artifacts will not have a matching variant
I find
JvmPluginServices
to be useful for this:
Copy code
Configuration myMetadata = jvmPluginServices.createResolvableConfiguration("myMetadata", builder -> builder
                    .extendsFrom(implementation).requiresAttributes(attrs-> attrs...))
party gradlephant 1
til 1
e
Thank you!
Okay, now for level 2 difficulty, what if, the custom configuration that I want to funnel that variant into is not created by me 😅 but another plugin and per-adventure it doesnt extend implementation 😅
n
you can make it extend implementation
👍 1