From 6a0485a72cc9b36d31f59c6df20b42059386876f Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Mon, 16 Nov 2015 09:56:47 -0500 Subject: [PATCH] Fixed mac lib path Change-Id: Ib6f38b7f42df9c9908c7e60eca12dd48c9c4114a --- build.gradle | 6 ++++++ .../wpi/first/wpilibj/networktables/NetworkTablesJNI.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/build.gradle b/build.gradle index 204af308ec..201451b1fb 100644 --- a/build.gradle +++ b/build.gradle @@ -28,6 +28,12 @@ ext.getPlatformPath = { binary -> } else { return 'Windows/' + binary.targetPlatform.architecture.name } + } else if (binary.targetPlatform.operatingSystem.macOsX) { + if (binary.targetPlatform.architecture.amd64) { + return 'Mac OS X/x86_64' + } else { + return 'Mac OS X/' + binary.targetPlatform.architecture.name + } } else { return binary.targetPlatform.operatingSystem.name + '/' + binary.targetPlatform.architecture.name } diff --git a/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java b/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java index f6e02219ed..d48778fba2 100644 --- a/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java +++ b/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java @@ -23,6 +23,8 @@ public class NetworkTablesJNI { System.out.println("platform: " + resname); if (osname.startsWith("Windows")) resname += "ntcore.dll"; + else if (osname.startsWith("Mac")) + resname += "libntcore.dylib"; else resname += "libntcore.so"; InputStream is = NetworkTablesJNI.class.getResourceAsStream(resname); @@ -30,6 +32,8 @@ public class NetworkTablesJNI { // create temporary file if (System.getProperty("os.name").startsWith("Windows")) jniLibrary = File.createTempFile("NetworkTablesJNI", ".dll"); + else if (System.getProperty("os.name").startsWith("Mac")) + jniLibrary = File.createTempFile("libNetworkTablesJNI", ".dylib"); else jniLibrary = File.createTempFile("libNetworkTablesJNI", ".so"); // flag for delete on exit