Build static library including ranlib on UnixThis example uses the default compiler(gcc) to build the source, then override the linkerProvider to have Unix 'ar' to build the static library, after that apply Unix 'ranlib' on the output of 'ar' command. Complete example is here. <project>
...
<packaging>a</packaging>
...
<build>
<!-- The global source and test directory are used -->
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.jfrog.jade.plugins</groupId>
<artifactId>jade-native-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<compilerStartOptions>
<compilerStartOption>${commonCompilerOptions}</compilerStartOption>
</compilerStartOptions>
<testSources>
<source>
<directory>${native.source.dir}</directory>
<includes>
<include>helloFunc.c</include>
</includes>
</source>
<source>
<directory>${native.source.dir}/include</directory>
</source>
</testSources>
<linkerProvider>ar</linkerProvider>
<linkerStartOptions>
<linkerStartOption>-r</linkerStartOption>
</linkerStartOptions>
</configuration>
<!-- ranlib the output of the linker, ie the static lib -->
<executions>
<execution>
<id>ranlib</id>
<phase>package</package>
<goals>
<goal>ranlib</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> |
|||