238 return true; |
238 return true; |
239 } |
239 } |
240 |
240 |
241 @Override |
241 @Override |
242 public boolean validate(Map<String, ? super Object> params) |
242 public boolean validate(Map<String, ? super Object> params) |
243 throws UnsupportedPlatformException, ConfigException { |
243 throws ConfigException { |
244 try { |
244 try { |
245 return doValidate(params); |
245 return doValidate(params); |
246 } catch (RuntimeException re) { |
246 } catch (RuntimeException re) { |
247 if (re.getCause() instanceof ConfigException) { |
247 if (re.getCause() instanceof ConfigException) { |
248 throw (ConfigException) re.getCause(); |
248 throw (ConfigException) re.getCause(); |
251 } |
251 } |
252 } |
252 } |
253 } |
253 } |
254 |
254 |
255 private boolean doValidate(Map<String, ? super Object> params) |
255 private boolean doValidate(Map<String, ? super Object> params) |
256 throws UnsupportedPlatformException, ConfigException { |
256 throws ConfigException { |
257 if (Platform.getPlatform() != Platform.MAC) { |
|
258 throw new UnsupportedPlatformException(); |
|
259 } |
|
260 |
257 |
261 imageBundleValidation(params); |
258 imageBundleValidation(params); |
262 |
259 |
263 if (StandardBundlerParam.getPredefinedAppImage(params) != null) { |
260 if (StandardBundlerParam.getPredefinedAppImage(params) != null) { |
264 return true; |
261 return true; |
325 public String getName() { |
322 public String getName() { |
326 return I18N.getString("app.bundler.name"); |
323 return I18N.getString("app.bundler.name"); |
327 } |
324 } |
328 |
325 |
329 @Override |
326 @Override |
330 public String getDescription() { |
|
331 return I18N.getString("app.bundler.description"); |
|
332 } |
|
333 |
|
334 @Override |
|
335 public String getID() { |
327 public String getID() { |
336 return "mac.app"; |
328 return "mac.app"; |
337 } |
329 } |
338 |
330 |
339 @Override |
331 @Override |
340 public String getBundleType() { |
332 public String getBundleType() { |
341 return "IMAGE"; |
333 return "IMAGE"; |
342 } |
334 } |
343 |
|
344 @Override |
|
345 public Collection<BundlerParamInfo<?>> getBundleParameters() { |
|
346 return getAppBundleParameters(); |
|
347 } |
|
348 |
|
349 public static Collection<BundlerParamInfo<?>> getAppBundleParameters() { |
|
350 return Arrays.asList( |
|
351 APP_NAME, |
|
352 APP_RESOURCES, |
|
353 ARGUMENTS, |
|
354 BUNDLE_ID_SIGNING_PREFIX, |
|
355 CLASSPATH, |
|
356 DEVELOPER_ID_APP_SIGNING_KEY, |
|
357 ICON_ICNS, |
|
358 JAVA_OPTIONS, |
|
359 MAC_CATEGORY, |
|
360 MAC_CF_BUNDLE_IDENTIFIER, |
|
361 MAC_CF_BUNDLE_NAME, |
|
362 MAC_CF_BUNDLE_VERSION, |
|
363 MAIN_CLASS, |
|
364 MAIN_JAR, |
|
365 SIGNING_KEYCHAIN, |
|
366 VERSION, |
|
367 VERBOSE |
|
368 ); |
|
369 } |
|
370 |
|
371 |
335 |
372 @Override |
336 @Override |
373 public File execute(Map<String, ? super Object> params, |
337 public File execute(Map<String, ? super Object> params, |
374 File outputParentDir) throws PackagerException { |
338 File outputParentDir) throws PackagerException { |
375 return doBundle(params, outputParentDir, false); |
339 return doBundle(params, outputParentDir, false); |
376 } |
340 } |
377 |
341 |
378 @Override |
342 @Override |
379 public boolean supported(boolean runtimeInstaller) { |
343 public boolean supported(boolean runtimeInstaller) { |
380 return Platform.getPlatform() == Platform.MAC; |
344 return true; |
381 } |
345 } |
382 |
346 |
383 } |
347 } |