< prev index next >
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java
Print this page
*** 45,55 ****
private static final ResourceBundle I18N = ResourceBundle.getBundle(
"jdk.jpackage.internal.resources.MacResources");
private static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns";
! private static Map<String, String> getMacCategories() {
Map<String, String> map = new HashMap<>();
map.put("Business", "public.app-category.business");
map.put("Developer Tools", "public.app-category.developer-tools");
map.put("Education", "public.app-category.education");
map.put("Entertainment", "public.app-category.entertainment");
--- 45,55 ----
private static final ResourceBundle I18N = ResourceBundle.getBundle(
"jdk.jpackage.internal.resources.MacResources");
private static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns";
! public static Map<String, String> getMacCategories() {
Map<String, String> map = new HashMap<>();
map.put("Business", "public.app-category.business");
map.put("Developer Tools", "public.app-category.developer-tools");
map.put("Education", "public.app-category.education");
map.put("Entertainment", "public.app-category.entertainment");
*** 95,138 ****
return map;
}
public static final EnumeratedBundlerParam<String> MAC_CATEGORY =
new EnumeratedBundlerParam<>(
- I18N.getString("param.category-name"),
- I18N.getString("param.category-name.description"),
Arguments.CLIOptions.MAC_APP_STORE_CATEGORY.getId(),
String.class,
! params -> params.containsKey(CATEGORY.getID())
! ? CATEGORY.fetchFrom(params)
! : "Unknown",
(s, p) -> s,
getMacCategories(),
false //strict - for MacStoreBundler this should be strict
);
public static final BundlerParamInfo<String> MAC_CF_BUNDLE_NAME =
new StandardBundlerParam<>(
- I18N.getString("param.cfbundle-name.name"),
- I18N.getString("param.cfbundle-name.description"),
Arguments.CLIOptions.MAC_BUNDLE_NAME.getId(),
String.class,
params -> null,
(s, p) -> s);
public static final BundlerParamInfo<String> MAC_CF_BUNDLE_IDENTIFIER =
new StandardBundlerParam<>(
- I18N.getString("param.cfbundle-identifier.name"),
- I18N.getString("param.cfbundle-identifier.description"),
Arguments.CLIOptions.MAC_BUNDLE_IDENTIFIER.getId(),
String.class,
IDENTIFIER::fetchFrom,
(s, p) -> s);
public static final BundlerParamInfo<String> MAC_CF_BUNDLE_VERSION =
new StandardBundlerParam<>(
- I18N.getString("param.cfbundle-version.name"),
- I18N.getString("param.cfbundle-version.description"),
"mac.CFBundleVersion",
String.class,
p -> {
String s = VERSION.fetchFrom(p);
if (validCFBundleVersion(s)) {
--- 95,128 ----
return map;
}
public static final EnumeratedBundlerParam<String> MAC_CATEGORY =
new EnumeratedBundlerParam<>(
Arguments.CLIOptions.MAC_APP_STORE_CATEGORY.getId(),
String.class,
! params -> "Unknown",
(s, p) -> s,
getMacCategories(),
false //strict - for MacStoreBundler this should be strict
);
public static final BundlerParamInfo<String> MAC_CF_BUNDLE_NAME =
new StandardBundlerParam<>(
Arguments.CLIOptions.MAC_BUNDLE_NAME.getId(),
String.class,
params -> null,
(s, p) -> s);
public static final BundlerParamInfo<String> MAC_CF_BUNDLE_IDENTIFIER =
new StandardBundlerParam<>(
Arguments.CLIOptions.MAC_BUNDLE_IDENTIFIER.getId(),
String.class,
IDENTIFIER::fetchFrom,
(s, p) -> s);
public static final BundlerParamInfo<String> MAC_CF_BUNDLE_VERSION =
new StandardBundlerParam<>(
"mac.CFBundleVersion",
String.class,
p -> {
String s = VERSION.fetchFrom(p);
if (validCFBundleVersion(s)) {
*** 143,163 ****
},
(s, p) -> s);
public static final BundlerParamInfo<String> DEFAULT_ICNS_ICON =
new StandardBundlerParam<>(
- I18N.getString("param.default-icon-icns"),
- I18N.getString("param.default-icon-icns.description"),
".mac.default.icns",
String.class,
params -> TEMPLATE_BUNDLE_ICON,
(s, p) -> s);
public static final BundlerParamInfo<String> DEVELOPER_ID_APP_SIGNING_KEY =
new StandardBundlerParam<>(
- I18N.getString("param.signing-key-developer-id-app.name"),
- I18N.getString("param.signing-key-developer-id-app.description"),
"mac.signing-key-developer-id-app",
String.class,
params -> {
String result = MacBaseInstallerBundler.findKey(
"Developer ID Application: "
--- 133,149 ----
*** 178,198 ****
},
(s, p) -> s);
public static final BundlerParamInfo<String> BUNDLE_ID_SIGNING_PREFIX =
new StandardBundlerParam<>(
- I18N.getString("param.bundle-id-signing-prefix.name"),
- I18N.getString("param.bundle-id-signing-prefix.description"),
Arguments.CLIOptions.MAC_BUNDLE_SIGNING_PREFIX.getId(),
String.class,
params -> IDENTIFIER.fetchFrom(params) + ".",
(s, p) -> s);
public static final BundlerParamInfo<File> ICON_ICNS =
new StandardBundlerParam<>(
- I18N.getString("param.icon-icns.name"),
- I18N.getString("param.icon-icns.description"),
"icon.icns",
File.class,
params -> {
File f = ICON.fetchFrom(params);
if (f != null && !f.getName().toLowerCase().endsWith(".icns")) {
--- 164,180 ----
*** 304,347 ****
return true;
}
File doBundle(Map<String, ? super Object> p, File outputDirectory,
boolean dependentTask) throws PackagerException {
! if (RUNTIME_INSTALLER.fetchFrom(p)) {
! return doJreBundle(p, outputDirectory, dependentTask);
} else {
return doAppBundle(p, outputDirectory, dependentTask);
}
}
- File doJreBundle(Map<String, ? super Object> p, File outputDirectory,
- boolean dependentTask) throws PackagerException {
- try {
- File rootDirectory = createRoot(p, outputDirectory, dependentTask,
- APP_NAME.fetchFrom(p), "macapp-image-builder");
- AbstractAppImageBuilder appBuilder = new MacAppImageBuilder(p,
- APP_NAME.fetchFrom(p), outputDirectory.toPath());
- File predefined = PREDEFINED_RUNTIME_IMAGE.fetchFrom(p);
- if (predefined == null ) {
- JLinkBundlerHelper.generateJre(p, appBuilder);
- } else {
- return predefined;
- }
- return rootDirectory;
- } catch (PackagerException pe) {
- throw pe;
- } catch (Exception ex) {
- Log.verbose(ex);
- throw new PackagerException(ex);
- }
- }
-
File doAppBundle(Map<String, ? super Object> p, File outputDirectory,
boolean dependentTask) throws PackagerException {
try {
File rootDirectory = createRoot(p, outputDirectory, dependentTask,
! APP_NAME.fetchFrom(p) + ".app", "macapp-image-builder");
AbstractAppImageBuilder appBuilder =
new MacAppImageBuilder(p, outputDirectory.toPath());
if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) {
JLinkBundlerHelper.execute(p, appBuilder);
} else {
--- 286,307 ----
return true;
}
File doBundle(Map<String, ? super Object> p, File outputDirectory,
boolean dependentTask) throws PackagerException {
! if (StandardBundlerParam.isRuntimeInstaller(p)) {
! return PREDEFINED_RUNTIME_IMAGE.fetchFrom(p);
} else {
return doAppBundle(p, outputDirectory, dependentTask);
}
}
File doAppBundle(Map<String, ? super Object> p, File outputDirectory,
boolean dependentTask) throws PackagerException {
try {
File rootDirectory = createRoot(p, outputDirectory, dependentTask,
! APP_NAME.fetchFrom(p) + ".app");
AbstractAppImageBuilder appBuilder =
new MacAppImageBuilder(p, outputDirectory.toPath());
if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(p) == null ) {
JLinkBundlerHelper.execute(p, appBuilder);
} else {
< prev index next >