Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
olir committed Apr 9, 2018
1 parent 254ca67 commit 7d7686d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 22 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ For more visit the [Description on GitHub Pages](https://olir.github.io/Frankens

## Status

[![Build Status](https://travis-ci.org/olir/Frankenstein.png)](https://travis-ci.org/olir/Frankenstein/builds)
[![Build Status](https://travis-ci.org/olir/Frankenstein.svg)](https://travis-ci.org/olir/Frankenstein/builds)
[![Dependency Status](https://www.versioneye.com/user/projects/594a6802368b0800421af505/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/594a6802368b0800421af505)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.serviceflow/frankenstein/badge.png)](https://maven-badges.herokuapp.com/maven-central/de.serviceflow/frankenstein)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.serviceflow.frankenstein/app/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.serviceflow.frankenstein/app)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/de.serviceflow.frankenstein/app.svg)](http://bytedeco.org/builds/)

For current or full status see [Release Notes](https://olir.github.io/Frankenstein/doc/RELEASE-NOTES.html).
24 changes: 14 additions & 10 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
Expand All @@ -137,17 +137,21 @@
</descriptorRefs>
<finalName>frankenstein</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<!-- win64 only for now -->
<descriptor>src/assembly/jar-with-deps-with-exclude.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>${mainClass}</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<application-name>Frankenstein VR</application-name>
<permissions>all-permissions</permissions>
<codebase>${manifest.Codebase}</codebase>
<!-- <Implementation-Build>${buildNumber}</Implementation-Build> -->
</manifestEntries>
<manifestEntries>
<application-name>Frankenstein</application-name>
<permissions>all-permissions</permissions>
<codebase>${manifest.Codebase}</codebase>
<!-- <Implementation-Build>${buildNumber}</Implementation-Build> -->
</manifestEntries>
</archive>
</configuration>
</plugin>
Expand Down
17 changes: 17 additions & 0 deletions app/src/assembly/jar-with-deps-with-exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<!-- TODO: a jarjar format would be better -->
<id>jar-with-dependencies-and-excluded-other-arch</id>
<fileSets>
<fileSet>
<useDefaultExcludes>false</useDefaultExcludes>
<excludes>
<exclude>**/linux/**</exclude>
<exclude>**/osx/**</exclude>
<exclude>**/x86_32/**</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,32 @@ public String prepareLoadLibrary(Class<?> invokerClass, String libraryBasename)
}
// TODO !!! ...

prepareLoadLibraryImpl(invokerClass, plattformLibraryName, suffix);
prepareLoadLibraryImpl(invokerClass, plattformLibraryName, suffix, null);

return plattformLibraryName;
}

// direct, plattform-specific
public void prepareLoadLibraryWithoutArch(Class<?> invokerClass, String name, String suffix) throws UnsatisfiedLinkError {
prepareLoadLibraryImpl(invokerClass, name, suffix);
public void prepareLoadLibraryWithoutArch(Class<?> invokerClass, String name, String suffix, String path) throws UnsatisfiedLinkError {
prepareLoadLibraryImpl(invokerClass, name, suffix, path);
}

private static void prepareLoadLibraryImpl(Class<?> invokerClass, String plattformLibraryName, String suffix)
private static void prepareLoadLibraryImpl(Class<?> invokerClass, String plattformLibraryName, String suffix, String path)
throws UnsatisfiedLinkError {
synchronized (loadedLibraries) {

if (loadedLibraries.contains(plattformLibraryName.intern()))
return;

if (path==null)
path = "/";
String libFileName = plattformLibraryName + suffix;
String location = "/" + libFileName;
InputStream binary = invokerClass.getResourceAsStream("/" + libFileName);
InputStream binary = invokerClass.getResourceAsStream(path + libFileName);
if (binary == null)
throw new Error("binary not found: " + "/" + libFileName);
throw new Error("binary not found: " + path + libFileName);

try {
String location = "/" + libFileName;
Path tmpDir = Files.createTempDirectory(TEMPPATH);
tmpDir.toFile().deleteOnExit();
Path destination = tmpDir.resolve("./" + location).normalize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ private void loadOpenCV() {
String opencvlib = "opencv_java320";
String ffmpeglib = "opencv_ffmpeg320_64";
String suffix = ".dll";

String cvarchpath = "/nu/pattern/opencv/windows/x86_64";

LibraryManager lm = new LibraryManager();
lm.prepareLoadLibraryWithoutArch(this.getClass(), ffmpeglib, suffix);
lm.prepareLoadLibraryWithoutArch(this.getClass(), ffmpeglib, suffix, null);
System.loadLibrary(ffmpeglib);
lm.prepareLoadLibraryWithoutArch(this.getClass(), opencvlib, suffix);
lm.prepareLoadLibraryWithoutArch(this.getClass(), opencvlib, suffix, cvarchpath);
System.loadLibrary(opencvlib);
}

Expand Down

0 comments on commit 7d7686d

Please sign in to comment.