Check offline updates for incompatibility (#2361)

This commit is contained in:
Sam Freund
2026-02-18 01:24:46 -06:00
committed by GitHub
parent c91df33b63
commit 5474e28826
8 changed files with 132 additions and 6 deletions

View File

@@ -17,6 +17,7 @@
package org.photonvision.common.hardware;
import edu.wpi.first.util.CombinedRuntimeLoader;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
@@ -139,6 +140,27 @@ public enum Platform {
}
}
/**
* This function serves to map between formats used in the CombinedRuntimeLoader and the platform
* names used in the wpilib-tools-plugin. This is typically used for native libraries.
*
* @return String representing the platform in the format used by wpilib-tools-plugin, or an empty
* string if the platform is not recognized.
*/
public static String getNativePlatform() {
String platPath = CombinedRuntimeLoader.getPlatformPath();
if (platPath == "/linux/x86-64/") {
return "linuxx64";
} else if (platPath == "/windows/x86-64/") {
return "winx64";
} else if (platPath == "/linux/arm64/") {
return "linuxarm64";
} else {
return "";
}
}
public static String getHardwareModel() {
return currentPlatform.hardwareModel;
}