29 import java.util.HashMap; |
29 import java.util.HashMap; |
30 import java.util.Map; |
30 import java.util.Map; |
31 import java.io.File; |
31 import java.io.File; |
32 import jdk.packager.internal.Arguments.CLIOptions; |
32 import jdk.packager.internal.Arguments.CLIOptions; |
33 |
33 |
|
34 /* |
|
35 * SecondaryLauncherArguments |
|
36 * |
|
37 * Processes a secondary launcher properties file to create the Map of |
|
38 * bundle params applicable to the secondary launcher: |
|
39 * |
|
40 * BundlerParams p = (new SecondaryLauncherArguments(file)).getLauncherMap(); |
|
41 * |
|
42 * A secondary launcher is another executable program generated by either the |
|
43 * create-image mode or the create-installer mode. |
|
44 * The secondary launcher may be the same program with different configuration, |
|
45 * or a completely different program created from the same files. |
|
46 * |
|
47 * There may be multiple secondary launchers, each created by using the |
|
48 * command line arg "--secondary-launcher <file path> |
|
49 * |
|
50 * The secondary launcher properties file may have any of: |
|
51 * |
|
52 * name (required) |
|
53 * version |
|
54 * module |
|
55 * class |
|
56 * icon |
|
57 * arguments |
|
58 * jvm-args |
|
59 * win-menu |
|
60 * win-shortcut |
|
61 * win-console |
|
62 * |
|
63 */ |
34 public class SecondaryLauncherArguments { |
64 public class SecondaryLauncherArguments { |
35 |
65 |
36 private final String filename; |
66 private final String filename; |
37 private Map<String, String> allArgs; |
67 private Map<String, String> allArgs; |
38 private Map<String, ? super Object> bundleParams; |
68 private Map<String, ? super Object> bundleParams; |
66 putUnlessNull(bundleParams, Arguments.CLIOptions.NAME.getId(), |
96 putUnlessNull(bundleParams, Arguments.CLIOptions.NAME.getId(), |
67 getOptionValue(CLIOptions.NAME)); |
97 getOptionValue(CLIOptions.NAME)); |
68 putUnlessNull(bundleParams, Arguments.CLIOptions.VERSION.getId(), |
98 putUnlessNull(bundleParams, Arguments.CLIOptions.VERSION.getId(), |
69 getOptionValue(CLIOptions.VERSION)); |
99 getOptionValue(CLIOptions.VERSION)); |
70 |
100 |
71 // 4 boolean values: |
|
72 putUnlessNull(bundleParams, Arguments.CLIOptions.WIN_MENU_HINT.getId(), |
101 putUnlessNull(bundleParams, Arguments.CLIOptions.WIN_MENU_HINT.getId(), |
73 getOptionValue(CLIOptions.WIN_MENU_HINT)); |
102 getOptionValue(CLIOptions.WIN_MENU_HINT)); |
74 putUnlessNull(bundleParams, |
103 putUnlessNull(bundleParams, |
75 Arguments.CLIOptions.WIN_SHORTCUT_HINT.getId(), |
104 Arguments.CLIOptions.WIN_SHORTCUT_HINT.getId(), |
76 getOptionValue(CLIOptions.WIN_SHORTCUT_HINT)); |
105 getOptionValue(CLIOptions.WIN_SHORTCUT_HINT)); |
77 putUnlessNull(bundleParams, |
106 putUnlessNull(bundleParams, |
78 Arguments.CLIOptions.WIN_CONSOLE_HINT.getId(), |
107 Arguments.CLIOptions.WIN_CONSOLE_HINT.getId(), |
79 getOptionValue(CLIOptions.WIN_CONSOLE_HINT)); |
108 getOptionValue(CLIOptions.WIN_CONSOLE_HINT)); |
|
109 |
80 putUnlessNull(bundleParams, Arguments.CLIOptions.SINGLETON.getId(), |
110 putUnlessNull(bundleParams, Arguments.CLIOptions.SINGLETON.getId(), |
81 getOptionValue(CLIOptions.SINGLETON)); |
111 getOptionValue(CLIOptions.SINGLETON)); |
82 |
112 |
83 String value = getOptionValue(CLIOptions.ICON); |
113 String value = getOptionValue(CLIOptions.ICON); |
84 putUnlessNull(bundleParams, Arguments.CLIOptions.ICON.getId(), |
114 putUnlessNull(bundleParams, Arguments.CLIOptions.ICON.getId(), |