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