netty-resolver-dns-native-macos-4.1.76.Final.pom 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 2019 The Netty Project
  4. ~
  5. ~ The Netty Project licenses this file to you under the Apache License,
  6. ~ version 2.0 (the "License"); you may not use this file except in compliance
  7. ~ with the License. You may obtain a copy of the License at:
  8. ~
  9. ~ https://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. ~ License for the specific language governing permissions and limitations
  15. ~ under the License.
  16. -->
  17. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
  18. <modelVersion>4.0.0</modelVersion>
  19. <parent>
  20. <groupId>io.netty</groupId>
  21. <artifactId>netty-parent</artifactId>
  22. <version>4.1.76.Final</version>
  23. </parent>
  24. <artifactId>netty-resolver-dns-native-macos</artifactId>
  25. <name>Netty/Resolver/DNS/Native/MacOS</name>
  26. <packaging>jar</packaging>
  27. <profiles>
  28. <profile>
  29. <id>mac</id>
  30. <activation>
  31. <os>
  32. <family>mac</family>
  33. </os>
  34. </activation>
  35. <properties>
  36. <jni.compiler.args.ldflags>LDFLAGS=-Wl,-weak_library,${unix.common.lib.unpacked.dir}/lib${unix.common.lib.name}.a -Wl,-platform_version,macos,10.6,10.6</jni.compiler.args.ldflags>
  37. <skipTests>false</skipTests>
  38. </properties>
  39. <build>
  40. <plugins>
  41. <plugin>
  42. <artifactId>maven-dependency-plugin</artifactId>
  43. <executions>
  44. <!-- unpack the unix-common static library and include files -->
  45. <execution>
  46. <id>unpack</id>
  47. <phase>generate-sources</phase>
  48. <goals>
  49. <goal>unpack-dependencies</goal>
  50. </goals>
  51. <configuration>
  52. <includeGroupIds>${project.groupId}</includeGroupIds>
  53. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  54. <classifier>${jni.classifier}</classifier>
  55. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  56. <includes>META-INF/native/**</includes>
  57. <overWriteReleases>false</overWriteReleases>
  58. <overWriteSnapshots>true</overWriteSnapshots>
  59. </configuration>
  60. </execution>
  61. </executions>
  62. </plugin>
  63. <plugin>
  64. <groupId>org.fusesource.hawtjni</groupId>
  65. <artifactId>maven-hawtjni-plugin</artifactId>
  66. <executions>
  67. <execution>
  68. <id>build-native-lib</id>
  69. <configuration>
  70. <name>netty_resolver_dns_native_macos_${os.detected.arch}</name>
  71. <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
  72. <libDirectory>${project.build.outputDirectory}</libDirectory>
  73. <!-- We use Maven's artifact classifier instead.
  74. This hack will make the hawtjni plugin to put the native library
  75. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  76. <platform>.</platform>
  77. <configureArgs>
  78. <arg>${jni.compiler.args.ldflags}</arg>
  79. <arg>${jni.compiler.args.cflags}</arg>
  80. <arg>MACOSX_DEPLOYMENT_TARGET=10.6</arg>
  81. </configureArgs>
  82. </configuration>
  83. <goals>
  84. <goal>generate</goal>
  85. <goal>build</goal>
  86. </goals>
  87. </execution>
  88. </executions>
  89. </plugin>
  90. <plugin>
  91. <artifactId>maven-jar-plugin</artifactId>
  92. <executions>
  93. <!-- Generate the JAR that contains the native library in it. -->
  94. <execution>
  95. <id>native-jar</id>
  96. <goals>
  97. <goal>jar</goal>
  98. </goals>
  99. <configuration>
  100. <archive>
  101. <manifest>
  102. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  103. </manifest>
  104. <manifestEntries>
  105. <Bundle-NativeCode>META-INF/native/libnetty_resolver_dns_native_macos_${os.detected.arch}.jnilib; osname=MacOSX; processor=${os.detected.arch}</Bundle-NativeCode>
  106. <Fragment-Host>io.netty.resolver-dns-classes-macos</Fragment-Host>
  107. <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
  108. </manifestEntries>
  109. <index>true</index>
  110. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  111. </archive>
  112. <classifier>${jni.classifier}</classifier>
  113. </configuration>
  114. </execution>
  115. </executions>
  116. </plugin>
  117. </plugins>
  118. </build>
  119. <dependencies>
  120. <dependency>
  121. <groupId>io.netty</groupId>
  122. <artifactId>netty-transport-native-unix-common</artifactId>
  123. <version>${project.version}</version>
  124. <classifier>${jni.classifier}</classifier>
  125. <!--
  126. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  127. dependency to get the static library which is built directly into the shared library generated by this project.
  128. -->
  129. <optional>true</optional>
  130. </dependency>
  131. </dependencies>
  132. </profile>
  133. <profile>
  134. <id>mac-m1-cross-compile</id>
  135. <properties>
  136. <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>
  137. <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>
  138. <!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->
  139. <jni.classifier>${os.detected.name}-aarch_64</jni.classifier>
  140. <skipTests>true</skipTests>
  141. </properties>
  142. <build>
  143. <plugins>
  144. <plugin>
  145. <artifactId>maven-dependency-plugin</artifactId>
  146. <executions>
  147. <!-- unpack the unix-common static library and include files -->
  148. <execution>
  149. <id>unpack</id>
  150. <phase>generate-sources</phase>
  151. <goals>
  152. <goal>unpack-dependencies</goal>
  153. </goals>
  154. <configuration>
  155. <includeGroupIds>${project.groupId}</includeGroupIds>
  156. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  157. <classifier>${jni.classifier}</classifier>
  158. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  159. <includes>META-INF/native/**</includes>
  160. <overWriteReleases>false</overWriteReleases>
  161. <overWriteSnapshots>true</overWriteSnapshots>
  162. </configuration>
  163. </execution>
  164. </executions>
  165. </plugin>
  166. <plugin>
  167. <groupId>org.fusesource.hawtjni</groupId>
  168. <artifactId>maven-hawtjni-plugin</artifactId>
  169. <executions>
  170. <execution>
  171. <id>build-native-lib</id>
  172. <configuration>
  173. <name>netty_resolver_dns_native_macos_aarch_64</name>
  174. <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
  175. <libDirectory>${project.build.outputDirectory}</libDirectory>
  176. <!-- We use Maven's artifact classifier instead.
  177. This hack will make the hawtjni plugin to put the native library
  178. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  179. <platform>.</platform>
  180. <configureArgs>
  181. <arg>${jni.compiler.args.ldflags}</arg>
  182. <arg>${jni.compiler.args.cflags}</arg>
  183. <configureArg>--host=aarch64-apple-darwin</configureArg>
  184. <arg>MACOSX_DEPLOYMENT_TARGET=11.0</arg>
  185. </configureArgs>
  186. </configuration>
  187. <goals>
  188. <goal>generate</goal>
  189. <goal>build</goal>
  190. </goals>
  191. </execution>
  192. </executions>
  193. </plugin>
  194. <plugin>
  195. <artifactId>maven-jar-plugin</artifactId>
  196. <executions>
  197. <!-- Generate the JAR that contains the native library in it. -->
  198. <execution>
  199. <id>native-jar</id>
  200. <goals>
  201. <goal>jar</goal>
  202. </goals>
  203. <configuration>
  204. <archive>
  205. <manifest>
  206. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  207. </manifest>
  208. <manifestEntries>
  209. <Bundle-NativeCode>META-INF/native/libnetty_resolver_dns_native_macos_aarch_64.jnilib; osname=MacOSX; processor=aarch_64</Bundle-NativeCode>
  210. <Fragment-Host>io.netty.resolver-dns-classes-macos</Fragment-Host>
  211. <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
  212. </manifestEntries>
  213. <index>true</index>
  214. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  215. </archive>
  216. <classifier>${jni.classifier}</classifier>
  217. </configuration>
  218. </execution>
  219. </executions>
  220. </plugin>
  221. </plugins>
  222. </build>
  223. <dependencies>
  224. <dependency>
  225. <groupId>io.netty</groupId>
  226. <artifactId>netty-transport-native-unix-common</artifactId>
  227. <version>${project.version}</version>
  228. <classifier>${jni.classifier}</classifier>
  229. <!--
  230. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  231. dependency to get the static library which is built directly into the shared library generated by this project.
  232. -->
  233. <optional>true</optional>
  234. </dependency>
  235. </dependencies>
  236. </profile>
  237. </profiles>
  238. <properties>
  239. <javaModuleName>io.netty.resolver.dns.macos</javaModuleName>
  240. <!-- Needed as we use SelfSignedCertificate in our tests -->
  241. <unix.common.lib.name>netty-unix-common</unix.common.lib.name>
  242. <unix.common.lib.dir>${project.build.directory}/unix-common-lib</unix.common.lib.dir>
  243. <unix.common.lib.unpacked.dir>${unix.common.lib.dir}/META-INF/native/lib</unix.common.lib.unpacked.dir>
  244. <unix.common.include.unpacked.dir>${unix.common.lib.dir}/META-INF/native/include</unix.common.include.unpacked.dir>
  245. <jni.compiler.args.cflags>CFLAGS=-O3 -Werror -fno-omit-frame-pointer -Wunused-variable -fvisibility=hidden -I${unix.common.include.unpacked.dir}</jni.compiler.args.cflags>
  246. <jni.compiler.args.ldflags>LDFLAGS=-z now -L${unix.common.lib.unpacked.dir} -Wl,--whole-archive -l${unix.common.lib.name} -Wl,--no-whole-archive</jni.compiler.args.ldflags>
  247. <japicmp.skip>true</japicmp.skip>
  248. </properties>
  249. <dependencies>
  250. <dependency>
  251. <groupId>io.netty</groupId>
  252. <artifactId>netty-resolver-dns-classes-macos</artifactId>
  253. <version>${project.version}</version>
  254. </dependency>
  255. </dependencies>
  256. <build>
  257. <plugins>
  258. <plugin>
  259. <artifactId>maven-jar-plugin</artifactId>
  260. <executions>
  261. <!-- Generate the fallback JAR that does not contain the native library. -->
  262. <execution>
  263. <id>default-jar</id>
  264. <configuration>
  265. <excludes>
  266. <exclude>META-INF/native/**</exclude>
  267. </excludes>
  268. </configuration>
  269. </execution>
  270. </executions>
  271. </plugin>
  272. </plugins>
  273. </build>
  274. </project>