-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
Copy pathbuild.gradle
174 lines (152 loc) · 5.79 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
plugins {
id "application"
id "java"
id "maven-publish"
id "com.google.protobuf"
}
description = "gRPC: Integration Testing"
startScripts.enabled = false
configurations {
alpnagent
}
evaluationDependsOn(project(':grpc-context').path)
dependencies {
implementation project(path: ':grpc-alts', configuration: 'shadow'),
project(':grpc-auth'),
project(':grpc-census'),
project(':grpc-core'),
project(':grpc-netty'),
project(':grpc-okhttp'),
project(':grpc-protobuf'),
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_oauth2_http
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,
project(':grpc-grpclb')
testImplementation project(':grpc-context').sourceSets.test.output,
project(':grpc-api').sourceSets.test.output,
project(':grpc-core').sourceSets.test.output,
libraries.mockito
alpnagent libraries.jetty_alpn_agent
}
configureProtoCompilation()
import net.ltgt.gradle.errorprone.CheckSeverity
compileJava {
// This isn't a library; it can use beta APIs
options.errorprone.check("BetaApi", CheckSeverity.OFF)
}
test {
// 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.
task test_client(type: 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\\')
}
}
task test_server(type: CreateStartScripts) {
mainClass = "io.grpc.testing.integration.TestServiceServer"
applicationName = "test-server"
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
task reconnect_test_client(type: CreateStartScripts) {
mainClass = "io.grpc.testing.integration.ReconnectTestClient"
applicationName = "reconnect-test-client"
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
task stresstest_client(type: 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"
]
}
task http2_client(type: CreateStartScripts) {
mainClass = "io.grpc.testing.integration.Http2Client"
applicationName = "http2-client"
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
task grpclb_long_lived_affinity_test_client(type: 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"
]
}
task grpclb_fallback_test_client (type: 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"
]
}
task xds_test_client(type: CreateStartScripts) {
mainClass = "io.grpc.testing.integration.XdsTestClient"
applicationName = "xds-test-client"
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
task xds_test_server(type: CreateStartScripts) {
mainClass = "io.grpc.testing.integration.XdsTestServer"
applicationName = "xds-test-server"
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)
fileMode = 0755
}
applicationDistribution.into("lib") {
from(configurations.alpnagent)
}
publishing {
publications {
maven(MavenPublication) {
artifact distZip
artifact distTar
}
}
}