Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

andyherrick
Copy link

@andyherrick andyherrick commented Jul 8, 2021

JDK-8269387: jpackage --add-launcher should have option to not create shortcuts for additional launchers


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8269387: jpackage --add-launcher should have option to not create shortcuts for additional launchers

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 8, 2021

👋 Welcome back herrick! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@andyherrick andyherrick marked this pull request as draft July 8, 2021 19:28
@openjdk
Copy link

openjdk bot commented Jul 8, 2021

@andyherrick The following label will be automatically applied to this pull request:

  • core-libs

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.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Jul 8, 2021
@andyherrick andyherrick marked this pull request as ready for review July 8, 2021 20:08
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 8, 2021
@mlbridge
Copy link

mlbridge bot commented Jul 8, 2021

Webrevs

@kevinrushforth
Copy link
Member

This will need a CSR (so you or someone with a Reviewer role should indicate this with the /csr command).

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(),

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

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));
}
Copy link
Member

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.

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 {

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.
*/

/*

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.

Copy link
Member

@alexeysemenyukoracle alexeysemenyukoracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

@andyherrick
Copy link
Author

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jul 9, 2021
@openjdk
Copy link

openjdk bot commented Jul 9, 2021

@andyherrick has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@andyherrick please create a CSR request for issue JDK-8269387. This pull request cannot be integrated until the CSR request is approved.

public AdditionalLauncher setShortcuts(boolean menu, boolean desktop) {
public AdditionalLauncher setShortcuts(boolean menu, boolean shortcut) {
withMenuShortcut = menu;
withShortcut = shortcut;
if (TKit.isLinux()) {

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.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Jul 14, 2021
@openjdk
Copy link

openjdk bot commented Jul 14, 2021

@andyherrick This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8269387: jpackage --add-launcher should have option to not create shortcuts for additional launchers

Reviewed-by: asemenyuk, almatvee

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 master branch:

  • 7d0edb5: Merge
  • 7b4d84c: 8270422: Test build/AbsPathsInImage.java fails after JDK-8259848
  • 72db09b: 8266313: (JEP-356) - RandomGenerator spec implementation requirements tightly coupled to JDK internal classes
  • 3bbd233: 8270075: SplittableRandom extends AbstractSplittableGenerator
  • 381bd62: 8266889: [macosx-aarch64] Crash with SIGBUS in MarkActivationClosure::do_code_blob during vmTestbase/nsk/jvmti/.../bi04t002 test run
  • 82c256e: 8259499: Handling type arguments from outer classes for inner class in javadoc
  • e5db9a9: 8268620: InfiniteLoopException test may fail on x86 platforms
  • 67273ae: 8269865: Async UL needs to handle ERANGE on exceeding SEM_VALUE_MAX
  • 0f54707: 8270056: Generated lambda class can not access protected static method of target class
  • a033866: 8269637: javax/swing/JFileChooser/FileSystemView/SystemIconTest.java fails on windows
  • ... and 228 more: https://git.openjdk.java.net/jdk/compare/29bc381da517001251975b6d634c4f779ff1319a...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 14, 2021
@andyherrick
Copy link
Author

/integrate

@openjdk
Copy link

openjdk bot commented Jul 15, 2021

Going to push as commit 057992f.
Since your change was applied there have been 248 commits pushed to the master branch:

  • 746fe5d: 8270366: C2: Add associative rule to add/sub node
  • 1f995e5: 8265888: StandardJavaFileManager::setLocationForModule specification misses 'Implementation Requirements:'
  • c962e6e: 8261006: 'super' qualified method references cannot occur in a static context
  • 99d7f9a: 8264908: Investigate adding BOT range check in G1BlockOffsetTablePart::block_at_or_preceding
  • e92e2fd: 8270517: Add Zero support for LoongArch
  • 7a89ffe: 8270014: Add scoped objects for g1 young gc verification and young gc internal timing
  • 793d772: 8270475: Remove unused G1STWDrainQueueClosure
  • 1ebd946: 8270333: -XX:+VerifyStringTableAtExit should not do linear search
  • 04b73bc: 8269656: The test test/langtools/tools/javac/versions/Versions.java has duplicate test cycles
  • 7c23491: 8269598: Regressions up to 5% on aarch64 seems due to JDK-8268858
  • ... and 238 more: https://git.openjdk.java.net/jdk/compare/29bc381da517001251975b6d634c4f779ff1319a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 15, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 15, 2021
@openjdk
Copy link

openjdk bot commented Jul 15, 2021

@andyherrick Pushed as commit 057992f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@andyherrick andyherrick deleted the JDK-8269387 branch September 23, 2021 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
4 participants