build.gradle 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. group 'io.opentelemetry.example'
  2. version '1.0-SNAPSHOT'
  3. buildscript {
  4. repositories {
  5. maven {
  6. url "https://plugins.gradle.org/m2/"
  7. }
  8. maven {
  9. name = "sonatype"
  10. url = uri("https://oss.sonatype.org/content/repositories/snapshots")
  11. }
  12. }
  13. dependencies {
  14. classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
  15. classpath "com.github.johnrengelman:shadow:8.1.1"
  16. classpath "io.opentelemetry.instrumentation:gradle-plugins:2.5.0-alpha"
  17. }
  18. }
  19. subprojects {
  20. version = rootProject.version
  21. apply plugin: "java"
  22. apply plugin: "com.diffplug.spotless"
  23. ext {
  24. versions = [
  25. // this line is managed by .github/scripts/update-sdk-version.sh
  26. opentelemetrySdk : "1.39.0",
  27. // these lines are managed by .github/scripts/update-version.sh
  28. opentelemetryJavaagent : "2.5.0",
  29. opentelemetryJavaagentAlpha: "2.5.0-alpha",
  30. autoservice : "1.1.1",
  31. junit : "5.10.2"
  32. ]
  33. deps = [
  34. autoservice: [
  35. "com.google.auto.service:auto-service:${versions.autoservice}",
  36. "com.google.auto.service:auto-service-annotations:${versions.autoservice}",
  37. ]
  38. ]
  39. }
  40. repositories {
  41. mavenCentral()
  42. maven {
  43. name = "sonatype"
  44. url = uri("https://oss.sonatype.org/content/repositories/snapshots")
  45. }
  46. }
  47. spotless {
  48. java {
  49. googleJavaFormat()
  50. licenseHeaderFile(rootProject.file("../../buildscripts/spotless.license.java"), "(package|import|public)")
  51. target("src/**/*.java")
  52. }
  53. }
  54. dependencies {
  55. implementation(platform("io.opentelemetry:opentelemetry-bom:${versions.opentelemetrySdk}"))
  56. // these serve as a test of the instrumentation boms
  57. implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:${versions.opentelemetryJavaagent}"))
  58. implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${versions.opentelemetryJavaagentAlpha}"))
  59. testImplementation("org.mockito:mockito-core:5.12.0")
  60. testImplementation(enforcedPlatform("org.junit:junit-bom:${versions.junit}"))
  61. testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junit}")
  62. testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
  63. }
  64. tasks {
  65. test {
  66. useJUnitPlatform()
  67. }
  68. compileJava {
  69. options.release.set(8)
  70. }
  71. }
  72. }