author | herrick |
Wed, 09 Oct 2019 10:58:20 -0400 | |
branch | JDK-8200758-branch |
changeset 58538 | 12c965587689 |
parent 58114 | 42df7de58e39 |
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:
57071
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 |
*/ |
56982
e094d5483bd6
8212048: Cleanup source code and fix issues discussed in preliminary review
herrick
parents:
56933
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.ResourceBundle; |
57025 | 29 |
import java.io.File; |
30 |
import java.text.MessageFormat; |
|
31 |
||
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
32 |
|
56994
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
33 |
/** |
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
34 |
* CLIHelp |
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
35 |
* |
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
36 |
* Generate and show the command line interface help message(s). |
b4aca2dbe2b5
8212537: Create method and class description comments for main functionality
herrick
parents:
56982
diff
changeset
|
37 |
*/ |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
38 |
public class CLIHelp { |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
39 |
|
56869
41e17fe9fbeb
8208522: removed unreferenced class and minor formatting of java source
herrick
parents:
56821
diff
changeset
|
40 |
private static final ResourceBundle I18N = ResourceBundle.getBundle( |
57059 | 41 |
"jdk.jpackage.internal.resources.HelpResources"); |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
42 |
|
57039 | 43 |
// generates --help for jpackage's CLI |
57022
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
44 |
public static void showHelp(boolean noArgs) { |
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
45 |
|
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
46 |
if (noArgs) { |
57257 | 47 |
Log.info(I18N.getString("MSG_Help_no_args")); |
57022
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
48 |
} else { |
57776 | 49 |
Platform platform = (Log.isVerbose()) ? |
57257 | 50 |
Platform.UNKNOWN : Platform.getPlatform(); |
51 |
String types; |
|
52 |
String pLaunchOptions; |
|
53 |
String pInstallOptions; |
|
57283 | 54 |
String pInstallDir; |
57022
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
55 |
switch (platform) { |
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
56 |
case MAC: |
58114
42df7de58e39
8230519: jpackage "--package-type" values and default
herrick
parents:
57776
diff
changeset
|
57 |
types = "{\"app-image\", \"dmg\", \"pkg\"}"; |
57348
d3a667ff5579
JDK-8223189: Fix trailing whitespace and whitespace only file modification.
herrick
parents:
57286
diff
changeset
|
58 |
pLaunchOptions = I18N.getString("MSG_Help_mac_launcher"); |
57286
2ee6dedec44f
8221256: Fix create-installer specific options on MAC
herrick
parents:
57283
diff
changeset
|
59 |
pInstallOptions = ""; |
57283 | 60 |
pInstallDir |
61 |
= I18N.getString("MSG_Help_mac_linux_install_dir"); |
|
57022
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
62 |
break; |
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
63 |
case LINUX: |
58114
42df7de58e39
8230519: jpackage "--package-type" values and default
herrick
parents:
57776
diff
changeset
|
64 |
types = "{\"app-image\", \"rpm\", \"deb\"}"; |
57348
d3a667ff5579
JDK-8223189: Fix trailing whitespace and whitespace only file modification.
herrick
parents:
57286
diff
changeset
|
65 |
pLaunchOptions = ""; |
57257 | 66 |
pInstallOptions = I18N.getString("MSG_Help_linux_install"); |
57283 | 67 |
pInstallDir |
68 |
= I18N.getString("MSG_Help_mac_linux_install_dir"); |
|
57022
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
69 |
break; |
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
70 |
case WINDOWS: |
58114
42df7de58e39
8230519: jpackage "--package-type" values and default
herrick
parents:
57776
diff
changeset
|
71 |
types = "{\"app-image\", \"exe\", \"msi\"}"; |
57348
d3a667ff5579
JDK-8223189: Fix trailing whitespace and whitespace only file modification.
herrick
parents:
57286
diff
changeset
|
72 |
pLaunchOptions = I18N.getString("MSG_Help_win_launcher"); |
57257 | 73 |
pInstallOptions = I18N.getString("MSG_Help_win_install"); |
57283 | 74 |
pInstallDir |
75 |
= I18N.getString("MSG_Help_win_install_dir"); |
|
57257 | 76 |
break; |
77 |
default: |
|
58114
42df7de58e39
8230519: jpackage "--package-type" values and default
herrick
parents:
57776
diff
changeset
|
78 |
types = "{\"app-image\", \"exe\", \"msi\", \"rpm\", \"deb\", \"pkg\", \"dmg\"}"; |
57348
d3a667ff5579
JDK-8223189: Fix trailing whitespace and whitespace only file modification.
herrick
parents:
57286
diff
changeset
|
79 |
pLaunchOptions = I18N.getString("MSG_Help_win_launcher") |
d3a667ff5579
JDK-8223189: Fix trailing whitespace and whitespace only file modification.
herrick
parents:
57286
diff
changeset
|
80 |
+ I18N.getString("MSG_Help_mac_launcher"); |
57257 | 81 |
pInstallOptions = I18N.getString("MSG_Help_win_install") |
82 |
+ I18N.getString("MSG_Help_linux_install"); |
|
57283 | 83 |
pInstallDir |
84 |
= I18N.getString("MSG_Help_default_install_dir"); |
|
57022
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
85 |
break; |
81021f910bc2
8213333: Fix issues found in jpackager with automated tests
herrick
parents:
57017
diff
changeset
|
86 |
} |
57257 | 87 |
Log.info(MessageFormat.format(I18N.getString("MSG_Help"), |
88 |
File.pathSeparator, types, pLaunchOptions, |
|
57283 | 89 |
pInstallOptions, pInstallDir)); |
56821
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
90 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
91 |
} |
565d54ca1f41
8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff
changeset
|
92 |
} |