| 3 | import org.jetbrains.annotations.*; |
| 4 | |
| 5 | public enum Platform { |
| 6 | WINDOWS, |
| 7 | LINUX, |
| 8 | MACOS_X64, |
| 9 | MACOS_ARM64; |
| 10 | |
| 11 | @ApiStatus.Internal public static final Platform[] _values = values(); |
| 12 | |
| 13 | public static final Platform CURRENT; |
| 14 | |
| 15 | static { |
| 16 | String os = System.getProperty("os.name").toLowerCase(); |
| 17 | if (os.contains("mac") || os.contains("darwin")) { |
| 18 | if ("aarch64".equals(System.getProperty("os.arch"))) |
| 19 | CURRENT = MACOS_ARM64; |
| 20 | else |
| 21 | CURRENT = MACOS_X64; |
| 22 | } else if (os.contains("windows")) |
| 23 | CURRENT = WINDOWS; |
| 24 | else if (os.contains("nux") || os.contains("nix")) |
| 25 | CURRENT = LINUX; |
| 26 | else |
| 27 | throw new RuntimeException("Unsupported platform: " + os); |
| 28 | } |
| 29 | } |
nothing calls this directly
no test coverage detected