build.gradle.kts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. plugins {
  2. id("otel.java-conventions")
  3. }
  4. val instrumentationProjectTest = tasks.named("test")
  5. // batching up the muzzle tasks alphabetically into 4 chunks
  6. // to split them up into separate CI jobs (but not too many CI job)
  7. val instrumentationProjectMuzzle = listOf(
  8. tasks.create("muzzle1"),
  9. tasks.create("muzzle2"),
  10. tasks.create("muzzle3"),
  11. tasks.create("muzzle4"),
  12. )
  13. var counter = 0
  14. subprojects {
  15. val subProj = this
  16. plugins.withId("java") {
  17. instrumentationProjectTest.configure {
  18. dependsOn(subProj.tasks.named("test"))
  19. }
  20. // this only exists to make Intellij happy since it doesn't (currently at least) understand our
  21. // inclusion of this artifact inside :testing-common
  22. dependencies {
  23. compileOnly(project(":testing:armeria-shaded-for-testing", configuration = "shadow"))
  24. testCompileOnly(project(":testing:armeria-shaded-for-testing", configuration = "shadow"))
  25. }
  26. }
  27. plugins.withId("io.opentelemetry.instrumentation.muzzle-check") {
  28. // relying on predictable ordering of subprojects
  29. // (see https://docs.gradle.org/current/dsl/org.gradle.api.Project.html#N14CB4)
  30. // since we are splitting these muzzleX tasks across different github action jobs
  31. instrumentationProjectMuzzle[counter++ % 4].dependsOn(subProj.tasks.named("muzzle"))
  32. }
  33. }