< prev index next >

src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java

Print this page

        

*** 38,57 **** * bundle params applicable to the add-launcher: * * BundlerParams p = (new AddLauncherArguments(file)).getLauncherMap(); * * A add-launcher is another executable program generated by either the ! * create-image mode or the create-installer mode. * The add-launcher may be the same program with different configuration, * or a completely different program created from the same files. * * There may be multiple add-launchers, each created by using the * command line arg "--add-launcher <file path> * * The add-launcher properties file may have any of: * - * name (required) * appVersion * module * add-modules * main-jar * main-class --- 38,56 ---- * bundle params applicable to the add-launcher: * * BundlerParams p = (new AddLauncherArguments(file)).getLauncherMap(); * * A add-launcher is another executable program generated by either the ! * create-app-image mode or the create-installer mode. * The add-launcher may be the same program with different configuration, * or a completely different program created from the same files. * * There may be multiple add-launchers, each created by using the * command line arg "--add-launcher <file path> * * The add-launcher properties file may have any of: * * appVersion * module * add-modules * main-jar * main-class
*** 61,119 **** * win-console * */ class AddLauncherArguments { private final String filename; private Map<String, String> allArgs; private Map<String, ? super Object> bundleParams; ! AddLauncherArguments(String filename) { this.filename = filename; } private void initLauncherMap() { if (bundleParams != null) { return; } allArgs = Arguments.getPropertiesFromFile(filename); bundleParams = new HashMap<>(); String mainJar = getOptionValue(CLIOptions.MAIN_JAR); String mainClass = getOptionValue(CLIOptions.APPCLASS); String module = getOptionValue(CLIOptions.MODULE); if (module != null && mainClass != null) { ! putUnlessNull(bundleParams, Arguments.CLIOptions.MODULE.getId(), module + "/" + mainClass); } else if (module != null) { ! putUnlessNull(bundleParams, Arguments.CLIOptions.MODULE.getId(), module); } else { ! putUnlessNull(bundleParams, Arguments.CLIOptions.MAIN_JAR.getId(), mainJar); ! putUnlessNull(bundleParams, Arguments.CLIOptions.APPCLASS.getId(), mainClass); } ! putUnlessNull(bundleParams, Arguments.CLIOptions.NAME.getId(), getOptionValue(CLIOptions.NAME)); ! putUnlessNull(bundleParams, Arguments.CLIOptions.VERSION.getId(), getOptionValue(CLIOptions.VERSION)); putUnlessNull(bundleParams, ! Arguments.CLIOptions.ADD_MODULES.getId(), getOptionValue(CLIOptions.ADD_MODULES)); putUnlessNull(bundleParams, ! Arguments.CLIOptions.WIN_CONSOLE_HINT.getId(), getOptionValue(CLIOptions.WIN_CONSOLE_HINT)); String value = getOptionValue(CLIOptions.ICON); ! putUnlessNull(bundleParams, Arguments.CLIOptions.ICON.getId(), (value == null) ? null : new File(value)); String argumentStr = getOptionValue(CLIOptions.ARGUMENTS); putUnlessNullOrEmpty(bundleParams, CLIOptions.ARGUMENTS.getId(), --- 60,121 ---- * win-console * */ class AddLauncherArguments { + private final String name; private final String filename; private Map<String, String> allArgs; private Map<String, ? super Object> bundleParams; ! AddLauncherArguments(String name, String filename) { ! this.name = name; this.filename = filename; } private void initLauncherMap() { if (bundleParams != null) { return; } allArgs = Arguments.getPropertiesFromFile(filename); + allArgs.put(CLIOptions.NAME.getId(), name); bundleParams = new HashMap<>(); String mainJar = getOptionValue(CLIOptions.MAIN_JAR); String mainClass = getOptionValue(CLIOptions.APPCLASS); String module = getOptionValue(CLIOptions.MODULE); if (module != null && mainClass != null) { ! putUnlessNull(bundleParams, CLIOptions.MODULE.getId(), module + "/" + mainClass); } else if (module != null) { ! putUnlessNull(bundleParams, CLIOptions.MODULE.getId(), module); } else { ! putUnlessNull(bundleParams, CLIOptions.MAIN_JAR.getId(), mainJar); ! putUnlessNull(bundleParams, CLIOptions.APPCLASS.getId(), mainClass); } ! putUnlessNull(bundleParams, CLIOptions.NAME.getId(), getOptionValue(CLIOptions.NAME)); ! putUnlessNull(bundleParams, CLIOptions.VERSION.getId(), getOptionValue(CLIOptions.VERSION)); putUnlessNull(bundleParams, ! CLIOptions.ADD_MODULES.getId(), getOptionValue(CLIOptions.ADD_MODULES)); putUnlessNull(bundleParams, ! CLIOptions.WIN_CONSOLE_HINT.getId(), getOptionValue(CLIOptions.WIN_CONSOLE_HINT)); String value = getOptionValue(CLIOptions.ICON); ! putUnlessNull(bundleParams, CLIOptions.ICON.getId(), (value == null) ? null : new File(value)); String argumentStr = getOptionValue(CLIOptions.ARGUMENTS); putUnlessNullOrEmpty(bundleParams, CLIOptions.ARGUMENTS.getId(),
< prev index next >