mirror of https://github.com/grpc/grpc-java.git
Fix compilation in Java 9
This commit is contained in:
parent
bdecdaea22
commit
4e82e62eaa
|
|
@ -36,12 +36,17 @@ script:
|
||||||
- ./gradlew check :grpc-all:jacocoTestReport
|
- ./gradlew check :grpc-all:jacocoTestReport
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- if \[ "$TRAVIS_OS_NAME" = linux \]; then ./gradlew :grpc-all:coveralls; fi
|
# Upload to coveralls once, instead of for each job in the matrix
|
||||||
|
- if \[\[ "$TRAVIS_JOB_NUMBER" == *.1 \]\]; then ./gradlew :grpc-all:coveralls; fi
|
||||||
- bash <(curl -s https://codecov.io/bash)
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
|
|
||||||
|
jdk:
|
||||||
|
- oraclejdk8
|
||||||
|
- oraclejdk9
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ dependencies {
|
||||||
libraries.netty_tcnative,
|
libraries.netty_tcnative,
|
||||||
libraries.netty_epoll,
|
libraries.netty_epoll,
|
||||||
libraries.math
|
libraries.math
|
||||||
|
compileOnly libraries.javax_annotation
|
||||||
}
|
}
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ subprojects {
|
||||||
gson: "com.google.code.gson:gson:2.7",
|
gson: "com.google.code.gson:gson:2.7",
|
||||||
guava: "com.google.guava:guava:${guavaVersion}",
|
guava: "com.google.guava:guava:${guavaVersion}",
|
||||||
hpack: 'com.twitter:hpack:0.10.1',
|
hpack: 'com.twitter:hpack:0.10.1',
|
||||||
|
javax_annotation: 'javax.annotation:javax.annotation-api:1.2',
|
||||||
jsr305: 'com.google.code.findbugs:jsr305:3.0.0',
|
jsr305: 'com.google.code.findbugs:jsr305:3.0.0',
|
||||||
oauth_client: 'com.google.auth:google-auth-library-oauth2-http:0.9.0',
|
oauth_client: 'com.google.auth:google-auth-library-oauth2-http:0.9.0',
|
||||||
google_api_protos: 'com.google.api.grpc:proto-google-common-protos:1.0.0',
|
google_api_protos: 'com.google.api.grpc:proto-google-common-protos:1.0.0',
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,20 @@ public class AttributesTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("BoxedPrimitiveConstructor")
|
|
||||||
public void valueEquality() {
|
public void valueEquality() {
|
||||||
Attributes.Key<Integer> key = Attributes.Key.of("ints");
|
class EqualObject {
|
||||||
Integer v1 = new Integer(100000);
|
@Override public boolean equals(Object o) {
|
||||||
Integer v2 = new Integer(100000);
|
return o instanceof EqualObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int hashCode() {
|
||||||
|
return 42;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Attributes.Key<EqualObject> key = Attributes.Key.of("ints");
|
||||||
|
EqualObject v1 = new EqualObject();
|
||||||
|
EqualObject v2 = new EqualObject();
|
||||||
|
|
||||||
assertNotSame(v1, v2);
|
assertNotSame(v1, v2);
|
||||||
assertEquals(v1, v2);
|
assertEquals(v1, v2);
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ dependencies {
|
||||||
compile "io.grpc:grpc-netty:${grpcVersion}"
|
compile "io.grpc:grpc-netty:${grpcVersion}"
|
||||||
compile "io.grpc:grpc-protobuf:${grpcVersion}"
|
compile "io.grpc:grpc-protobuf:${grpcVersion}"
|
||||||
compile "io.grpc:grpc-stub:${grpcVersion}"
|
compile "io.grpc:grpc-stub:${grpcVersion}"
|
||||||
|
compileOnly "javax.annotation:javax.annotation-api:1.2"
|
||||||
|
|
||||||
// Used for TLS in HelloWorldServerTls
|
// Used for TLS in HelloWorldServerTls
|
||||||
compile "io.netty:netty-tcnative-boringssl-static:${nettyTcNativeVersion}"
|
compile "io.netty:netty-tcnative-boringssl-static:${nettyTcNativeVersion}"
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ dependencies {
|
||||||
project(':grpc-protobuf'),
|
project(':grpc-protobuf'),
|
||||||
project(':grpc-stub'),
|
project(':grpc-stub'),
|
||||||
libraries.protobuf
|
libraries.protobuf
|
||||||
|
compileOnly libraries.javax_annotation
|
||||||
testCompile libraries.truth,
|
testCompile libraries.truth,
|
||||||
project(':grpc-core').sourceSets.test.output
|
project(':grpc-core').sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ dependencies {
|
||||||
libraries.mockito,
|
libraries.mockito,
|
||||||
libraries.oauth_client,
|
libraries.oauth_client,
|
||||||
libraries.truth
|
libraries.truth
|
||||||
|
compileOnly libraries.javax_annotation
|
||||||
runtime libraries.opencensus_impl,
|
runtime libraries.opencensus_impl,
|
||||||
libraries.netty_tcnative
|
libraries.netty_tcnative
|
||||||
testCompile project(':grpc-context').sourceSets.test.output
|
testCompile project(':grpc-context').sourceSets.test.output
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ dependencies {
|
||||||
// we'll always be more up-to-date
|
// we'll always be more up-to-date
|
||||||
exclude group: 'io.grpc', module: 'grpc-context'
|
exclude group: 'io.grpc', module: 'grpc-context'
|
||||||
}
|
}
|
||||||
|
compileOnly libraries.javax_annotation
|
||||||
testCompile project(':grpc-testing'),
|
testCompile project(':grpc-testing'),
|
||||||
libraries.netty_epoll // for DomainSocketAddress
|
libraries.netty_epoll // for DomainSocketAddress
|
||||||
signature "org.codehaus.mojo.signature:java16:1.1@signature"
|
signature "org.codehaus.mojo.signature:java16:1.1@signature"
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ buildscript {
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':grpc-protobuf'),
|
compile project(':grpc-protobuf'),
|
||||||
project(':grpc-stub')
|
project(':grpc-stub')
|
||||||
|
compileOnly libraries.javax_annotation
|
||||||
testCompile libraries.truth
|
testCompile libraries.truth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue