plugins {
    id "com.diffplug.spotless"
    id "com.github.johnrengelman.shadow" apply false
}

println("Building against OpenTelemetry version: ${project.properties["io.opentelemetry.version"]}")

subprojects {
    apply plugin: 'eclipse'
    apply plugin: 'java'
    apply plugin: 'java-library'
    apply plugin: 'idea'
    apply plugin: 'com.diffplug.spotless'
    apply plugin: 'com.github.johnrengelman.shadow'

    group = "io.opentelemetry"
    version = "0.1.0-SNAPSHOT"

    ext {
        openTelemetryVersion = "1.3.0"
        openTelemetryAlphaVersion = "1.3.0-alpha"

        grpcVersion = '1.34.1'
        protobufVersion = '3.11.4'
        protocVersion = protobufVersion
    }

    repositories {
        mavenCentral()
        maven {
            // Add snapshot repository
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
    }

    dependencies {
        implementation platform("io.opentelemetry:opentelemetry-bom:${openTelemetryVersion}")
        implementation platform("io.opentelemetry:opentelemetry-bom-alpha:${openTelemetryAlphaVersion}")
        implementation platform("io.grpc:grpc-bom:${grpcVersion}")
    }

    spotless {
        java {
            targetExclude '**/generated/**'
            googleJavaFormat("1.9")
        }
    }
}
