New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDK-8269387: jpackage --add-launcher should have option to not create shortcuts for additional launchers #4730
Conversation
… shortcuts for additional launchers
|
@andyherrick The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
… shortcuts for additional launchers
… shortcuts for additional launchers
… shortcuts for additional launchers
Webrevs
|
This will need a CSR (so you or someone with a Reviewer role should indicate this with the Also, can you summarize the changes in this PR, including the added command line options? |
@@ -120,6 +122,15 @@ private void initLauncherMap() { | |||
Arguments.putUnlessNull(bundleParams, CLIOptions.ICON.getId(), | |||
(value == null) ? null : Path.of(value)); | |||
|
|||
Arguments.putUnlessNull(bundleParams, SHORTCUT_HINT.getID(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to add platform-specific options only if jpackage runs on that platform:
if (Platform.isWindows()) {
Arguments.putUnlessNull(bundleParams, SHORTCUT_HINT.getID(), getOptionValue(CLIOptions.WIN_SHORTCUT_HINT));
Arguments.putUnlessNull(bundleParams, MENU_HINT.getID(), getOptionValue(CLIOptions.WIN_MENU_HINT));
}
if (Platform.isLinux()) {
Arguments.putUnlessNull(bundleParams, SHORTCUT_HINT.getID(), getOptionValue(CLIOptions.LINUX_SHORTCUT_HINT));
}
@@ -32,6 +32,8 @@ | |||
import jdk.jpackage.internal.Arguments.CLIOptions; | |||
import static jdk.jpackage.internal.StandardBundlerParam.LAUNCHER_DATA; | |||
import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; | |||
import static jdk.jpackage.internal.StandardBundlerParam.MENU_HINT; | |||
import static jdk.jpackage.internal.StandardBundlerParam.SHORTCUT_HINT; | |||
|
|||
/* | |||
* AddLauncherArguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class comment needs to be updated. Currently it says:
* The add-launcher properties file may have any of:
*
* appVersion
* module
* main-jar
* main-class
* icon
* arguments
* java-options
* win-console
* linux-app-category
List<String> names = new ArrayList<>(); | ||
names.add(APP_NAME.fetchFrom(params)); | ||
ADD_LAUNCHERS.fetchFrom(params).stream().map(APP_NAME::fetchFrom).forEach( | ||
launchers::add); | ||
names::add); | ||
for (var name : names) { | ||
launchers.add(new LauncherInfo(name, true, true)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of code can be simplified down to:
ADD_LAUNCHERS.fetchFrom(params).stream().map(APP_NAME::fetchFrom).map(name -> new LauncherInfo(name, true, true)).forEach(launchers::add);
No need in intermediate names
list.
@@ -0,0 +1,131 @@ | |||
/* | |||
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright year should be 2021
* --jpt-run=AddLShortcutTest | ||
*/ | ||
|
||
public class AddLShortcutTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the test tests shortcuts?
* SimplePackageTest.java) plus install three extra application launchers. | ||
*/ | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need two jtreg @test-s if there is only one test method in the test class? They are 100% duplicates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
/csr |
@andyherrick has indicated that a compatibility and specification (CSR) request is needed for this pull request. |
… shortcuts for additional launchers
test/jdk/tools/jpackage/helpers/jdk/jpackage/test/AdditionalLauncher.java
Outdated
Show resolved
Hide resolved
… shortcuts for additional launchers
public AdditionalLauncher setShortcuts(boolean menu, boolean desktop) { | ||
public AdditionalLauncher setShortcuts(boolean menu, boolean shortcut) { | ||
withMenuShortcut = menu; | ||
withShortcut = shortcut; | ||
if (TKit.isLinux()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move add addRawProperties()
calls to initialize()
method. This will prevent multiple addRawProperties()
calls for "linux-shortcut" and "win-shortcut" properties in case setShortcuts()
method is called multiple times.
… shortcuts for additional launchers
@andyherrick This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 238 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
/integrate |
Going to push as commit 057992f.
Your commit was automatically rebased without conflicts. |
@andyherrick Pushed as commit 057992f. |
JDK-8269387: jpackage --add-launcher should have option to not create shortcuts for additional launchers
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4730/head:pull/4730
$ git checkout pull/4730
Update a local copy of the PR:
$ git checkout pull/4730
$ git pull https://git.openjdk.java.net/jdk pull/4730/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4730
View PR using the GUI difftool:
$ git pr show -t 4730
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4730.diff