Skip to content

Commit 04044db

Browse files
committed
Fix compilation in Java 9
Tests still fail; at the very least because of missing Jetty ALPN. I don't know why the dependency on javax.annotations is unnecessary in the compiler tests and the example when using Maven.
1 parent 450b4ca commit 04044db

File tree

8 files changed

+8
-0
lines changed

8 files changed

+8
-0
lines changed

benchmarks/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dependencies {
3434
libraries.netty_tcnative,
3535
libraries.netty_epoll,
3636
libraries.math
37+
compileOnly libraries.javax_annotation
3738
}
3839

3940
compileJava {

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ subprojects {
185185
errorprone: "com.google.errorprone:error_prone_annotations:2.0.19",
186186
guava: "com.google.guava:guava:${guavaVersion}",
187187
hpack: 'com.twitter:hpack:0.10.1',
188+
javax_annotation: 'javax.annotation:javax.annotation-api:1.2',
188189
jsr305: 'com.google.code.findbugs:jsr305:3.0.0',
189190
oauth_client: 'com.google.auth:google-auth-library-oauth2-http:0.7.0',
190191
google_api_protos: 'com.google.api.grpc:proto-google-common-protos:0.1.9',

examples/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dependencies {
2929
compile "io.grpc:grpc-netty:${grpcVersion}"
3030
compile "io.grpc:grpc-protobuf:${grpcVersion}"
3131
compile "io.grpc:grpc-stub:${grpcVersion}"
32+
compileOnly "javax.annotation:javax.annotation-api:1.2"
3233

3334
testCompile "io.grpc:grpc-testing:${grpcVersion}"
3435
testCompile "junit:junit:4.12"

grpclb/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies {
1414
project(':grpc-protobuf'),
1515
project(':grpc-stub'),
1616
libraries.protobuf
17+
compileOnly libraries.javax_annotation
1718
testCompile libraries.truth,
1819
project(':grpc-core').sourceSets.test.output
1920
}

interop-testing/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies {
2626
libraries.netty_tcnative,
2727
libraries.oauth_client,
2828
libraries.truth
29+
compileOnly libraries.javax_annotation
2930
runtime libraries.opencensus_impl
3031
}
3132

okhttp/src/test/java/io/grpc/okhttp/OkHttpProtocolNegotiatorTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
public class OkHttpProtocolNegotiatorTest {
5454
@Rule public final ExpectedException thrown = ExpectedException.none();
5555

56+
@SuppressWarnings("deprecation") // version became a string in Java 9
5657
private final Provider fakeSecurityProvider = new Provider("GmsCore_OpenSSL", 1.0, "info") {};
5758
private final SSLSocket sock = mock(SSLSocket.class);
5859
private final Platform platform = mock(Platform.class);

services/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ description = "gRPC: Services"
1313
dependencies {
1414
compile project(':grpc-protobuf'),
1515
project(':grpc-stub')
16+
compileOnly libraries.javax_annotation
1617
testCompile project(':grpc-testing')
1718
signature "org.codehaus.mojo.signature:java16:1.1@signature"
1819
}

testing-proto/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ buildscript {
1313
dependencies {
1414
compile project(':grpc-protobuf'),
1515
project(':grpc-stub')
16+
compileOnly libraries.javax_annotation
1617
testCompile libraries.opencensus_api,
1718
libraries.truth
1819
testRuntime libraries.opencensus_impl

0 commit comments

Comments
 (0)