forked from grpc/grpc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
81 lines (68 loc) · 2.63 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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
}