Move validation of the value of the "--mac-package-identifier" option to the 
"cli" package.

If the user supplies an invalid bundle identifier value on the command line, 
jpackage will issue error:

Error: The value "foo_bar" provided for parameter --mac-package-identifier is 
not a valid macOS bundle identifier.
Advice to fix: Bundle identifier must be a non-empty string containing only 
alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).

instead of:

Error: Invalid mac bundle identifier [foo_bar].
Advice to fix: specify identifier with "--mac-package-identifier".


If  "--mac-package-identifier" option is not specified and jpackage fails to 
derive a valid bundle identifier from the input data, it will issue the 
following error:

Error: Can't derive a valid bundle identifier from the input data
Advice to fix: Specify bundle identifier with --mac-package-identifier option


Added corresponding unit tests.

Updated MacPropertiesTest test to cover the case when the value of the bundle 
identifier is not specified on the command line.

-------------

Commit messages:
 - 8371182: [macos] Improve error messages for "invalid mac bundle identifier"

Changes: https://git.openjdk.org/jdk/pull/30413/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30413&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8371182
  Stats: 494 lines in 15 files changed: 416 ins; 32 del; 46 mod
  Patch: https://git.openjdk.org/jdk/pull/30413.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30413/head:pull/30413

PR: https://git.openjdk.org/jdk/pull/30413

Reply via email to