Testing JNI
This commit is contained in:
parent
6a99a0ea4c
commit
44ebaa787f
16
.project
16
.project
@ -5,6 +5,12 @@
|
|||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||||
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
<arguments>
|
<arguments>
|
||||||
@ -15,9 +21,19 @@
|
|||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||||
|
<triggers>full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
145
pom.xml
145
pom.xml
@ -1,12 +1,12 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<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 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.warp.picalculator</groupId>
|
<groupId>org.warp.picalculator</groupId>
|
||||||
<artifactId>warppi-calculator</artifactId>
|
<artifactId>warppi-calculator</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
<name>WarpPI Calculator</name>
|
<name>WarpPI Calculator</name>
|
||||||
<url>http://warp.ovh</url>
|
<url>http://warp.ovh</url>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>oss-snapshots-repo</id>
|
<id>oss-snapshots-repo</id>
|
||||||
@ -18,49 +18,49 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.12</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>it.unimi.dsi</groupId>
|
|
||||||
<artifactId>fastutil</artifactId>
|
|
||||||
<version>7.2.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jogamp.jogl</groupId>
|
|
||||||
<artifactId>jogl-all-main</artifactId>
|
|
||||||
<version>2.3.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jogamp.gluegen</groupId>
|
|
||||||
<artifactId>gluegen-rt-main</artifactId>
|
|
||||||
<version>2.3.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.pi4j</groupId>
|
|
||||||
<artifactId>pi4j-core</artifactId>
|
|
||||||
<version>1.2-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.fusesource.jansi</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>jansi</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>1.15</version>
|
<version>4.12</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ar.com.hjg</groupId>
|
<groupId>it.unimi.dsi</groupId>
|
||||||
<artifactId>pngj</artifactId>
|
<artifactId>fastutil</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>7.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
<dependency>
|
||||||
<properties>
|
<groupId>org.jogamp.jogl</groupId>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<artifactId>jogl-all-main</artifactId>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<version>2.3.2</version>
|
||||||
</properties>
|
</dependency>
|
||||||
<build>
|
<dependency>
|
||||||
|
<groupId>org.jogamp.gluegen</groupId>
|
||||||
|
<artifactId>gluegen-rt-main</artifactId>
|
||||||
|
<version>2.3.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pi4j</groupId>
|
||||||
|
<artifactId>pi4j-core</artifactId>
|
||||||
|
<version>1.2-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.fusesource.jansi</groupId>
|
||||||
|
<artifactId>jansi</artifactId>
|
||||||
|
<version>1.15</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>ar.com.hjg</groupId>
|
||||||
|
<artifactId>pngj</artifactId>
|
||||||
|
<version>2.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
<build>
|
||||||
<finalName>WarpPICalculator</finalName>
|
<finalName>WarpPICalculator</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
||||||
@ -98,47 +98,30 @@
|
|||||||
</descriptorRefs>
|
</descriptorRefs>
|
||||||
<!-- MainClass in mainfest make a executable jar -->
|
<!-- MainClass in mainfest make a executable jar -->
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
<mainClass>org.warp.picalculator.Main</mainClass>
|
<mainClass>org.warp.picalculator.Main</mainClass>
|
||||||
</manifest>
|
</manifest>
|
||||||
</archive>
|
</archive>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>make-assembly</id>
|
<id>make-assembly</id>
|
||||||
<!-- bind to the packaging phase -->
|
<!-- bind to the packaging phase -->
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>single</goal>
|
<goal>single</goal>
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<!--
|
<!-- <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId>
|
||||||
<build>
|
<artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <configuration>
|
||||||
<plugins>
|
<failOnError>false</failOnError> <source>1.8</source> <target>1.8</target>
|
||||||
<plugin>
|
<archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>libs/</classpathPrefix>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<mainClass>org.warp.picalculator.Main</mainClass> </manifest> </archive>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
</configuration> </plugin> </plugins> </build> -->
|
||||||
<version>2.4</version>
|
|
||||||
<configuration>
|
|
||||||
<failOnError>false</failOnError>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
<archive>
|
|
||||||
<manifest>
|
|
||||||
<addClasspath>true</addClasspath>
|
|
||||||
<classpathPrefix>libs/</classpathPrefix>
|
|
||||||
<mainClass>org.warp.picalculator.Main</mainClass>
|
|
||||||
</manifest>
|
|
||||||
</archive>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
-->
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
package org.warp.picalculator;
|
package org.warp.picalculator;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cz.adamh.utils.NativeUtils;
|
||||||
|
|
||||||
public class TestJNI {
|
public class TestJNI {
|
||||||
static {
|
static {
|
||||||
// picalculatornative.dll on Windows or libpicalculatornative.so on Linux
|
try {
|
||||||
System.loadLibrary("picalculatornative");
|
NativeUtils.loadLibraryFromJar("/picalculatornative.dll");
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace(); // This is probably not the best way to handle exception :-)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private native void sayHello();
|
private native void sayHello();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user