build.gradle.kts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. plugins {
  2. id("otel.library-instrumentation")
  3. }
  4. dependencies {
  5. api(project(":instrumentation:aws-lambda:aws-lambda-core-1.0:library"))
  6. compileOnly("io.opentelemetry:opentelemetry-sdk")
  7. compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
  8. compileOnly("com.google.auto.value:auto-value-annotations")
  9. annotationProcessor("com.google.auto.value:auto-value")
  10. library("com.amazonaws:aws-lambda-java-core:1.0.0")
  11. // First version to includes support for SQSEvent, currently the most popular message queue used
  12. // with lambda.
  13. // NB: 2.2.0 includes a class called SQSEvent but isn't usable due to it returning private classes
  14. // in public API.
  15. library("com.amazonaws:aws-lambda-java-events:2.2.1")
  16. // We need Jackson for wrappers to reproduce the serialization does when Lambda invokes a RequestHandler with event
  17. // since Lambda will only be able to invoke the wrapper itself with a generic Object.
  18. // Note that Lambda itself uses Jackson, but does not expose it to the function so we need to include it here.
  19. // TODO(anuraaga): Switch to aws-lambda-java-serialization to more robustly follow Lambda's serialization logic.
  20. implementation("com.fasterxml.jackson.core:jackson-databind")
  21. implementation("io.opentelemetry.contrib:opentelemetry-aws-xray-propagator")
  22. // allows to get the function ARN
  23. testLibrary("com.amazonaws:aws-lambda-java-core:1.2.1")
  24. // allows to get the default events
  25. testLibrary("com.amazonaws:aws-lambda-java-events:3.10.0")
  26. testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
  27. testImplementation("io.opentelemetry:opentelemetry-extension-trace-propagators")
  28. testImplementation("com.google.guava:guava")
  29. testImplementation(project(":instrumentation:aws-lambda:aws-lambda-events-2.2:testing"))
  30. testImplementation("uk.org.webcompere:system-stubs-jupiter")
  31. }
  32. tasks.withType<Test>().configureEach {
  33. // required on jdk17
  34. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  35. jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
  36. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  37. }