src/jdk.packager/macosx/classes/jdk/packager/internal/mac/MacAppStoreBundler.java
branchJDK-8200758-branch
changeset 56989 0f19096663d1
parent 56982 e094d5483bd6
equal deleted inserted replaced
56988:3cb9af04c779 56989:0f19096663d1
   215             }
   215             }
   216             buildOptions.add(finalPKG.getAbsolutePath());
   216             buildOptions.add(finalPKG.getAbsolutePath());
   217 
   217 
   218             pb = new ProcessBuilder(buildOptions);
   218             pb = new ProcessBuilder(buildOptions);
   219 
   219 
   220             IOUtils.exec(pb, ECHO_MODE.fetchFrom(p));
   220             IOUtils.exec(pb, false);
   221             return finalPKG;
   221             return finalPKG;
   222         } catch (Exception ex) {
   222         } catch (Exception ex) {
   223             Log.info("App Store Ready Bundle failed : " + ex.getMessage());
   223             Log.info("App Store Ready Bundle failed : " + ex.getMessage());
   224             ex.printStackTrace();
   224             ex.printStackTrace();
   225             Log.debug(ex);
   225             Log.debug(ex);
   235                 } else if (appImageDir != null) {
   235                 } else if (appImageDir != null) {
   236                     Log.info(MessageFormat.format(I18N.getString(
   236                     Log.info(MessageFormat.format(I18N.getString(
   237                             "mesasge.intermediate-bundle-location"),
   237                             "mesasge.intermediate-bundle-location"),
   238                             appImageDir.getAbsolutePath()));
   238                             appImageDir.getAbsolutePath()));
   239                 }
   239                 }
   240                 if (!StandardBundlerParam.ECHO_MODE.fetchFrom(p)) {
   240 
   241                     //cleanup
   241                 //cleanup
   242                     cleanupConfigFiles(p);
   242                 cleanupConfigFiles(p);
   243                 } else {
       
   244                     Log.info(MessageFormat.format(I18N.getString(
       
   245                             "message.config-save-location"),
       
   246                             CONFIG_ROOT.fetchFrom(p).getAbsolutePath()));
       
   247                 }
       
   248             } catch (IOException ex) {
   243             } catch (IOException ex) {
   249                 //noinspection ReturnInsideFinallyBlock
   244                 //noinspection ReturnInsideFinallyBlock
   250                 Log.debug(ex.getMessage());
   245                 Log.debug(ex.getMessage());
   251                 return null;
   246                 return null;
   252             }
   247             }
   253         }
   248         }
   254     }
   249     }
   255 
   250 
   256     protected void cleanupConfigFiles(Map<String, ? super Object> params) {
   251     protected void cleanupConfigFiles(Map<String, ? super Object> params) {
   257         if(!StandardBundlerParam.ECHO_MODE.fetchFrom(params)) {
   252         if (getConfig_Entitlements(params) != null) {
   258             if (getConfig_Entitlements(params) != null) {
   253             getConfig_Entitlements(params).delete();
   259                 getConfig_Entitlements(params).delete();
   254         }
   260             }
   255         if (getConfig_Inherit_Entitlements(params) != null) {
   261             if (getConfig_Inherit_Entitlements(params) != null) {
   256             getConfig_Inherit_Entitlements(params).delete();
   262                 getConfig_Inherit_Entitlements(params).delete();
   257         }
   263             }
   258         if (PREDEFINED_APP_IMAGE.fetchFrom(params) == null) {
   264             if (PREDEFINED_APP_IMAGE.fetchFrom(params) == null) {
   259             APP_BUNDLER.fetchFrom(params).cleanupConfigFiles(params);
   265                 APP_BUNDLER.fetchFrom(params).cleanupConfigFiles(params);
       
   266             }
       
   267         }
   260         }
   268     }
   261     }
   269 
   262 
   270     private File getConfig_Entitlements(Map<String, ? super Object> params) {
   263     private File getConfig_Entitlements(Map<String, ? super Object> params) {
   271         return new File(CONFIG_ROOT.fetchFrom(params),
   264         return new File(CONFIG_ROOT.fetchFrom(params),
   421     @Override
   414     @Override
   422     public File execute(Map<String, ? super Object> params,
   415     public File execute(Map<String, ? super Object> params,
   423             File outputParentDir) {
   416             File outputParentDir) {
   424         return bundle(params, outputParentDir);
   417         return bundle(params, outputParentDir);
   425     }
   418     }
   426     
   419 
   427     @Override    
   420     @Override
   428     public boolean supported() {
   421     public boolean supported() {
   429         return !Arguments.isJreInstaller() && 
   422         return !Arguments.isJreInstaller() &&
   430                 Platform.getPlatform() == Platform.MAC;
   423                 Platform.getPlatform() == Platform.MAC;
   431     }
   424     }
   432 }
   425 }