group 'io.opentelemetry.example'
version '1.0-SNAPSHOT'

subprojects {
  version = rootProject.version

  apply plugin: "java"

  ext {
    versions = [
      opentelemetry         : "0.17.1",
      opentelemetryJavaagent: "0.17.0",
      bytebuddy             : "1.10.18",
      guava                 : "30.1-jre"
    ]
    versions.opentelemetryAlpha = "${versions.opentelemetry}-alpha"
    versions.opentelemetryJavaagentAlpha = "${versions.opentelemetryJavaagent}-alpha"

    deps = [
      bytebuddy           : dependencies.create(group: 'net.bytebuddy', name: 'byte-buddy', version: versions.bytebuddy),
      bytebuddyagent      : dependencies.create(group: 'net.bytebuddy', name: 'byte-buddy-agent', version: versions.bytebuddy),
      autoservice         : [
        dependencies.create(group: 'com.google.auto.service', name: 'auto-service', version: '1.0-rc7'),
        dependencies.create(group: 'com.google.auto', name: 'auto-common', version: '0.8'),
        dependencies.create(group: 'com.google.guava', name: 'guava', version: "${versions.guava}"),
      ],
      autoValueAnnotations: "com.google.auto.value:auto-value-annotations:${versions.autoValue}",
    ]
  }

  repositories {
    maven {
      url = uri("https://oss.sonatype.org/content/repositories/snapshots")
    }
    mavenCentral()
  }

  dependencies {
    testImplementation("org.mockito:mockito-core:3.3.3")
    testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.2")
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.2")
  }

  tasks {
    test {
      useJUnitPlatform()
    }

    compileJava {
      options.release.set(11)
    }
  }
}
