Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't repackage jar for uber profile #696

Merged
merged 1 commit into from
Jan 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
317 changes: 61 additions & 256 deletions boringssl-static/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -709,17 +709,14 @@
<id>uber-staging</id>

<properties>
<unpackDir>${project.build.directory}/unpack</unpackDir>
<libDir>${project.build.directory}/lib</libDir>
<nativeDir>${project.build.outputDirectory}/META-INF/native</nativeDir>
<maven.main.skip>true</maven.main.skip>
<skipTests>true</skipTests>
<!--
As we just re-package we don't want to do any extra steps that are needed for static compilation or
building the native lib itself.
-->
<linkStatic>false</linkStatic>
<compileLibrary>false</compileLibrary>
<uberArch>${os.detected.arch}</uberArch>
</properties>

<repositories>
Expand All @@ -730,273 +727,81 @@
</repository>
</repositories>

<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration combine.self="override">
<artifactItems>
<!-- Unpack just the native libraries -->
<artifactItem>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>osx-${uberArch}</classifier>
<type>jar</type>
<outputDirectory>${unpackDir}/osx-${uberArch}</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>osx-aarch_64</classifier>
<type>jar</type>
<outputDirectory>${unpackDir}/osx-aarch_64</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>linux-${uberArch}</classifier>
<type>jar</type>
<outputDirectory>${unpackDir}/linux-${uberArch}</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>linux-aarch_64</classifier>
<type>jar</type>
<outputDirectory>${unpackDir}/linux-aarch_64</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>windows-${uberArch}</classifier>
<type>jar</type>
<outputDirectory>${unpackDir}/windows-${uberArch}</outputDirectory>
</artifactItem>

<!-- Now unpack all of the Java classes and the original MANIFEST.MF -->
<artifactItem>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<type>jar</type>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<includes>**/*.class,**/MANIFEST.MF</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-jni-libs</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="copy-jni-libs">
<mkdir dir="${nativeDir}" />
<copy todir="${nativeDir}" flatten="true">
<fileset dir="${unpackDir}/osx-${uberArch}/META-INF/native" />
</copy>
<copy todir="${nativeDir}" flatten="true">
<fileset dir="${unpackDir}/osx-aarch_64/META-INF/native" />
</copy>
<copy todir="${nativeDir}" flatten="true">
<fileset dir="${unpackDir}/linux-${uberArch}/META-INF/native" />
</copy>
<copy todir="${nativeDir}" flatten="true">
<fileset dir="${unpackDir}/linux-aarch_64/META-INF/native" />
</copy>
<copy todir="${nativeDir}" flatten="true">
<fileset dir="${unpackDir}/windows-${uberArch}/META-INF/native" />
</copy>

<!-- Copy license material for attribution-->
<copy file="../NOTICE.txt" todir="${project.build.outputDirectory}/META-INF/" />
<copy file="../LICENSE.txt" todir="${project.build.outputDirectory}/META-INF/" />
<copy todir="${project.build.outputDirectory}/META-INF/license">
<fileset dir="../license" />
</copy>

</target>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>generate-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Export-Package>io.netty.internal.tcnative.*</Export-Package>
<Bundle-NativeCode>
META-INF/native/libnetty_tcnative_osx_${uberArch}.jnilib;osname=macos;osname=macosx;processor=${uberArch},
META-INF/native/libnetty_tcnative_osx_aarch_64.jnilib;osname=macos;osname=macosx;processor=aarch_64,
META-INF/native/libnetty_tcnative_linux_${uberArch}.so;osname=linux;processor=${uberArch},
META-INF/native/libnetty_tcnative_linux_aarch_64.so;osname=linux;processor=aarch_64,
META-INF/native/netty_tcnative_windows_${uberArch}.dll;osname=win32;processor=${uberArch}
</Bundle-NativeCode>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>linux-aarch_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>osx-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>osx-aarch_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>windows-x86_64</classifier>
</dependency>
</dependencies>
</profile>
<profile>
<id>uber-snapshot</id>

<properties>
<unpackDir>${project.build.directory}/unpack</unpackDir>
<libDir>${project.build.directory}/lib</libDir>
<nativeDir>${project.build.outputDirectory}/META-INF/native</nativeDir>
<maven.main.skip>true</maven.main.skip>
<skipTests>true</skipTests>
<!--
As we just re-package we don't want to do any extra steps that are needed for static compilation or
building the native lib itself.
-->
<linkStatic>false</linkStatic>
<compileLibrary>false</compileLibrary>
<uberArch>${os.detected.arch}</uberArch>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration combine.self="override">
<artifactItems>
<!-- Unpack just the native libraries (windows excluded as we not publish snapshots for it yet) -->
<artifactItem>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>osx-${uberArch}</classifier>
<type>jar</type>
<outputDirectory>${unpackDir}/osx-${uberArch}</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>linux-${uberArch}</classifier>
<type>jar</type>
<outputDirectory>${unpackDir}/linux-${uberArch}</outputDirectory>
</artifactItem>

<!-- Now unpack all of the Java classes and the original MANIFEST.MF -->
<artifactItem>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<type>jar</type>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<includes>**/*.class,**/MANIFEST.MF</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-jni-libs</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<!-- Windows excluded as we not publish snapshots for it yet -->
<target name="copy-jni-libs">
<mkdir dir="${nativeDir}" />
<copy todir="${nativeDir}" flatten="true">
<fileset dir="${unpackDir}/osx-${uberArch}/META-INF/native" />
</copy>
<copy todir="${nativeDir}" flatten="true">
<fileset dir="${unpackDir}/linux-${uberArch}/META-INF/native" />
</copy>

<!-- Copy license material for attribution-->
<copy file="../NOTICE.txt" todir="${project.build.outputDirectory}/META-INF/" />
<copy file="../LICENSE.txt" todir="${project.build.outputDirectory}/META-INF/" />
<copy todir="${project.build.outputDirectory}/META-INF/license">
<fileset dir="../license" />
</copy>

</target>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>generate-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Export-Package>io.netty.internal.tcnative.*</Export-Package>
<Bundle-NativeCode>
META-INF/native/libnetty_tcnative_osx_${uberArch}.jnilib;osname=macos;osname=macosx;processor=${uberArch},
META-INF/native/libnetty_tcnative_linux_${uberArch}.so;osname=linux;processor=${uberArch},
META-INF/native/netty_tcnative_windows_${uberArch}.dll;osname=win32;processor=${uberArch}
</Bundle-NativeCode>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>linux-aarch_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>osx-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${project.version}</version>
<classifier>windows-x86_64</classifier>
</dependency>
</dependencies>
</profile>

<!-- Profile to cross-compile for mac m1 -->
<profile>
<id>osx-m1-cross-compile</id>
Expand Down