Qt command-line options for blackberry-nativepackager

The blackberry-nativepackager command line must name the BAR file, app descriptor file, and Qt binary. The packaging tool allows you to list other files to include in the package and supports many command-line options for Qt apps.

Syntax:

blackberry-nativepackager [<commands>] [<options>] bar-package app-descriptor binary-file [resource-file]* 

Commands:

-package
Package the assets into an unsigned BAR file (this is the default behavior).
-list
List all the files in the resulting package. This is useful for debugging packaging issues.
-listManifest
Print the BAR manifest. This is useful for debugging.

Packaging options:

-buildId ID
Set the build ID (which is the fourth segment of the version). Must be a number from 0 to 65535.
-buildIdFile file
Set the build ID from an existing file and save a new, incremented version to the same file.
-devMode
Package the BAR file in development mode. This is required to run unsigned applications and to access application data remotely.

Path options:

-C dir
Use dir as a root directory. All files listed after this option will be used with tail paths in the output package.
-e file path
Save a file to the specified path in the package.

Other options:

-version
Print the packaging tool version.
help-advanced
Print the advanced options.
-help
Print the usage information. This will include other command-line options and commands that aren't listed here but don't apply to Qt apps.

Variables:

bar-package
Path of the output BAR package file.
app-descriptor
Path of the app descriptor file.
binary-file
Path of the Qt binary file.
resource-file
Path of a resource file used by the Qt app. This could be an icon, a font definition file, an image, and so on. You can name as many resource files as you want.
Note: These paths can be absolute or relative to the current directory. The resulting location in the package is a tail path of the file, unless overridden by the -C or -e options.

Example:

The command line shown below packages the Settings app from the Qt5 HMI. The app binary, icon file, and several images from installed UI themes are included in the BAR file (QtSettingsApp.bar), which is generated based on the app descriptor file (settings-descriptor.xml):

blackberry-nativepackager.bat -package QtSettingsApp.bar -devMode settings-descriptor.xml
    -e %1\bin\settingsapp bin/settingsapp settings_icon.png
    -C %1\ %1\lib\ %1\share\qnxcar2\palettes\
        %1\share\qnxcar2\fonts\
        %1\share\qnxcar2\qml\main.qml
        %1\share\settingsapp\
        %1\share\qnxcar2\images\themes\720p\default\Settings\
        %1\share\qnxcar2\images\themes\720p\midnightblue\Settings\
        %1\share\qnxcar2\images\themes\800x480\default\Settings\
        %1\share\qnxcar2\images\themes\800x480\midnightblue\Settings\
        %1\share\qnxcar2\images\themes\800x480\titanium\Settings\
        %1\share\qnxcar2\images\themes\720p\default\CommonResources\
        %1\share\qnxcar2\images\themes\720p\midnightblue\CommonResources\
        %1\share\qnxcar2\images\themes\800x480\default\CommonResources\
        %1\share\qnxcar2\images\themes\800x480\midnightblue\CommonResources\
        %1\share\qnxcar2\images\themes\800x480\titanium\CommonResources\

In the actual command line, %1 is replaced with the path of the source directory containing the compiled Qt code. The -e and -C options take arguments, so the command-line tokens following these options refer to the files affected by them. Here, the -e option tells the packaging tool to store the app binary (which is located at %1\bin\settingsapp on the host system) at bin/settingsapp in the output package. The -C option removes the %1 folder from the paths of the subsequently named files. For example, the files in %1\lib on the host system get placed in /lib in the package.