MacOsApplicationBundleBuilder¶
- class starlark_tugger.MacOsApplicationBundleBuilder¶
The
MacOsApplicationBundleBuildertype allows creating macOS Application Bundles (typically.appdirectories) providing applications on macOS.For reference, see Apple’s bundle format documentation for the structure of application bundles.
- __init__(bundle_name: str) MacOsApplicationBundleBuilder¶
Construct new instances. It accepts the following arguments:
bundle_nameThe name of the application bundle.
This will become the value for
CFBundleNameand form the name of the generated bundle directory.
- add_icon(path: str)¶
Accepts a
stringargument defining the path to a file that will become the<bundle_name>.icnsfile for the bundle.
- add_manifest(manifest: FileManifest)¶
Adds file data to the bundle via a
FileManifestinstance. All files in the manifest will be materialized in theContents/directory of the bundle.Accepts the following arguments:
manifestCollection of files to materialize.
Bundles have a well-defined structure and files should only be materialized in certain locations. This method will allow you to materialize files in locations resulting in a malformed bundle. Use with caution.
- add_macos_file(content: FileContent, path: Optional[str] = None)¶
Adds a single file to be installed in the
Contents/MacOSdirectory in the bundle.Accepts the following arguments:
contentObject representing file content to materialize.
pathRelative path of file under
Contents/MacOS. If not defined, the file will be installed into the equivalent ofos.path.join("Contents/MacOS", content.filename).
- add_macos_manifest(manifest: FileManifest))¶
Adds a
FileManifestof content to be materialized in theContents/MacOSdirectory.Accepts the following arguments:
manifestCollection of files to materialize.
- add_resources_file(content: FileContent, path: Optional[str])¶
Adds a single file to be installed in the
Contents/Resourcesdirectory in the bundle.Accepts the following arguments:
contentObject representing file content to materialize.
pathRelative path of file under
Contents/Resources. If not defined, the file will be installed into the equivalent ofos.path.join("Contents/Resources", content.filename).
- add_resources_manifest(manifest: FileManifest)¶
Adds a
FileManifestof content to be materialized in theContents/Resourcesdirectory.Accepts the following arguments:
manifestCollection of files to materialize.
- set_info_plist_key(key: str, value: Union[bool, int, str])¶
Sets the value of a key in the
Contents/Info.plistfile.Accepts the following arguments:
keyKey in the
`Info.plistfile to set.valueValue to set. Can be a
bool,int, orstring.
- set_info_plist_required_keys(display_name: str, identifier: str, version: str, signature: str, executable: str)¶
This method defines required keys in the
Contents/Info.plistfile.The following named arguments are accepted and must all be provided:
display_nameSets the bundle display name (
CFBundleDisplayName).This is the name of the application as displayed to users.
identifierSets the bundle identifier (
CFBundleIdentifer).This is a reverse DNS type identifier. e.g.
com.example.my_program.versionSets the bundle version string (
CFBundleVersion)signatureSets the bundle creator OS type code (
CFBundleSignature).The value must be exactly 4 characters.
executableSets the name of the main executable file (
CFBundleExecutable).This is typically the same name as the bundle.
- build(target: str)¶
This method will materialize the
.appbundle/directory given the settings specified.This method accepts the following arguments:
targetThe name of the target being built.
Upon successful bundle directory creation, the entire bundle is considered for code signing with the signing action
macos-application-bundle-creation. All signable Mach-O files and nested bundles should be signed.
- write_to_directory(path: str)¶
This method will materialize the
.appbundle/directory to the specified directory.Absolute paths are treated as-is. Relative paths are relative to the currently configured build path.
Upon successful bundle directory creation, the entire bundle is considered for code signing with the signing action
macos-application-bundle-creation. All signable Mach-O files and nested bundles should be signed.