I want to create a custom dependency configuration in my gradle plugin.
Is it possible to write a custom dependency configuration (example below), and resolve dependencies inside my plugin? For instance, If I mention ‘audit’, my plugin resolve it as implementation('com.audit:audit:xxx).
I created extension with list property and after evaluate resolve dependencies. But I want to strict using my custom dsl only in dependencies block. And overall an extension doesn’t look as elegant solution.
I didn’t say an extension.
Just have some class with constant AUDIT and value "com.audit:audit:xxx", then use implementation(MyConstants.AUDIT).
While actually using a version catalog might be a better choice.
If you make your plugin a settings plugin, it can define a version catalog and then you can just use that version catalog: Sharing dependency versions between projects