We currently have a giant dependencies.gradle
file which defines a gigantic libraries
hash like:
libraries = [
acme: ['com.acme:acme-detonator:1.0', {
exclude group: 'com.acme', module: 'acme-detcord'
}],
// ...
]
Now we’re ready to put the work in to move to Java Platform Plugin.
So using Java Platform Plugin at least, I can pin the versions in.
dependencies {
constraints {
api 'com.acme:acme-detonator:1.0'
}
}
And then dependencies.gradle
can just have:
libraries = [
acme: ['com.acme:acme-detonator', {
exclude group: 'com.acme', module: 'acme-detcord'
}],
// ...
]
But I want to eventually rid ourselves of dependencies.gradle
entirely, so I was wondering how I would have a platform also document the exclusions.
This is sort of like in Maven, wanting to use exclusions in a DependencyManagement, which as far as I know is not yet supported in Maven either. But it’s also something that seems perfectly reasonable to want to do.
Background for the curious:
The actual motivation for wanting to rid ourselves of this file is that it’s a file which is apparently really hard to convert to Kotlin DSL, and every other file I try to convert to Kotlin DSL ultimately comes back to this file being the blocker. So as soon as I can either rid our project of this file, or convert it to Kotlin, life gets a lot better overall.
The Kotlin equivalent way to do this file seems to be to write extension functions for DependencyHandler
, which is very different to the Groovy way, which makes it hard to do the transition without duplicating all dependencies. Having Groovy world stuff and Kotlin world stuff share the same information seems really challenging at times.