< prev index next >

buildSrc/images/src/main/java/org/openjdk/skara/gradle/images/ImagesPlugin.java

Print this page

 36     private static String getOS() {
 37         var p = System.getProperty("os.name").toLowerCase();
 38         if (p.startsWith("win")) {
 39             return "windows";
 40         }
 41         if (p.startsWith("mac")) {
 42             return "macos";
 43         }
 44         if (p.startsWith("linux")) {
 45             return "linux";
 46         }
 47         if (p.startsWith("sunos")) {
 48             return "solaris";
 49         }
 50 
 51         throw new RuntimeException("Unknown operating system: " + System.getProperty("os.name"));
 52     }
 53 
 54     private static String getCPU() {
 55         var p = System.getProperty("os.arch").toLowerCase();
 56         if (p.startsWith("amd64")) {
 57             return "x64";
 58         }
 59         if (p.startsWith("x86") || p.startsWith("i386")) {
 60             return "x86";
 61         }
 62         if (p.startsWith("sparc")) {
 63             return "sparc";
 64         }
 65         if (p.startsWith("ppc")) {
 66             return "ppc";
 67         }
 68         if (p.startsWith("arm")) {
 69             return "arm";
 70         }
 71 
 72         throw new RuntimeException("Unknown CPU: " + System.getProperty("os.arch"));
 73     }
 74 
 75     @Override
 76     public void apply(Project project) {

 36     private static String getOS() {
 37         var p = System.getProperty("os.name").toLowerCase();
 38         if (p.startsWith("win")) {
 39             return "windows";
 40         }
 41         if (p.startsWith("mac")) {
 42             return "macos";
 43         }
 44         if (p.startsWith("linux")) {
 45             return "linux";
 46         }
 47         if (p.startsWith("sunos")) {
 48             return "solaris";
 49         }
 50 
 51         throw new RuntimeException("Unknown operating system: " + System.getProperty("os.name"));
 52     }
 53 
 54     private static String getCPU() {
 55         var p = System.getProperty("os.arch").toLowerCase();
 56         if (p.startsWith("amd64") || p.startsWith("x86_64") || p.startsWith("x64")) {
 57             return "x64";
 58         }
 59         if (p.startsWith("x86") || p.startsWith("i386")) {
 60             return "x86";
 61         }
 62         if (p.startsWith("sparc")) {
 63             return "sparc";
 64         }
 65         if (p.startsWith("ppc")) {
 66             return "ppc";
 67         }
 68         if (p.startsWith("arm")) {
 69             return "arm";
 70         }
 71 
 72         throw new RuntimeException("Unknown CPU: " + System.getProperty("os.arch"));
 73     }
 74 
 75     @Override
 76     public void apply(Project project) {
< prev index next >