build.gradle.kts 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. plugins {
  2. id("otel.java-conventions")
  3. id("org.springframework.boot") version "3.2.5"
  4. id("org.graalvm.buildtools.native")
  5. }
  6. description = "smoke-tests-otel-starter-spring-boot-3-reactive"
  7. otelJava {
  8. minJavaVersionSupported.set(JavaVersion.VERSION_17)
  9. }
  10. dependencies {
  11. implementation(project(":instrumentation:spring:starters:spring-boot-starter"))
  12. implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
  13. implementation("org.springframework.boot:spring-boot-starter-webflux")
  14. testImplementation("org.springframework.boot:spring-boot-starter-test")
  15. testImplementation("io.projectreactor:reactor-test")
  16. testImplementation(project(":smoke-tests-otel-starter:spring-smoke-testing"))
  17. }
  18. tasks {
  19. test {
  20. // suppress warning about byte-buddy-agent being loaded dynamically
  21. jvmArgs("-XX:+EnableDynamicAgentLoading")
  22. }
  23. compileAotJava {
  24. with(options) {
  25. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  26. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  27. // -deprecation,-unchecked and none are required (none is not enough)
  28. }
  29. }
  30. compileAotTestJava {
  31. with(options) {
  32. compilerArgs.add("-Xlint:-deprecation,-unchecked,none")
  33. // To disable warnings/failure coming from the Java compiler during the Spring AOT processing
  34. // -deprecation,-unchecked and none are required (none is not enough)
  35. }
  36. }
  37. checkstyleAot {
  38. isEnabled = false
  39. }
  40. checkstyleAotTest {
  41. isEnabled = false
  42. }
  43. }
  44. // To be able to execute the tests as GraalVM native executables
  45. configurations.configureEach {
  46. exclude("org.apache.groovy", "groovy")
  47. exclude("org.apache.groovy", "groovy-json")
  48. exclude("org.spockframework", "spock-core")
  49. }
  50. graalvmNative {
  51. binaries.all {
  52. // Workaround for https://github.com/junit-team/junit5/issues/3405
  53. buildArgs.add("--initialize-at-build-time=org.junit.platform.launcher.core.LauncherConfig")
  54. buildArgs.add("--initialize-at-build-time=org.junit.jupiter.engine.config.InstantiatingConfigurationParameterConverter")
  55. }
  56. // See https://github.com/graalvm/native-build-tools/issues/572
  57. metadataRepository {
  58. enabled.set(false)
  59. }
  60. tasks.test {
  61. useJUnitPlatform()
  62. setForkEvery(1)
  63. }
  64. }