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

Customizing the Resources directory of an .app bundle with Javapackager

XMLWordPrintable

    • x86
    • os_x

      A DESCRIPTION OF THE REQUEST :
      On macOS, I am using *Javapackager* to make an `Application.app` bundle (called a *disk image*) from my `Application.jar` Java archive:

          javapackager \
            -deploy \
            -native image \
            -srcfiles Application.jar \
            -outdir dist \
            -outfile Application \
            -appclass Application

      The resulting `Application.app` bundle is a *directory* with the following layout:

          Application.app
          |--Contents
             |--Info.plist
             |--PkgInfo
             |--Java
             | |--Application.jar
             |--MacOS
             | |--Application
             |--Resources

      However I have some `<language>.lproj` directories (which hold `InfoPlist.strings` files for localizing some strings of the `Info.plist` file, cf. Apple's Developer [website](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html)) that I need to put in the `Resources` directory of the `Application.app` layout:

          Application.app
          |--Contents
             |--Info.plist
             |--PkgInfo
             |--Java
             | |--Application.jar
             |--MacOS
             | |--Application
             |--Resources
                |--en.lproj
                   |--InfoPlist.strings
                |--fr.lproj
                   |--InfoPlist.strings

      *Javapackager* does not seem to have a command-line option to do that (and I do not want to copy the `<language>.lproj` directories myself after the creation of the `Application.app` bundle as it would break its signature). It has only an option to write *icon* files in the `Resources` directory, (`-Bicon <path>`) but not other types of files or directories.

      So could you add a command-line option that allow to include files and directories into the `Resources` directory of .app bundles? I suggest `-resourcedir` and `-resourcefiles`.

      JUSTIFICATION :
      This feature is necessary as `<language>.lproj` directories which hold `InfoPlist.strings` files allow developers to localize some strings of the `Info.plist` file, cf. Apple's Developer [website](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html), such as the application name or copyright:

      > “In addition to the recommended keys, there are several keys that should be localized and placed in your language-specific InfoPlist.strings files:
      >
      > * CFBundleDisplayName;
      > * CFBundleName;
      > * CFBundleShortVersionString;
      > * NSHumanReadableCopyright.”


            asemenyuk Alexey Semenyuk
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: