Skip to content

Commit

Permalink
Include classifier in Automatic-Module-Name (netty#12354)
Browse files Browse the repository at this point in the history
Motivation:

To be able to have multiple native versions (for different architectures) on the classpath we need to include the classifier in the module name

Modifications:

Add classifier in the module name

Result:

Be able to have native bits for different architectures on the classpath when using modules
  • Loading branch information
normanmaurer authored and 夏无影 committed Jul 8, 2022
1 parent d71d483 commit 435dde5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion resolver-dns-native-macos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@

<!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->
<jni.classifier>${os.detected.name}-aarch_64</jni.classifier>
<javaModuleNameClassifier>${os.detected.name}.aarch_64</javaModuleNameClassifier>
<skipTests>true</skipTests>
</properties>
<build>
Expand Down Expand Up @@ -244,7 +245,8 @@
</profiles>

<properties>
<javaModuleName>io.netty.resolver.dns.macos</javaModuleName>
<javaModuleNameClassifier>${os.detected.name}.${os.detected.arch}</javaModuleNameClassifier>
<javaModuleName>io.netty.resolver.dns.macos.${javaModuleNameClassifier}</javaModuleName>
<!-- Needed as we use SelfSignedCertificate in our tests -->
<unix.common.lib.name>netty-unix-common</unix.common.lib.name>
<unix.common.lib.dir>${project.build.directory}/unix-common-lib</unix.common.lib.dir>
Expand Down
4 changes: 3 additions & 1 deletion transport-native-epoll/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<packaging>jar</packaging>

<properties>
<javaModuleName>io.netty.transport.epoll</javaModuleName>
<javaModuleNameClassifier>${os.detected.name}.${os.detected.arch}</javaModuleNameClassifier>
<javaModuleName>io.netty.transport.epoll.${javaModuleNameClassifier}</javaModuleName>
<!-- Needed as we use SelfSignedCertificate in our tests -->
<argLine.java9.extras>--add-exports java.base/sun.security.x509=ALL-UNNAMED</argLine.java9.extras>
<unix.common.lib.name>netty-unix-common</unix.common.lib.name>
Expand Down Expand Up @@ -219,6 +220,7 @@
<properties>
<!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->
<jni.classifier>${os.detected.name}-aarch_64</jni.classifier>
<javaModuleNameClassifier>${os.detected.name}.aarch_64</javaModuleNameClassifier>
</properties>
<build>
<pluginManagement>
Expand Down
4 changes: 3 additions & 1 deletion transport-native-kqueue/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
<properties>
<!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->
<jni.classifier>${os.detected.name}-aarch_64</jni.classifier>
<javaModuleNameClassifier>${os.detected.name}.aarch_64</javaModuleNameClassifier>
<jni.compiler.args.cflags>CFLAGS=-target arm64-apple-macos11 -O3 -Werror -fno-omit-frame-pointer -Wunused-variable -fvisibility=hidden -I${unix.common.include.unpacked.dir}</jni.compiler.args.cflags>
<jni.compiler.args.ldflags>LDFLAGS=-arch arm64 -Wl,-weak_library,${unix.common.lib.unpacked.dir}/lib${unix.common.lib.name}.a -Wl,-platform_version,macos,11.0,11.0</jni.compiler.args.ldflags>
<skipTests>true</skipTests>
Expand Down Expand Up @@ -477,7 +478,8 @@
</profiles>

<properties>
<javaModuleName>io.netty.transport.kqueue</javaModuleName>
<javaModuleNameClassifier>${os.detected.name}.${os.detected.arch}</javaModuleNameClassifier>
<javaModuleName>io.netty.transport.kqueue.${javaModuleNameClassifier}</javaModuleName>
<!-- Needed as we use SelfSignedCertificate in our tests -->
<argLine.java9.extras>--add-exports java.base/sun.security.x509=ALL-UNNAMED</argLine.java9.extras>
<unix.common.lib.name>netty-unix-common</unix.common.lib.name>
Expand Down

0 comments on commit 435dde5

Please sign in to comment.