Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8342544

[macos] jpackage test helper should check for both "--app-image" and "--mac-sign" for signing predefined app image case

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 20
    • tools
    • b23
    • generic
    • generic

      The fragment of JPackageCommand.outputBundle() function at https://github.com/openjdk/jdk/blame/236c71cad9fa269518456c11edcfb353bbfc084d/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java#L402 is as follows:

      /**
           * Returns path to output bundle of configured jpackage command.
           *
           * If this is build image command, returns path to application image directory.
           *
           * Special case for masOS. If this is sign app image command, returns value
           * of "--app-image".
           */
          public Path outputBundle() {
              final String bundleName;
              if (isImagePackageType()) {
                  if (TKit.isOSX() && hasArgument("--app-image")) {
                      return Path.of(getArgumentValue("--app-image", () -> null));
                  }
                  ...

      The javadoc states that if jpackage signs an app image on OSX, the function should return the value of the "--app-image" parameter.

      However, the code does not check for the presence of the "--mac-sign" parameter. Instead, it tests for the "--app-image" parameter. Is this a typo?

      The changes to JPackageCommand.outputBundle() function were introduced in JDK-8293462 patch.

      Should it be like this:
      ---
      if (TKit.isOSX() && hasArgument("--mac-sign")) {
        return getArgumentValue("--app-image", () -> null, Path::of);
      }
      ---
      ?

            almatvee Alexander Matveev
            asemenyuk Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: