Skip to content

Commit

Permalink
[#343] improvement(build): Shade Netty Native lib (#924)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Add the shade Netty Native lib into` pom.xml`

### Why are the changes needed?

Fix: #343 

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

current UT
  • Loading branch information
cchung100m committed Jun 10, 2023
1 parent e9342cc commit 84167c5
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
32 changes: 32 additions & 0 deletions client-mr/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,38 @@
</relocations>
</configuration>
</execution>
<!-- shade the native netty libs as well -->
<execution>
<id>unpack</id>
<phase>package</phase>
<configuration>
<target>
<echo message="Shade netty native libraries to ${rss.shade.packageName}" />
<unzip src="${artifactId}-${version}.jar" dest="${project.build.directory}/unpacked/" />
<echo message="renaming native epoll library"></echo>
<move includeemptydirs="false" todir="${project.build.directory}/unpacked/META-INF/native">
<fileset dir="${project.build.directory}/unpacked/META-INF/native"></fileset>
<mapper from="libnetty_transport_native_epoll_x86_64.so"
to="lib${rss.shade.packageName}_shaded_netty_transport_native_epoll_x86_64.so"
type="glob"></mapper>
</move>
<move includeemptydirs="false" todir="${project.build.directory}/unpacked/META-INF/native">
<fileset dir="${project.build.directory}/unpacked/META-INF/native"></fileset>
<mapper from="libnetty_transport_native_epoll_aarch_64.so"
to="lib${rss.shade.packageName}_shaded_netty_transport_native_epoll_aarch_64.so"
type="glob"></mapper>
</move>
<move includeemptydirs="false" todir="${project.build.directory}/unpacked/META-INF/native">
<fileset dir="${project.build.directory}/unpacked/META-INF/native"></fileset>
<mapper from="libnetty_transport_native_kqueue_x86_64.jnilib"
to="lib${rss.shade.packageName}_shaded_netty_transport_native_kqueue_x86_64.jnilib"
type="glob"></mapper>
</move>
<echo message="repackaging netty jar"></echo>
<jar destfile="${artifactId}-${version}.jar" basedir="${project.build.directory}/unpacked" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
32 changes: 32 additions & 0 deletions client-spark/spark2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,38 @@
</relocations>
</configuration>
</execution>
<!-- shade the native netty libs as well -->
<execution>
<id>unpack</id>
<phase>package</phase>
<configuration>
<target>
<echo message="Shade netty native libraries to ${rss.shade.packageName}" />
<unzip src="${artifactId}-${version}.jar" dest="${project.build.directory}/unpacked/" />
<echo message="renaming native epoll library"></echo>
<move includeemptydirs="false" todir="${project.build.directory}/unpacked/META-INF/native">
<fileset dir="${project.build.directory}/unpacked/META-INF/native"></fileset>
<mapper from="libnetty_transport_native_epoll_x86_64.so"
to="lib${rss.shade.packageName}_shaded_netty_transport_native_epoll_x86_64.so"
type="glob"></mapper>
</move>
<move includeemptydirs="false" todir="${project.build.directory}/unpacked/META-INF/native">
<fileset dir="${project.build.directory}/unpacked/META-INF/native"></fileset>
<mapper from="libnetty_transport_native_epoll_aarch_64.so"
to="lib${rss.shade.packageName}_shaded_netty_transport_native_epoll_aarch_64.so"
type="glob"></mapper>
</move>
<move includeemptydirs="false" todir="${project.build.directory}/unpacked/META-INF/native">
<fileset dir="${project.build.directory}/unpacked/META-INF/native"></fileset>
<mapper from="libnetty_transport_native_kqueue_x86_64.jnilib"
to="lib${rss.shade.packageName}_shaded_netty_transport_native_kqueue_x86_64.jnilib"
type="glob"></mapper>
</move>
<echo message="repackaging netty jar"></echo>
<jar destfile="${artifactId}-${version}.jar" basedir="${project.build.directory}/unpacked" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
32 changes: 32 additions & 0 deletions client-spark/spark3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,38 @@
</relocations>
</configuration>
</execution>
<!-- shade the native netty libs as well -->
<execution>
<id>unpack</id>
<phase>package</phase>
<configuration>
<target>
<echo message="Shade netty native libraries to ${rss.shade.packageName}" />
<unzip src="${artifactId}-${version}.jar" dest="${project.build.directory}/unpacked/" />
<echo message="renaming native epoll library"></echo>
<move includeemptydirs="false" todir="${project.build.directory}/unpacked/META-INF/native">
<fileset dir="${project.build.directory}/unpacked/META-INF/native"></fileset>
<mapper from="libnetty_transport_native_epoll_x86_64.so"
to="lib${rss.shade.packageName}_shaded_netty_transport_native_epoll_x86_64.so"
type="glob"></mapper>
</move>
<move includeemptydirs="false" todir="${project.build.directory}/unpacked/META-INF/native">
<fileset dir="${project.build.directory}/unpacked/META-INF/native"></fileset>
<mapper from="libnetty_transport_native_epoll_aarch_64.so"
to="lib${rss.shade.packageName}_shaded_netty_transport_native_epoll_aarch_64.so"
type="glob"></mapper>
</move>
<move includeemptydirs="false" todir="${project.build.directory}/unpacked/META-INF/native">
<fileset dir="${project.build.directory}/unpacked/META-INF/native"></fileset>
<mapper from="libnetty_transport_native_kqueue_x86_64.jnilib"
to="lib${rss.shade.packageName}_shaded_netty_transport_native_kqueue_x86_64.jnilib"
type="glob"></mapper>
</move>
<echo message="repackaging netty jar"></echo>
<jar destfile="${artifactId}-${version}.jar" basedir="${project.build.directory}/unpacked" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down

0 comments on commit 84167c5

Please sign in to comment.