is there a good way to put all my `platform`s on a...
# community-support
c
is there a good way to put all my `platform`s on all the ... configuration provided by the
java-library
plugin? I wouldn't want to catch things provided by most plugins but basically catch `api`/`implementation`/`testImplementation` /`compileOnly` /`runtimeOnly` etc this is absolutely stupid
Copy code
api(platform(libs.jakarta.bom))
  api(platform(libs.spring.bom))
  api(platform(libs.junit.bom))
  api(platform(libs.spring.modulith.bom))
  api(platform(libs.jmolecules.bom))

  compileOnly(platform(libs.jakarta.bom))
  compileOnly(platform(libs.spring.bom))
  compileOnly(platform(libs.junit.bom))
  compileOnly(platform(libs.spring.modulith.bom))
  compileOnly(platform(libs.jmolecules.bom))

  implementation(platform(libs.jakarta.bom))
  implementation(platform(libs.spring.bom))
  implementation(platform(libs.junit.bom))
  implementation(platform(libs.spring.modulith.bom))
  implementation(platform(libs.jmolecules.bom))

  runtimeOnly(platform(libs.jakarta.bom))
  runtimeOnly(platform(libs.spring.bom))
  runtimeOnly(platform(libs.junit.bom))
  runtimeOnly(platform(libs.spring.modulith.bom))
  runtimeOnly(platform(libs.jmolecules.bom))
p
Well, you can always write a function. Do you really need to repeat the platform even for configuration extending others? Can’t check it right now but IMHO it should inherit the platform dependencies too. Otherwise it’s a bug.
c
not really but then it's not always clear what's actually extending what. I had everything but
api
here a second ago... and it was complaining (I think) because it was missing, but something was using one of the ones with
api
seems safer to just be all everything!
occurs t me I don't actually know how I should write such a function in kotlin . I guess I could pass all the parameters in... but, that doesn't feel the greatest
Copy code
fun importBom(bom: Provider<MinimalExternalModuleDependency>) {
  api(platform(bom))// right that's not going to compile
}

dependencies {
  api(platform(libs.jakarta.bom))