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

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

description = "gRPC: Integration Testing"

configurations {
    alpnagent
}

dependencies {
    implementation project(path: ':grpc-alts', configuration: 'shadow'),
            project(':grpc-auth'),
            project(':grpc-census'),
            project(':grpc-core'),
            project(':grpc-googleapis'),
            project(':grpc-netty'),
            project(':grpc-okhttp'),
            project(':grpc-protobuf'),
            project(':grpc-rls'),
            project(':grpc-services'),
            project(':grpc-stub'),
            project(':grpc-testing'),
            project(path: ':grpc-xds', configuration: 'shadow'),
            libraries.hdrhistogram,
            libraries.junit,
            libraries.truth,
            libraries.opencensus.contrib.grpc.metrics,
            libraries.google.auth.oauth2Http
    compileOnly libraries.javax.annotation
    // TODO(sergiitk): replace with com.google.cloud:google-cloud-logging
    // Used instead of google-cloud-logging because it's failing
    // due to a circular dependency on grpc.
    // https://cloud.google.com/logging/docs/setup/java#the_javautillogging_handler
    // Error example: "java.util.logging.ErrorManager: 1"
    // Latest failing version com.google.cloud:google-cloud-logging:2.1.2
    runtimeOnly group: 'io.github.devatherock', name: 'jul-jsonformatter', version: '1.1.0'
    runtimeOnly libraries.opencensus.impl,
            libraries.netty.tcnative,
            libraries.netty.tcnative.classes,
            project(':grpc-grpclb'),
            project(':grpc-rls')
    testImplementation testFixtures(project(':grpc-context')),
            testFixtures(project(':grpc-api')),
            testFixtures(project(':grpc-core')),
            libraries.mockito.core,
            libraries.okhttp
    alpnagent libraries.jetty.alpn.agent

    signature libraries.signature.java
    signature libraries.signature.android
}

configureProtoCompilation()

import net.ltgt.gradle.errorprone.CheckSeverity

tasks.named("compileJava").configure {
    // This isn't a library; it can use beta APIs
    options.errorprone.check("BetaApi", CheckSeverity.OFF)
}
tasks.named("test").configure {
    // For the automated tests, use Jetty ALPN.
    jvmArgs "-javaagent:" + configurations.alpnagent.asPath
}

// For the generated scripts, use Netty tcnative (i.e. OpenSSL).
// Note that OkHttp currently only supports ALPN, so OpenSSL version >= 1.0.2 is required.

def test_client = tasks.register("test_client", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.TestServiceClient"
    applicationName = "test-client"
    defaultJvmOpts = [
        "-javaagent:JAVAAGENT_APP_HOME" + configurations.alpnagent.singleFile.name
    ]
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
    doLast {
        unixScript.text = unixScript.text.replace('JAVAAGENT_APP_HOME', '\'"\$APP_HOME"\'/lib/')
        windowsScript.text = windowsScript.text.replace('JAVAAGENT_APP_HOME', '%APP_HOME%\\lib\\')
    }
}

def test_server = tasks.register("test_server", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.TestServiceServer"
    applicationName = "test-server"
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
}

def reconnect_test_client = tasks.register("reconnect_test_client", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.ReconnectTestClient"
    applicationName = "reconnect-test-client"
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
}

def stresstest_client = tasks.register("stresstest_client", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.StressTestClient"
    applicationName = "stresstest-client"
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
    defaultJvmOpts = [
        "-verbose:gc",
        "-XX:+PrintFlagsFinal"
    ]
}

def http2_client = tasks.register("http2_client", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.Http2Client"
    applicationName = "http2-client"
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
}

def grpclb_long_lived_affinity_test_client = tasks.register("grpclb_long_lived_affinity_test_client", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.GrpclbLongLivedAffinityTestClient"
    applicationName = "grpclb-long-lived-affinity-test-client"
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
    defaultJvmOpts = [
        "-Dio.grpc.internal.DnsNameResolverProvider.enable_service_config=true"
    ]
}

def grpclb_fallback_test_client = tasks.register("grpclb_fallback_test_client", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.GrpclbFallbackTestClient"
    applicationName = "grpclb-fallback-test-client"
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
    defaultJvmOpts = [
        "-Dio.grpc.internal.DnsNameResolverProvider.enable_service_config=true"
    ]
}

def xds_test_client = tasks.register("xds_test_client", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.XdsTestClient"
    applicationName = "xds-test-client"
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
}

def xds_test_server = tasks.register("xds_test_server", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.XdsTestServer"
    applicationName = "xds-test-server"
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
}

def xds_federation_test_client = tasks.register("xds_federation_test_client", CreateStartScripts) {
    mainClass = "io.grpc.testing.integration.XdsFederationTestClient"
    applicationName = "xds-federation-test-client"
    outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
    classpath = startScripts.classpath
}

applicationDistribution.into("bin") {
    from(test_client)
    from(test_server)
    from(reconnect_test_client)
    from(stresstest_client)
    from(http2_client)
    from(grpclb_long_lived_affinity_test_client)
    from(grpclb_fallback_test_client)
    from(xds_test_client)
    from(xds_test_server)
    from(xds_federation_test_client)
    fileMode = 0755
}

applicationDistribution.into("lib") {
    from(configurations.alpnagent)
}

publishing {
    publications {
        maven(MavenPublication) {
            artifact distZip
            artifact distTar
        }
    }
}
