Skip to content

Commit 31819ab

Browse files
authored
Merge pull request #6 from OpenBCI/v2-mac-bug-fix
Update dynamic library on Mac to look in parent of jar directory
2 parents cb7477b + 54e6824 commit 31819ab

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22

33
Helpers for [OpenBCI GUI](https://github.com/OpenBCI/OpenBCI_GUI)
44

5-
Built using Github Actions for all OS. The .dylib files for Mac are also provided as an artifact.
5+
Built using Github Actions for all OS. The .dylib files for Mac are also provided as an artifact. These files should be included in the `libraries` folder outside of the .jar file as shown below. As a result, we do not need to extract them from the .jar file on Mac.
66

77
When updating this library in the GUI, use the following folder structure:
88

99
- GUI Repo Root Directory
10-
- OpenBCI_GUI
11-
- libraries
12-
- openbci_gui_helpers
13-
- library
14-
- `openbci_gui_helpers.jar`
10+
- OpenBCI_GUI
11+
- libraries
12+
- openbci_gui_helpers
13+
- library
14+
- `openbci_gui_helpers.jar`
15+
- `libGanglionNativeScan.dylib`
16+
- `libGanglionScan.dylib`
17+
18+
## License:
1519

16-
## License:
1720
MIT

java-package/openbci_gui_helpers/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>openbci_gui_helpers</groupId>
88
<artifactId>openbci_gui_helpers</artifactId>
9-
<version>2.0.0</version>
9+
<version>2.0.1</version>
1010

1111
<name>openbci_gui_helpers</name>
1212
<url>https://github.com/OpenBCI/OpenBCI_GUI_Helpers</url>

java-package/openbci_gui_helpers/src/main/java/openbci_gui_helpers/GUIHelper.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private interface DllNativeInterface extends Library
3333

3434
private static DllInterface instance;
3535
private static DllNativeInterface instance_native;
36-
private static final String VERSION = "2.0.0";
36+
private static final String VERSION = "2.0.1";
3737

3838
static
3939
{
@@ -74,8 +74,6 @@ private static String unpack_from_jar (String lib_name)
7474
String jarPath = GUIHelper.class.getProtectionDomain().getCodeSource().getLocation().getPath();
7575
File jarFile = new File(jarPath);
7676
String libPathString = jarFile.getParentFile().getAbsolutePath() + File.separator + lib_name;
77-
Path libPath = Paths.get(libPathString);
78-
Files.copy (link, libPath);
7977
return libPathString;
8078
} else {
8179
Files.copy (link, file.getAbsoluteFile ().toPath ());
@@ -87,9 +85,6 @@ private static String unpack_from_jar (String lib_name)
8785
System.err.println("native library: " + lib_name + " is not found in jar file");
8886
System.err.println("file absolute to path: " + file.getAbsoluteFile().toPath());
8987
System.err.println("file get absolute path: " + file.getAbsolutePath());
90-
if (SystemUtils.IS_OS_MAC) {
91-
return file.getAbsolutePath();
92-
}
9388
return "";
9489
}
9590
}

0 commit comments

Comments
 (0)