Fix netty dependency and class version checking

This commit is contained in:
Tyler Benson 2018-07-31 17:42:40 +10:00
parent afc16a0dd5
commit 9a6efe69f4
4 changed files with 10 additions and 10 deletions

View File

@ -2,11 +2,11 @@ apply plugin: 'version-scan'
versionScan {
group = "io.netty"
module = "netty-all"
module = "netty-codec-http"
legacyModule = "netty"
versions = "[4.0.0.Final,4.1.0.Final)"
verifyPresent = [
"io.netty.channel.local.LocalEventLoop": null,
"io.netty.handler.codec.spdy.SpdyOrHttpChooser": null,
]
}
@ -21,7 +21,7 @@ testSets {
}
dependencies {
compileOnly group: 'io.netty', name: 'netty-all', version: '4.0.0.Final'
compileOnly group: 'io.netty', name: 'netty-codec-http', version: '4.0.0.Final'
compile project(':dd-java-agent:agent-tooling')

View File

@ -53,7 +53,7 @@ public class NettyChannelPipelineInstrumentation extends Instrumenter.Default {
@Override
public ElementMatcher<? super ClassLoader> classLoaderMatcher() {
return classLoaderHasClasses("io.netty.channel.local.LocalEventLoop");
return classLoaderHasClasses("io.netty.handler.codec.spdy.SpdyOrHttpChooser");
}
@Override
@ -74,7 +74,7 @@ public class NettyChannelPipelineInstrumentation extends Instrumenter.Default {
@Override
public Map<ElementMatcher, String> transformers() {
Map<ElementMatcher, String> transformers = new HashMap<>();
final Map<ElementMatcher, String> transformers = new HashMap<>();
transformers.put(
isMethod()
.and(nameStartsWith("add"))

View File

@ -2,11 +2,11 @@ apply plugin: 'version-scan'
versionScan {
group = "io.netty"
module = "netty-all"
module = "netty-codec-http"
legacyModule = "netty"
versions = "[4.1.0.Final,)"
verifyPresent = [
"io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder": null,
"io.netty.handler.codec.http.HttpHeaderValues": null,
]
}
@ -21,7 +21,7 @@ testSets {
}
dependencies {
compileOnly group: 'io.netty', name: 'netty-all', version: '4.1.0.Final'
compileOnly group: 'io.netty', name: 'netty-codec-http', version: '4.1.0.Final'
compile project(':dd-java-agent:agent-tooling')

View File

@ -53,7 +53,7 @@ public class NettyChannelPipelineInstrumentation extends Instrumenter.Default {
@Override
public ElementMatcher<? super ClassLoader> classLoaderMatcher() {
return classLoaderHasClasses("io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder");
return classLoaderHasClasses("io.netty.handler.codec.http.HttpHeaderValues");
}
@Override
@ -74,7 +74,7 @@ public class NettyChannelPipelineInstrumentation extends Instrumenter.Default {
@Override
public Map<ElementMatcher, String> transformers() {
Map<ElementMatcher, String> transformers = new HashMap<>();
final Map<ElementMatcher, String> transformers = new HashMap<>();
transformers.put(
isMethod()
.and(nameStartsWith("add"))