plugins {
    id "java-library"
    id "maven-publish"

    id "com.google.protobuf"
    id "ru.vyarus.animalsniffer"
}

description = "gRPC: Services"

[compileJava].each() {
    // v1alpha of reflection.proto is deprecated at the file level.
    // Without this workaround, the project can not compile.
    it.options.compilerArgs += [
        "-Xlint:-deprecation",
    ]
}

evaluationDependsOn(project(':grpc-core').path)

dependencies {
    api project(':grpc-protobuf'),
            project(':grpc-stub'),
            project(':grpc-core')
    implementation libraries.protobuf_util,
            libraries.guava
    runtimeOnly libraries.errorprone

    compileOnly libraries.javax_annotation
    testImplementation project(':grpc-testing'),
            libraries.netty_epoll, // for DomainSocketAddress
            project(':grpc-core').sourceSets.test.output  // for FakeClock
    testCompileOnly libraries.javax_annotation
    signature "org.codehaus.mojo.signature:java17:1.0@signature"
}

configureProtoCompilation()

javadoc {
    exclude 'io/grpc/services/Internal*.java'
    exclude 'io/grpc/services/internal/*'
}

jacocoTestReport {
    classDirectories.from = sourceSets.main.output.collect {
        fileTree(dir: it,
        exclude: [
                '**/io/grpc/binarylog/v1/**',
                '**/io/grpc/channelz/v1/**',
                '**/io/grpc/health/v1/**',
                '**/io/grpc/reflection/v1alpha/**',
        ])
    }
}
