Ashitha Santhosh | 1b88065 | 2022-02-14 07:10:18 -0800 | [diff] [blame] | 1 | plugins { |
| 2 | id "java-library" |
| 3 | id "maven-publish" |
| 4 | |
| 5 | id "com.github.johnrengelman.shadow" |
| 6 | id "com.google.protobuf" |
| 7 | id "ru.vyarus.animalsniffer" |
| 8 | } |
| 9 | |
| 10 | description = "gRPC: Authorization" |
| 11 | |
| 12 | dependencies { |
| 13 | implementation project(':grpc-protobuf'), |
Eric Anderson | 1551cc7 | 2023-04-13 08:52:20 -0700 | [diff] [blame] | 14 | project(':grpc-core'), |
| 15 | libraries.guava.jre // JRE required by transitive protobuf-java-util |
Ashitha Santhosh | 1b88065 | 2022-02-14 07:10:18 -0800 | [diff] [blame] | 16 | |
Eric Anderson | b06942d | 2022-06-13 12:09:30 -0700 | [diff] [blame] | 17 | annotationProcessor libraries.auto.value |
| 18 | compileOnly libraries.javax.annotation |
Ashitha Santhosh | 1b88065 | 2022-02-14 07:10:18 -0800 | [diff] [blame] | 19 | |
| 20 | testImplementation project(':grpc-testing'), |
Ashitha Santhosh | b43ddc2 | 2023-04-19 10:50:19 -0700 | [diff] [blame] | 21 | project(':grpc-testing-proto'), |
Eric Anderson | 29b8483 | 2023-05-16 12:10:13 -0700 | [diff] [blame] | 22 | testFixtures(project(':grpc-core')) |
Eric Anderson | b06942d | 2022-06-13 12:09:30 -0700 | [diff] [blame] | 23 | testImplementation (libraries.guava.testlib) { |
Ashitha Santhosh | 1b88065 | 2022-02-14 07:10:18 -0800 | [diff] [blame] | 24 | exclude group: 'junit', module: 'junit' |
| 25 | } |
| 26 | |
| 27 | def xdsDependency = implementation project(':grpc-xds') |
| 28 | shadow configurations.implementation.getDependencies().minus([xdsDependency]) |
| 29 | shadow project(path: ':grpc-xds', configuration: 'shadow') |
| 30 | |
Eric Anderson | 61f19d7 | 2022-08-10 12:41:57 -0700 | [diff] [blame] | 31 | signature libraries.signature.java |
Ashitha Santhosh | 1b88065 | 2022-02-14 07:10:18 -0800 | [diff] [blame] | 32 | } |
| 33 | |
Eric Anderson | 0ff9f37 | 2022-07-01 15:48:38 -0700 | [diff] [blame] | 34 | tasks.named("jar").configure { |
Eric Anderson | 8dbc88f | 2023-05-08 10:46:10 -0700 | [diff] [blame] | 35 | archiveClassifier = 'original' |
Ashitha Santhosh | 1b88065 | 2022-02-14 07:10:18 -0800 | [diff] [blame] | 36 | } |
| 37 | |
Eric Anderson | 0ff9f37 | 2022-07-01 15:48:38 -0700 | [diff] [blame] | 38 | tasks.named("shadowJar").configure { |
Eric Anderson | 8dbc88f | 2023-05-08 10:46:10 -0700 | [diff] [blame] | 39 | archiveClassifier = null |
Ashitha Santhosh | 1b88065 | 2022-02-14 07:10:18 -0800 | [diff] [blame] | 40 | dependencies { |
| 41 | exclude(dependency {true}) |
| 42 | } |
| 43 | relocate 'io.grpc.xds', 'io.grpc.xds.shaded.io.grpc.xds' |
| 44 | relocate 'udpa.annotations', 'io.grpc.xds.shaded.udpa.annotations' |
| 45 | relocate 'com.github.udpa', 'io.grpc.xds.shaded.com.github.udpa' |
| 46 | relocate 'envoy.annotations', 'io.grpc.xds.shaded.envoy.annotations' |
| 47 | relocate 'io.envoyproxy', 'io.grpc.xds.shaded.io.envoyproxy' |
| 48 | relocate 'com.google.api.expr', 'io.grpc.xds.shaded.com.google.api.expr' |
| 49 | } |
| 50 | |
Ashitha Santhosh | 0194ae9 | 2022-12-21 15:30:42 -0800 | [diff] [blame] | 51 | tasks.named("compileJava").configure { |
| 52 | it.options.compilerArgs += [ |
| 53 | "-Xlint:-processing", |
| 54 | ] |
| 55 | } |
| 56 | |
Ashitha Santhosh | 1b88065 | 2022-02-14 07:10:18 -0800 | [diff] [blame] | 57 | publishing { |
| 58 | publications { |
| 59 | maven(MavenPublication) { |
| 60 | // We want this to throw an exception if it isn't working |
| 61 | def originalJar = artifacts.find { dep -> dep.classifier == 'original'} |
| 62 | artifacts.remove(originalJar) |
| 63 | |
| 64 | pom.withXml { |
| 65 | def dependenciesNode = new Node(null, 'dependencies') |
| 66 | project.configurations.shadow.allDependencies.each { dep -> |
| 67 | def dependencyNode = dependenciesNode.appendNode('dependency') |
| 68 | dependencyNode.appendNode('groupId', dep.group) |
| 69 | dependencyNode.appendNode('artifactId', dep.name) |
| 70 | dependencyNode.appendNode('version', dep.version) |
| 71 | dependencyNode.appendNode('scope', 'compile') |
| 72 | } |
| 73 | asNode().dependencies[0].replaceNode(dependenciesNode) |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
Eric Anderson | 0ff9f37 | 2022-07-01 15:48:38 -0700 | [diff] [blame] | 79 | tasks.named("publishMavenPublicationToMavenRepository").configure { |
| 80 | enabled = false |
| 81 | } |