Skip to content

Commit

Permalink
Use javac -h instead of deprecated javah.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstyura committed Sep 24, 2019
1 parent 9bcb66a commit 7964c3d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 29 deletions.
8 changes: 8 additions & 0 deletions jniwrapper/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<artifactId>jniwrapper-java</artifactId>
<name>usrsctp JNI wrapper (Java code)</name>

<properties>
<native_headers_dir>${project.build.outputDirectory}/native/headers</native_headers_dir>
</properties>

<build>
<plugins>
<plugin>
Expand All @@ -22,6 +26,10 @@
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<compilerArg>-h</compilerArg>
<compilerArg>${native_headers_dir}</compilerArg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
Expand Down
29 changes: 11 additions & 18 deletions jniwrapper/native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

<properties>
<usrsctp_prebuilt_dir>${project.build.directory}/usrsctp_prebuilt/${maven_platform_classifier}</usrsctp_prebuilt_dir>
<jniwrapper_java_headers_dir>${project.build.directory}/jniwrapper_java_headers/</jniwrapper_java_headers_dir>
<jnisctp_build_dir>${project.build.directory}/jnisctp_cmake/${maven_platform_classifier}</jnisctp_build_dir>
<jnisctp_install_dir>${project.build.directory}/jnisctp/install/lib/${maven_platform_classifier}</jnisctp_install_dir>
<javah_output_dir>${project.build.directory}/native/javah</javah_output_dir>
<jniwrapper_native_classifier>${maven_platform_classifier}</jniwrapper_native_classifier>
</properties>

Expand Down Expand Up @@ -55,7 +55,7 @@
<executions>
<!-- Unpack header files and libraries for build -->
<execution>
<id>unpack</id>
<id>unpack-usrsctp</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack-dependencies</goal>
Expand All @@ -66,27 +66,20 @@
<outputDirectory>${usrsctp_prebuilt_dir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>javah-generate</id>
<id>unpack-jniwrapper-java-headers</id>
<phase>generate-sources</phase>
<goals>
<goal>javah</goal>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeTypes>jar</includeTypes>
<includeArtifactIds>jniwrapper-java</includeArtifactIds>
<includes>**/*.h</includes>
<outputDirectory>${jniwrapper_java_headers_dir}</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<javahClassNames>
<javahClassName>org.jitsi_modified.sctp4j.SctpJni</javahClassName>
</javahClassNames>
<javahOutputDirectory>${javah_output_dir}</javahOutputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down Expand Up @@ -134,7 +127,7 @@
<arguments>
<argument>-DCMAKE_BUILD_TYPE=RelWithDebInfo</argument>
<argument>-DCMAKE_POSITION_INDEPENDENT_CODE=ON</argument>
<argument>-DJNISCTP_JNI_HEADERS_DIR=${javah_output_dir}</argument>
<argument>-DJNISCTP_JNI_HEADERS_DIR=${jniwrapper_java_headers_dir}/native/headers</argument>
<argument>-DJNISCTP_USRSCTP_DIR=${usrsctp_prebuilt_dir}</argument>
<argument>-DCMAKE_INSTALL_PREFIX=${jnisctp_install_dir}</argument>
<argument>${cmake_c_flags}</argument>
Expand Down
13 changes: 2 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -89,24 +89,15 @@
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>com.googlecode.cmake-maven-project</groupId>
<artifactId>cmake-maven-plugin</artifactId>
<version>3.7.2-b1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.0-alpha-9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
Expand Down

0 comments on commit 7964c3d

Please sign in to comment.