Qbs Manual | List of Modules | Module bundle

Qbs 1.8.1

# Module bundle

The `bundle` module contains properties and rules for building and working with Core Foundation bundles on Apple platforms (commonly known as CFBundles or simply "bundles"), directories with a standardized hierarchical structure that hold executable code and resources. Examples include applications, frameworks, and plugins.

This module is available on all platforms but is currently only useful on Apple platforms.

Note: Core Foundation bundles are not to be confused with Mach-O loadable modules, which are also referred to as (loadable) "bundles" in Apple parlance. In Qbs, Core Foundation bundles are referred to as "bundles", while Mach-O loadable bundles are referred to as "loadable modules".

## General Properties

Property | Type | Since | Default | Description
--- | --- | --- | --- | ---
isBundle | `bool` | 1.4 | `true` for applications and dynamic libraries on Apple platforms, `false` otherwise | Whether the product should actually be packaged as a bundle as opposed to a flat file. This allows a product indirectly dependent on the `bundle` module to retain control of whether it should actually be built as a bundle.
isShallow | `bool` (read only) | 1.4 | `false` on macOS, otherwise `true` | Whether the bundle directory tree is "shallow", i.e. whether it lacks a Contents subdirectory. This is the default on all platforms other than macOS.
identifierPrefix | `string` | 1.4 | `org.example` | Prefix for the product's bundle identifier. If `identifier` is left unset, the bundle identifier will be a concatenation of this value and the `identifier` property, separated by a '.'. This corresponds to the organization identifier in Xcode.
identifier | `string` | 1.4 | combination of `identifierPrefix` and the product's target name formatted as an RFC 1034 identifier | The bundle's identifier. If left unset, the bundle identifier will be a concatenation of this value and the `identifierPrefix` property, separated by a '.'.
extension | `string` | 1.4 | `"app"` for `"APPL"` packages, `"framework"` for `"FMWK"` packages, `"bundle"` for `"BNDL"` and custom packages | The extension of the bundle's wrapper directory (minus the leading '.'). This property should not normally need to be set unless creating a custom bundle type.
packageType | `string` | 1.4 | `"APPL"` for applications, `"FMWK"` for frameworks, `"BNDL"` for custom bundles | The four-letter file type code of the bundle, specified in the bundle's PkgInfo file and in the bundle's Info.plist as the value for the CFBundlePackageType key. This property should almost never need to be changed, though specifying an alternative package type for custom bundles is allowed.
generatePackageInfo | `bool` | 1.5 | `true` for applications, otherwise `false` | Whether to generate a PkgInfo file for the bundle. This property should almost never need to be changed, though enabling it when specifying an alternative package type for custom bundles using `packageType` is allowed.
signature | `string` | 1.4 | `"????"` | The four-letter signature specific to the bundle, also known as the creator code, specified in the bundle's PkgInfo file and in the bundle's Info.plist as the value for the CFBundleSignature key. This property should normally never need to be set.
bundleName | `string` | 1.4 | combination of the product's `targetName` and bundle's `extension` | The file name of the bundle's wrapper directory. This property should not normally need to be changed.
frameworkVersion | `string` | 1.4 | `"A"` | For framework bundles, the version of the framework. Unused for other package types.
publicHeaders | `pathList` | 1.4 | `undefined` | List of public header files to copy to a framework bundle's Headers subdirectory.
privateHeaders | `pathList` | 1.4 | `undefined` | List of private header files to copy to a framework bundle's PrivateHeaders subdirectory
resources | `pathList` | 1.4 | `undefined` | List of resources to copy to a bundle's Resources subdirectory. Files will automatically be copied into lproj subdirectories corresponding to the input files' paths.
infoPlist | `object` | 1.4 | `undefined` | Dictionary of key-value pairs to add to the bundle's Info.plist. The contents of this property will be aggregated with the values from any plist files. If `infoPlist` and any plist files contain the same key, the former will take precedence, but may also be overridden during postprocessing (see `processInfoPlist`). If undefined, will not be taken into account.
processInfoPlist | `bool` | 1.4 | `true` | Whether to perform post-processing on the aggregated Info.plist contents. If this property is `true`, various post-processing operations will be applied to the bundle's property list dictionary after it has been aggregated from the contents of any plist files on disk, and the `infoPlist` property. First, values from a list of defaults will be added to the dictionary if they were not already present. Then, values from the AdditionalInfo key of the platform SDK's Info.plist file will be added to the dictionary if they were not already present, as well as some other miscellaneous keys, such as BuildMachineOSBuild and UIDeviceFamily (on iOS). Finally, variable expansions will be performed such that substrings of the form $(VAR) or ${VAR} will be replaced with their corresponding environment variables.
embedInfoPlist | `bool` | 1.4 | `true` if the product is a command line tool, otherwise `false`. | Whether to create a __TEXT section in the product's executable containing the processed Info.plist. Only applies to command line applications.
infoPlistFormat | `string` | 1.4 | `"binary1"` for iOS; `"same-as-input"` or `"xml1"` for macOS depending on whether a plist file is used; `undefined` for all other operating systems. | The file format to write the product's resulting Info.plist in. Possible values: `"xml1"`, `"binary1"`, `"json"`, `"same-as-input"`

## Path Specific Properties

All properties in this section are read-only properties of type `string` specifying file paths relative to the directory containing the bundle.

Property | Since | Description
--- | --- | ---
infoPlistPath | 1.4 | Path that the Info.plist file will be written to.
infoStringsPath | 1.5 | Path that the InfoPlist.strings file will be written to.
pkgInfoPath | 1.4 | Path that the PkgInfo file will be written to.
versionPlistPath | 1.4 | Path that the version.plist file will be written to.
executablePath | 1.4 | Path that the main executable file will be written to.
contentsFolderPath | 1.4 | Path of the bundle's Contents subdirectory.
documentationFolderPath | 1.5 | Path of the directory where documentation will be written.
executableFolderPath | 1.4 | Path of the directory where the main exectuable will be written. Not to be confused with `executablesFolderPath`.
executablesFolderPath | 1.4 | Path of the directory where auxiliary executables will be copied. Not to be confused with `executableFolderPath`.
frameworksFolderPath | 1.4 | Path of the directory where internal frameworks will be copied.
javaFolderPath | 1.5 | Path of the directory where Java content will be written.
localizedResourcesFolderPath | 1.5 | Path of the directory where localized resource files will be copied.
pluginsFolderPath | 1.4 | Path of the directory where plugins will be copied.
privateHeadersFolderPath | 1.4 | Path of the directory where private header files will be copied.
publicHeadersFolderPath | 1.4 | Path of the directory where public headers files will be copied.
scriptsFolderPath | 1.4 | Path of the directory where script files will be copied.
sharedFrameworksFolderPath | 1.4 | Path of the directory where shared frameworks will be copied.
sharedSupportFolderPath | 1.4 | Path of the directory where shared support files will be copied.
unlocalizedResourcesFolderPath | 1.4 | Path of the directory where non-localized resource files will be copied. This is the same as the base resources path.
versionsFolderPath | 1.5 | Path of the bundle's Versions subdirectory. This is only relevant for (non-shallow) framework bundles.

## Relevant File Tags

Tag | Auto-tagged File Names | Since | Description
--- | --- | --- | ---
`"bundle.content"` | - | 1.8 | This tag is attached to the output artifacts of the rule that produces the bundle.