From d9d39f1394d9e2bd466ccaa425a18d56a49283c8 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 23 Aug 2019 09:30:27 +0200 Subject: [PATCH] Include c source files in source jar (#9497) Motivation: We should not only include the java source files but also the c source file in our source jars. Modifications: Add files from src/main/c as well Result: Fixes https://github.com/netty/netty/issues/9494 --- transport-native-epoll/pom.xml | 21 ++++++++++++++++++++- transport-native-kqueue/pom.xml | 25 ++++++++++++++++++++++--- transport-native-unix-common/pom.xml | 23 +++++++++++++++++++++++ 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/transport-native-epoll/pom.xml b/transport-native-epoll/pom.xml index 257bbc6f49..952363832e 100644 --- a/transport-native-epoll/pom.xml +++ b/transport-native-epoll/pom.xml @@ -35,6 +35,7 @@ ${unix.common.lib.dir}/META-INF/native/lib ${unix.common.lib.dir}/META-INF/native/include LDFLAGS=-L${unix.common.lib.unpacked.dir} -Wl,--no-as-needed -lrt -Wl,--whole-archive -l${unix.common.lib.name} -Wl,--no-whole-archive + ${project.basedir}/src/main/c true @@ -146,7 +147,7 @@ build-native-lib netty_transport_native_epoll_${os.detected.arch} - ${project.basedir}/src/main/c + ${nativeSourceDirectory} ${project.build.outputDirectory} + + org.codehaus.mojo + build-helper-maven-plugin + + + generate-sources + + add-source + + + + ${nativeSourceDirectory} + + + + + maven-jar-plugin diff --git a/transport-native-kqueue/pom.xml b/transport-native-kqueue/pom.xml index 7c9e44945c..1649e4dc25 100644 --- a/transport-native-kqueue/pom.xml +++ b/transport-native-kqueue/pom.xml @@ -71,7 +71,7 @@ build-native-lib netty_transport_native_kqueue_${os.detected.arch} - ${project.basedir}/src/main/c + ${nativeSourceDirectory} ${project.build.outputDirectory} + + org.codehaus.mojo + build-helper-maven-plugin + + + generate-sources + + add-source + + + + ${nativeSourceDirectory} + + + + + maven-jar-plugin diff --git a/transport-native-unix-common/pom.xml b/transport-native-unix-common/pom.xml index eeb394c68c..0709171856 100644 --- a/transport-native-unix-common/pom.xml +++ b/transport-native-unix-common/pom.xml @@ -44,6 +44,29 @@ ${project.build.directory}/${project.build.finalName}-${jni.classifier}.jar + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + generate-sources + + add-source + + + + ${nativeIncludeDir} + + + + + + + + mac