author | herrick |
Thu, 12 Sep 2019 10:46:10 -0400 | |
branch | JDK-8200758-branch |
changeset 58116 | 93b8c1305de2 |
parent 57909 | c7de06ed4b54 |
child 58304 | 7a61351edad2 |
permissions | -rw-r--r-- |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
1 |
/* |
57106
ea870b9ce89a
8216492: Update copyright of all new jpackage fils to 2019
kcr
parents:
57099
diff
changeset
|
2 |
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
4 |
* |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
10 |
* |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
15 |
* accompanied this code). |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
16 |
* |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
20 |
* |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
23 |
* questions. |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
24 |
*/ |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
25 |
|
57039 | 26 |
package jdk.jpackage.internal; |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
27 |
|
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
28 |
import java.util.Collection; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
29 |
import java.util.HashMap; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
30 |
import java.util.Map; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
31 |
import java.io.File; |
57039 | 32 |
import jdk.jpackage.internal.Arguments.CLIOptions; |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
33 |
|
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
34 |
/* |
57256 | 35 |
* AddLauncherArguments |
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
36 |
* |
57256 | 37 |
* Processes a add-launcher properties file to create the Map of |
38 |
* bundle params applicable to the add-launcher: |
|
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
39 |
* |
57256 | 40 |
* BundlerParams p = (new AddLauncherArguments(file)).getLauncherMap(); |
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
41 |
* |
57256 | 42 |
* A add-launcher is another executable program generated by either the |
57307 | 43 |
* create-app-image mode or the create-installer mode. |
57256 | 44 |
* The add-launcher may be the same program with different configuration, |
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
45 |
* or a completely different program created from the same files. |
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
46 |
* |
57256 | 47 |
* There may be multiple add-launchers, each created by using the |
48 |
* command line arg "--add-launcher <file path> |
|
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
49 |
* |
57256 | 50 |
* The add-launcher properties file may have any of: |
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
51 |
* |
57256 | 52 |
* appVersion |
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
53 |
* module |
57256 | 54 |
* main-jar |
55 |
* main-class |
|
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
56 |
* icon |
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
57 |
* arguments |
57291 | 58 |
* java-options |
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
59 |
* win-console |
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
60 |
* |
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
61 |
*/ |
57256 | 62 |
class AddLauncherArguments { |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
63 |
|
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
64 |
private final String name; |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
65 |
private final String filename; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
66 |
private Map<String, String> allArgs; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
67 |
private Map<String, ? super Object> bundleParams; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
68 |
|
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
69 |
AddLauncherArguments(String name, String filename) { |
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
70 |
this.name = name; |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
71 |
this.filename = filename; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
72 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
73 |
|
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
74 |
private void initLauncherMap() { |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
75 |
if (bundleParams != null) { |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
76 |
return; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
77 |
} |
56957
2f01969ed7cb
8211299: Output of System.out is not printed to CMD on Windows
herrick
parents:
56933
diff
changeset
|
78 |
|
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
79 |
allArgs = Arguments.getPropertiesFromFile(filename); |
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
80 |
allArgs.put(CLIOptions.NAME.getId(), name); |
56957
2f01969ed7cb
8211299: Output of System.out is not printed to CMD on Windows
herrick
parents:
56933
diff
changeset
|
81 |
|
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
82 |
bundleParams = new HashMap<>(); |
57256 | 83 |
String mainJar = getOptionValue(CLIOptions.MAIN_JAR); |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
84 |
String mainClass = getOptionValue(CLIOptions.APPCLASS); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
85 |
String module = getOptionValue(CLIOptions.MODULE); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
86 |
|
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
87 |
if (module != null && mainClass != null) { |
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
88 |
putUnlessNull(bundleParams, CLIOptions.MODULE.getId(), |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
89 |
module + "/" + mainClass); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
90 |
} else if (module != null) { |
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
91 |
putUnlessNull(bundleParams, CLIOptions.MODULE.getId(), |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
92 |
module); |
57256 | 93 |
} else { |
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
94 |
putUnlessNull(bundleParams, CLIOptions.MAIN_JAR.getId(), |
57256 | 95 |
mainJar); |
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
96 |
putUnlessNull(bundleParams, CLIOptions.APPCLASS.getId(), |
56957
2f01969ed7cb
8211299: Output of System.out is not printed to CMD on Windows
herrick
parents:
56933
diff
changeset
|
97 |
mainClass); |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
98 |
} |
56957
2f01969ed7cb
8211299: Output of System.out is not printed to CMD on Windows
herrick
parents:
56933
diff
changeset
|
99 |
|
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
100 |
putUnlessNull(bundleParams, CLIOptions.NAME.getId(), |
56869
41e17fe9fbeb
8208522: removed unreferenced class and minor formatting of java source
herrick
parents:
56849
diff
changeset
|
101 |
getOptionValue(CLIOptions.NAME)); |
57256 | 102 |
|
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
103 |
putUnlessNull(bundleParams, CLIOptions.VERSION.getId(), |
56869
41e17fe9fbeb
8208522: removed unreferenced class and minor formatting of java source
herrick
parents:
56849
diff
changeset
|
104 |
getOptionValue(CLIOptions.VERSION)); |
56957
2f01969ed7cb
8211299: Output of System.out is not printed to CMD on Windows
herrick
parents:
56933
diff
changeset
|
105 |
|
57741
38856ef4a19c
8229138: Add --linux-app-release option for DEB and RPM packages
herrick
parents:
57438
diff
changeset
|
106 |
putUnlessNull(bundleParams, CLIOptions.RELEASE.getId(), |
38856ef4a19c
8229138: Add --linux-app-release option for DEB and RPM packages
herrick
parents:
57438
diff
changeset
|
107 |
getOptionValue(CLIOptions.RELEASE)); |
38856ef4a19c
8229138: Add --linux-app-release option for DEB and RPM packages
herrick
parents:
57438
diff
changeset
|
108 |
|
57790 | 109 |
putUnlessNull(bundleParams, CLIOptions.LINUX_CATEGORY.getId(), |
110 |
getOptionValue(CLIOptions.LINUX_CATEGORY)); |
|
57909
c7de06ed4b54
8229979: jpackage cleanup src files, help text, and javadoc
herrick
parents:
57807
diff
changeset
|
111 |
|
57807
4a15115716ea
8215381: Investigate if current implementation of --license-file is correct for Debian packages
herrick
parents:
57790
diff
changeset
|
112 |
putUnlessNull(bundleParams, CLIOptions.LINUX_DEB_COPYRIGHT_FILE.getId(), |
4a15115716ea
8215381: Investigate if current implementation of --license-file is correct for Debian packages
herrick
parents:
57790
diff
changeset
|
113 |
getOptionValue(CLIOptions.LINUX_DEB_COPYRIGHT_FILE)); |
57790 | 114 |
|
56869
41e17fe9fbeb
8208522: removed unreferenced class and minor formatting of java source
herrick
parents:
56849
diff
changeset
|
115 |
putUnlessNull(bundleParams, |
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
116 |
CLIOptions.WIN_CONSOLE_HINT.getId(), |
56957
2f01969ed7cb
8211299: Output of System.out is not printed to CMD on Windows
herrick
parents:
56933
diff
changeset
|
117 |
getOptionValue(CLIOptions.WIN_CONSOLE_HINT)); |
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
118 |
|
56849
16c34c7b4147
8208579: [jpackager] --secondary-launcher arg fails when properties file has no icon
herrick
parents:
56821
diff
changeset
|
119 |
String value = getOptionValue(CLIOptions.ICON); |
57330
a30edd277572
8222733: Modify jpackage option --add-launcher synta
herrick
parents:
57307
diff
changeset
|
120 |
putUnlessNull(bundleParams, CLIOptions.ICON.getId(), |
56869
41e17fe9fbeb
8208522: removed unreferenced class and minor formatting of java source
herrick
parents:
56849
diff
changeset
|
121 |
(value == null) ? null : new File(value)); |
56957
2f01969ed7cb
8211299: Output of System.out is not printed to CMD on Windows
herrick
parents:
56933
diff
changeset
|
122 |
|
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
123 |
String argumentStr = getOptionValue(CLIOptions.ARGUMENTS); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
124 |
putUnlessNullOrEmpty(bundleParams, |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
125 |
CLIOptions.ARGUMENTS.getId(), |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
126 |
Arguments.getArgumentList(argumentStr)); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
127 |
|
57291 | 128 |
String jvmargsStr = getOptionValue(CLIOptions.JAVA_OPTIONS); |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
129 |
putUnlessNullOrEmpty(bundleParams, |
57291 | 130 |
CLIOptions.JAVA_OPTIONS.getId(), |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
131 |
Arguments.getArgumentList(jvmargsStr)); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
132 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
133 |
|
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
134 |
private String getOptionValue(CLIOptions option) { |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
135 |
if (option == null || allArgs == null) { |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
136 |
return null; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
137 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
138 |
|
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
139 |
String id = option.getId(); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
140 |
|
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
141 |
if (allArgs.containsKey(id)) { |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
142 |
return allArgs.get(id); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
143 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
144 |
|
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
145 |
return null; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
146 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
147 |
|
57067
9c17d779808e
8213425: Analyze output from Source code scanner and fix where needed.
herrick
parents:
57039
diff
changeset
|
148 |
Map<String, ? super Object> getLauncherMap() { |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
149 |
initLauncherMap(); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
150 |
return bundleParams; |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
151 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
152 |
|
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
153 |
private void putUnlessNull(Map<String, ? super Object> params, |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
154 |
String param, Object value) { |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
155 |
if (value != null) { |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
156 |
params.put(param, value); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
157 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
158 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
159 |
|
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
160 |
private void putUnlessNullOrEmpty(Map<String, ? super Object> params, |
57015
5d2008115309
JDK-8213244: Fix all warnings in jpackager java code
herrick
parents:
56994
diff
changeset
|
161 |
String param, Collection<?> value) { |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
162 |
if (value != null && !value.isEmpty()) { |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
163 |
params.put(param, value); |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
164 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
165 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
166 |
|
57259
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
167 |
static Map<String, ? super Object> merge( |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
168 |
Map<String, ? super Object> original, |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
169 |
Map<String, ? super Object> additional) { |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
170 |
Map<String, ? super Object> tmp = new HashMap<>(original); |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
171 |
if (additional.containsKey("module")) { |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
172 |
tmp.remove("main-jar"); |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
173 |
tmp.remove("main-class"); |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
174 |
} else if (additional.containsKey("main-jar")) { |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
175 |
tmp.remove("module"); |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
176 |
} |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
177 |
tmp.putAll(additional); |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
178 |
return tmp; |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
179 |
} |
a84c657c713d
8171959: add-launcher is not working when normal jar is used for first launcher and module is used for second launcher
herrick
parents:
57256
diff
changeset
|
180 |
|
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
181 |
} |