I have some multi-project builds where everything should use the same versions of dependencies.
Currently the following works for libraries:
def somePlatform = enforcedPlatform("some-group:some-bom:${platformVersion}")
api(somePlatform)
annotationProcessor(somePlatform)
testAnnotationProcessor(somePlatform)
and for applications:
def somePlatform = enforcedPlatform("some-group:some-bom:${platformVersion}")
implementation(somePlatform)
annotationProcessor(somePlatform)
testAnnotationProcessor(somePlatform)
Ideally I’d like something like
subprojects {
dependencies {
all(enforcedPlatform("some-group:some-bom:${platformVersion}"))
}
}
but I can see how that would not fly for a lot of builds out there.
One of my issues it that I can’t handle libraries (where I need to apply it to api
) and applications (where I need to apply it to implementation
) uniformly.
What would be the best way to DRY this code up a bit?