From ed388169ff95b4dbd45622f9164a607e4dbe7462 Mon Sep 17 00:00:00 2001 From: dzou Date: Thu, 17 Jun 2021 17:33:29 -0400 Subject: [PATCH] Rename the directory of netty shaded resources to avoid collisions --- netty/shaded/build.gradle | 3 ++- .../src/testShadow/java/io/grpc/netty/shaded/ShadingTest.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/netty/shaded/build.gradle b/netty/shaded/build.gradle index af0c9648c6f..40174116fbc 100644 --- a/netty/shaded/build.gradle +++ b/netty/shaded/build.gradle @@ -107,8 +107,9 @@ class NettyResourceTransformer implements Transformer { @Override void transform(TransformerContext context) { + String updatedPath = context.path.replace("io.netty", "io.grpc.netty.shaded.io.netty") String updatedContent = context.is.getText().replace("io.netty", "io.grpc.netty.shaded.io.netty") - resources.put(context.path, updatedContent) + resources.put(updatedPath, updatedContent) } @Override diff --git a/netty/shaded/src/testShadow/java/io/grpc/netty/shaded/ShadingTest.java b/netty/shaded/src/testShadow/java/io/grpc/netty/shaded/ShadingTest.java index d3bdc4394ca..5c2ff317ccd 100644 --- a/netty/shaded/src/testShadow/java/io/grpc/netty/shaded/ShadingTest.java +++ b/netty/shaded/src/testShadow/java/io/grpc/netty/shaded/ShadingTest.java @@ -78,7 +78,8 @@ public void noNormalNetty() throws Exception { @Test public void nettyResourcesUpdated() throws IOException { InputStream inputStream = NettyChannelBuilder.class.getClassLoader() - .getResourceAsStream("META-INF/native-image/io.netty/transport/reflection-config.json"); + .getResourceAsStream( + "META-INF/native-image/io.grpc.netty.shaded.io.netty/transport/reflection-config.json"); assertThat(inputStream).isNotNull(); Scanner s = new Scanner(inputStream, StandardCharsets.UTF_8.name()).useDelimiter("\\A");