From e2879b7bf2421b6c7b1dec2ce8784f253f6e27a7 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 20 Sep 2015 10:56:06 -0700 Subject: [PATCH] Fix JNI embed location on Windows. Make it Windows version agnostic and fix the amd64 runtime / x86-64 build architecture naming difference. See artf4198. --- build.gradle | 6 ++++++ .../wpi/first/wpilibj/networktables/NetworkTablesJNI.java | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a751a63526..bd1f173ff5 100644 --- a/build.gradle +++ b/build.gradle @@ -211,6 +211,12 @@ jar { } else { into "Linux/" + binary.targetPlatform.architecture.name } + } else if (binary.targetPlatform.operatingSystem.name.startsWith("Windows")) { + if (binary.targetPlatform.architecture.name == "x86-64") { + into "Windows/amd64" + } else { + into "Windows/" + binary.targetPlatform.architecture.name + } } else { into 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 a613b0d8b9..c27c1fbad0 100644 --- a/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java +++ b/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java @@ -15,7 +15,11 @@ public class NetworkTablesJNI { if (!libraryLoaded) { try { String osname = System.getProperty("os.name"); - String resname = "/" + osname + "/" + System.getProperty("os.arch") + "/"; + String resname; + if (osname.startsWith("Windows")) + resname = "/Windows/" + System.getProperty("os.arch") + "/"; + else + resname = "/" + osname + "/" + System.getProperty("os.arch") + "/"; System.out.println("platform: " + resname); if (osname.startsWith("Windows")) resname += "ntcore.dll";