Am I right that version catalogue bundle doesn't p...
# community-support
e
Am I right that version catalogue bundle doesn't provide the configuration. The use case - I have one open source library and there is lint rules for it but from a different person/organisation. So far I need to define two dependencies - testImplementation and lintCheck. And if I want to avoid it the only way would be a convention plugin.
p
Yes, it only contains the dependency coordinates. But for that case, instead adding another dependency on a convention plugin, it might easier to just add the dependencies directly to the configurations.
e
You mean two deps instead of writing convention plugin?
p
Yeah
thank you 1
e
I have also lint configuration sharable - so i will go with convention plugin
v
If you anyway also have configuration to share, convention plugins sounds about right. If you only have dependencies and really want to avoid declaring it twice, you can create another dependency scope configuration, declare your dependencies on that configuration and make the configurations that should both have them extend from that dependency scope configuration.
Copy code
val commonDeps = configurations.dependencyScope("commonDeps")
configurations.testImplementation {
    extendsFrom(commonDeps)
}
configurations.lintCheck {
    extendsFrom(commonDeps)
}
dependencies {
    commonDeps("foo:bar:1")
    commonDeps("baz:bam:2")
}
e
bar should be testImplementation and bam should be lintCheck and not both in the two of them
v
Then I maybe got you wrong. Especially, when you say "bar should be testImplementation and bam should be lintCheck", that does not make much sense to me.
testImplementation
and
lintCheck
are configurations,
bar
and
bam
are artifact coordinate module.
e
These are lines in convention plugin
Copy code
dependencies {
            addProvider("testImplementation", libs.assertk.asProvider())
            addProvider("lintChecks", libs.assertk.lint)
        }
v
Ah, ok, so then yeah. Just declare the dependencies on the configurations you need them if you don't need a convention plugin. They are completely independent. A in configuration X B in configuration Y 🙂
e
I have also some lint configuration - so went with convention plugin
👌 1