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

    id "com.github.johnrengelman.shadow"
    id "com.google.protobuf"
    id "ru.vyarus.animalsniffer"
}

description = "gRPC: Authorization"

dependencies {
    implementation project(':grpc-protobuf'),
            project(':grpc-core'),
            libraries.guava.jre // JRE required by transitive protobuf-java-util

    annotationProcessor libraries.auto.value
    compileOnly libraries.javax.annotation

    testImplementation project(':grpc-testing'),
            project(':grpc-testing-proto'),
            testFixtures(project(':grpc-core'))
    testImplementation (libraries.guava.testlib) {
        exclude group: 'junit', module: 'junit'
    }

    def xdsDependency = implementation project(':grpc-xds')
    shadow configurations.implementation.getDependencies().minus([xdsDependency])
    shadow project(path: ':grpc-xds', configuration: 'shadow')

    signature libraries.signature.java
}

tasks.named("jar").configure {
    archiveClassifier = 'original'
}

tasks.named("shadowJar").configure {
    archiveClassifier = null
    dependencies {
        exclude(dependency {true})
    }
    relocate 'io.grpc.xds', 'io.grpc.xds.shaded.io.grpc.xds'
    relocate 'udpa.annotations', 'io.grpc.xds.shaded.udpa.annotations'
    relocate 'com.github.udpa', 'io.grpc.xds.shaded.com.github.udpa'
    relocate 'envoy.annotations', 'io.grpc.xds.shaded.envoy.annotations'
    relocate 'io.envoyproxy', 'io.grpc.xds.shaded.io.envoyproxy'
    relocate 'com.google.api.expr', 'io.grpc.xds.shaded.com.google.api.expr'
}

tasks.named("compileJava").configure {
    it.options.compilerArgs += [
        "-Xlint:-processing",
    ]
}

publishing {
    publications {
        maven(MavenPublication) {
            // We want this to throw an exception if it isn't working
            def originalJar = artifacts.find { dep -> dep.classifier == 'original'}
            artifacts.remove(originalJar)

            pom.withXml {
                def dependenciesNode = new Node(null, 'dependencies')
                project.configurations.shadow.allDependencies.each { dep ->
                    def dependencyNode = dependenciesNode.appendNode('dependency')
                    dependencyNode.appendNode('groupId', dep.group)
                    dependencyNode.appendNode('artifactId', dep.name)
                    dependencyNode.appendNode('version', dep.version)
                    dependencyNode.appendNode('scope', 'compile')
                }
                asNode().dependencies[0].replaceNode(dependenciesNode)
            }
        }
    }
}

tasks.named("publishMavenPublicationToMavenRepository").configure {
    enabled = false
}
