124 String.class, |
124 String.class, |
125 params -> "-MacAppStore", |
125 params -> "-MacAppStore", |
126 (s, p) -> s); |
126 (s, p) -> s); |
127 |
127 |
128 //@Override |
128 //@Override |
129 public File bundle(Map<String, ? super Object> p, File outdir) { |
129 public File bundle(Map<String, ? super Object> p, |
|
130 File outdir) throws PackagerException { |
130 Log.verbose(MessageFormat.format(I18N.getString( |
131 Log.verbose(MessageFormat.format(I18N.getString( |
131 "message.building-bundle"), APP_NAME.fetchFrom(p))); |
132 "message.building-bundle"), APP_NAME.fetchFrom(p))); |
132 if (!outdir.isDirectory() && !outdir.mkdirs()) { |
133 if (!outdir.isDirectory() && !outdir.mkdirs()) { |
133 throw new RuntimeException(MessageFormat.format(I18N.getString( |
134 throw new PackagerException( |
134 "error.cannot-create-output-dir"), |
135 "error.cannot-create-output-dir", |
135 outdir.getAbsolutePath())); |
136 outdir.getAbsolutePath()); |
136 } |
137 } |
137 if (!outdir.canWrite()) { |
138 if (!outdir.canWrite()) { |
138 throw new RuntimeException(MessageFormat.format(I18N.getString( |
139 throw new PackagerException( |
139 "error.cannot-write-to-output-dir"), |
140 "error.cannot-write-to-output-dir", |
140 outdir.getAbsolutePath())); |
141 outdir.getAbsolutePath()); |
141 } |
142 } |
142 |
143 |
143 // first, load in some overrides |
144 // first, load in some overrides |
144 // icns needs @2 versions, so load in the @2 default |
145 // icns needs @2 versions, so load in the @2 default |
145 p.put(DEFAULT_ICNS_ICON.getID(), TEMPLATE_BUNDLE_ICON_HIDPI); |
146 p.put(DEFAULT_ICNS_ICON.getID(), TEMPLATE_BUNDLE_ICON_HIDPI); |
200 |
201 |
201 pb = new ProcessBuilder(buildOptions); |
202 pb = new ProcessBuilder(buildOptions); |
202 |
203 |
203 IOUtils.exec(pb, false); |
204 IOUtils.exec(pb, false); |
204 return finalPKG; |
205 return finalPKG; |
|
206 } catch (PackagerException pe) { |
|
207 throw pe; |
205 } catch (Exception ex) { |
208 } catch (Exception ex) { |
206 Log.error("App Store Ready Bundle failed : " + ex.getMessage()); |
|
207 Log.verbose(ex); |
209 Log.verbose(ex); |
208 return null; |
210 throw new PackagerException(ex); |
209 } |
211 } |
210 } |
212 } |
211 |
213 |
212 private File getConfig_Entitlements(Map<String, ? super Object> params) { |
214 private File getConfig_Entitlements(Map<String, ? super Object> params) { |
213 return new File(CONFIG_ROOT.fetchFrom(params), |
215 return new File(CONFIG_ROOT.fetchFrom(params), |
359 } |
361 } |
360 } |
362 } |
361 |
363 |
362 @Override |
364 @Override |
363 public File execute(Map<String, ? super Object> params, |
365 public File execute(Map<String, ? super Object> params, |
364 File outputParentDir) { |
366 File outputParentDir) throws PackagerException { |
365 return bundle(params, outputParentDir); |
367 return bundle(params, outputParentDir); |
366 } |
368 } |
367 |
369 |
368 @Override |
370 @Override |
369 public boolean supported() { |
371 public boolean supported() { |