Skip to content

Commit ffebe23

Browse files
authored
netty-shaded: Rename the directory of netty shaded resources to avoid collisions
1 parent 0838b73 commit ffebe23

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

netty/shaded/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ class NettyResourceTransformer implements Transformer {
110110

111111
@Override
112112
void transform(TransformerContext context) {
113+
String updatedPath = context.path.replace("io.netty", "io.grpc.netty.shaded.io.netty")
113114
String updatedContent = context.is.getText().replace("io.netty", "io.grpc.netty.shaded.io.netty")
114-
resources.put(context.path, updatedContent)
115+
resources.put(updatedPath, updatedContent)
115116
}
116117

117118
@Override

netty/shaded/src/testShadow/java/io/grpc/netty/shaded/ShadingTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public void noNormalNetty() throws Exception {
7878
@Test
7979
public void nettyResourcesUpdated() throws IOException {
8080
InputStream inputStream = NettyChannelBuilder.class.getClassLoader()
81-
.getResourceAsStream("META-INF/native-image/io.netty/transport/reflection-config.json");
81+
.getResourceAsStream(
82+
"META-INF/native-image/io.grpc.netty.shaded.io.netty/transport/reflection-config.json");
8283
assertThat(inputStream).isNotNull();
8384

8485
Scanner s = new Scanner(inputStream, StandardCharsets.UTF_8.name()).useDelimiter("\\A");

0 commit comments

Comments
 (0)