all: swap to newer animalsniffer plugin

The new plugin uses a newer version of animalsniffer, allows overriding
the animalsniffer version used, and has up-to-date handling. The
up-to-date handling cuts fully incremental parallel build times in half,
from 5.5s to 2.7s.

The previous plugin was supposed to be verifying tests. However, either
it wasn't verifying them or its verification was broken.
This commit is contained in:
Eric Anderson 2017-02-02 13:48:12 -08:00
parent b0323ac22c
commit 42aa64c647
12 changed files with 17 additions and 80 deletions

View File

@ -1,15 +1,7 @@
plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = "gRpc: Auth" description = "gRpc: Auth"
dependencies { dependencies {
compile project(':grpc-core'), compile project(':grpc-core'),
libraries.google_auth_credentials libraries.google_auth_credentials
testCompile libraries.oauth_client testCompile libraries.oauth_client
} signature "org.codehaus.mojo.signature:java16:+@signature"
// Configure the animal sniffer plugin
animalsniffer {
signature = "org.codehaus.mojo.signature:java16:+@signature"
} }

View File

@ -5,6 +5,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.google.gradle:osdetector-gradle-plugin:1.4.0' classpath 'com.google.gradle:osdetector-gradle-plugin:1.4.0'
classpath "ru.vyarus:gradle-animalsniffer-plugin:1.2.0"
} }
} }
@ -17,6 +18,8 @@ subprojects {
apply plugin: "jacoco" apply plugin: "jacoco"
apply plugin: "com.google.osdetector" apply plugin: "com.google.osdetector"
// The plugin only has an effect if a signature is specified
apply plugin: "ru.vyarus.animalsniffer"
group = "io.grpc" group = "io.grpc"
version = "1.2.0-SNAPSHOT" // CURRENT_GRPC_VERSION version = "1.2.0-SNAPSHOT" // CURRENT_GRPC_VERSION

View File

@ -1,14 +1,6 @@
plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = 'gRPC: Context' description = 'gRPC: Context'
dependencies { dependencies {
testCompile project(':grpc-testing') testCompile project(':grpc-testing')
} signature "org.codehaus.mojo.signature:java16:+@signature"
// Configure the animal sniffer plugin
animalsniffer {
signature = "org.codehaus.mojo.signature:java16:+@signature"
} }

View File

@ -1,7 +1,3 @@
plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = 'gRPC: Core' description = 'gRPC: Core'
dependencies { dependencies {
@ -11,11 +7,7 @@ dependencies {
project(':grpc-context'), project(':grpc-context'),
libraries.instrumentation_api libraries.instrumentation_api
testCompile project(':grpc-testing') testCompile project(':grpc-testing')
} signature "org.codehaus.mojo.signature:java16:+@signature"
// Configure the animal sniffer plugin
animalsniffer {
signature = "org.codehaus.mojo.signature:java16:+@signature"
} }
javadoc.exclude 'io/grpc/internal/**' javadoc.exclude 'io/grpc/internal/**'

View File

@ -7,6 +7,7 @@ dependencies {
// Tests depend on base class defined by core module. // Tests depend on base class defined by core module.
testCompile project(':grpc-core').sourceSets.test.output, testCompile project(':grpc-core').sourceSets.test.output,
project(':grpc-testing') project(':grpc-testing')
signature "org.codehaus.mojo.signature:java17:+@signature"
} }
test { test {

View File

@ -1,7 +1,3 @@
plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = "gRPC: OkHttp" description = "gRPC: OkHttp"
dependencies { dependencies {
compile project(':grpc-core'), compile project(':grpc-core'),
@ -12,6 +8,7 @@ dependencies {
testCompile project(':grpc-core').sourceSets.test.output, testCompile project(':grpc-core').sourceSets.test.output,
project(':grpc-testing'), project(':grpc-testing'),
project(':grpc-netty') project(':grpc-netty')
signature "org.codehaus.mojo.signature:java16:+@signature"
} }
project.sourceSets { project.sourceSets {
@ -24,10 +21,5 @@ project.sourceSets {
checkstyleMain.exclude '**/io/grpc/okhttp/internal/**' checkstyleMain.exclude '**/io/grpc/okhttp/internal/**'
// Configure the animal sniffer plugin
animalsniffer {
signature = "org.codehaus.mojo.signature:java16:+@signature"
}
javadoc.exclude 'io/grpc/okhttp/internal/**' javadoc.exclude 'io/grpc/okhttp/internal/**'
javadoc.options.links 'http://square.github.io/okhttp/2.x/okhttp/' javadoc.options.links 'http://square.github.io/okhttp/2.x/okhttp/'

View File

@ -31,6 +31,7 @@
package io.grpc.okhttp; package io.grpc.okhttp;
import static com.google.common.base.Charsets.UTF_8;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
@ -46,7 +47,6 @@ import io.grpc.okhttp.OkHttpProtocolNegotiator.AndroidNegotiator.TlsExtensionTyp
import io.grpc.okhttp.internal.Platform; import io.grpc.okhttp.internal.Platform;
import io.grpc.okhttp.internal.Protocol; import io.grpc.okhttp.internal.Protocol;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.Provider; import java.security.Provider;
import java.security.Security; import java.security.Security;
import javax.net.ssl.HandshakeCompletedListener; import javax.net.ssl.HandshakeCompletedListener;
@ -284,7 +284,7 @@ public class OkHttpProtocolNegotiatorTest {
public static class FakeAndroidSslSocketAlpn extends FakeAndroidSslSocket { public static class FakeAndroidSslSocketAlpn extends FakeAndroidSslSocket {
@Override @Override
public byte[] getAlpnSelectedProtocol() { public byte[] getAlpnSelectedProtocol() {
return "h2".getBytes(StandardCharsets.UTF_8); return "h2".getBytes(UTF_8);
} }
} }
@ -302,7 +302,7 @@ public class OkHttpProtocolNegotiatorTest {
public static class FakeAndroidSslSocketNpn extends FakeAndroidSslSocket { public static class FakeAndroidSslSocketNpn extends FakeAndroidSslSocket {
@Override @Override
public byte[] getNpnSelectedProtocol() { public byte[] getNpnSelectedProtocol() {
return "h2".getBytes(StandardCharsets.UTF_8); return "h2".getBytes(UTF_8);
} }
} }

View File

@ -8,10 +8,6 @@ buildscript {
} }
} }
plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
apply plugin: 'com.google.protobuf' apply plugin: 'com.google.protobuf'
description = 'gRPC: Protobuf Lite' description = 'gRPC: Protobuf Lite'
@ -22,6 +18,8 @@ dependencies {
libraries.guava libraries.guava
testProtobuf libraries.protobuf testProtobuf libraries.protobuf
signature "org.codehaus.mojo.signature:java16:+@signature"
} }
compileTestJava { compileTestJava {
@ -57,7 +55,3 @@ protobuf {
} }
} }
} }
animalsniffer {
signature = "org.codehaus.mojo.signature:java16:+@signature"
}

View File

@ -8,20 +8,13 @@ buildscript {
} }
} }
plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = 'gRPC: Protobuf Nano' description = 'gRPC: Protobuf Nano'
dependencies { dependencies {
compile project(':grpc-core'), compile project(':grpc-core'),
libraries.protobuf_nano, libraries.protobuf_nano,
libraries.guava libraries.guava
} signature "org.codehaus.mojo.signature:java16:+@signature"
animalsniffer {
signature = "org.codehaus.mojo.signature:java16:+@signature"
} }
configureProtoCompilation() configureProtoCompilation()

View File

@ -1,7 +1,3 @@
plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = 'gRPC: Protobuf' description = 'gRPC: Protobuf'
dependencies { dependencies {
@ -13,8 +9,6 @@ dependencies {
compile (project(':grpc-protobuf-lite')) { compile (project(':grpc-protobuf-lite')) {
exclude group: 'com.google.protobuf', module: 'protobuf-lite' exclude group: 'com.google.protobuf', module: 'protobuf-lite'
} }
}
animalsniffer { signature "org.codehaus.mojo.signature:java16:+@signature"
signature = "org.codehaus.mojo.signature:java16:+@signature"
} }

View File

@ -8,25 +8,17 @@ buildscript {
} }
} }
plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = "gRPC: Services" description = "gRPC: Services"
dependencies { dependencies {
compile project(':grpc-protobuf'), compile project(':grpc-protobuf'),
project(':grpc-stub') project(':grpc-stub')
testCompile project(':grpc-testing') testCompile project(':grpc-testing')
signature "org.codehaus.mojo.signature:java16:+@signature"
} }
configureProtoCompilation() configureProtoCompilation()
// Configure the animal sniffer plugin
animalsniffer {
signature = "org.codehaus.mojo.signature:java16:+@signature"
}
// Let intellij projects refer to generated code // Let intellij projects refer to generated code
idea { idea {
module { module {

View File

@ -1,17 +1,9 @@
plugins {
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
}
description = "gRPC: Stub" description = "gRPC: Stub"
dependencies { dependencies {
compile project(':grpc-core') compile project(':grpc-core')
testCompile libraries.truth, testCompile libraries.truth,
project(':grpc-testing') project(':grpc-testing')
} signature "org.codehaus.mojo.signature:java16:+@signature"
// Configure the animal sniffer plugin
animalsniffer {
signature = "org.codehaus.mojo.signature:java16:+@signature"
} }
javadoc.options.links "https://google.github.io/guava/releases/${guavaVersion}/api/docs/" javadoc.options.links "https://google.github.io/guava/releases/${guavaVersion}/api/docs/"