Skip to main content

apple_macos_bundle

An apple_macos_bundle() rule generates a macOS application bundle. It applies the macOS platform transition automatically, so the binary and its dependencies are built for macOS regardless of the default target platform. Use case is Mac Catalyst apps which want to include an AppKit framework.

Function Signature

def apple_macos_bundle(
*,
name: str,
default_target_platform: None | str = None,
target_compatible_with: list[str] = [],
compatible_with: list[str] = [],
exec_compatible_with: list[str] = [],
visibility: list[str] = [],
within_view: list[str] = ["PUBLIC"],
metadata: OpaqueMetadata = {},
tests: list[str] = [],
modifiers: OpaqueMetadata = [],
_apple_platforms: dict[str, str] = {},
_apple_toolchain: str = "gh_facebook_buck2_shims_meta//:apple-bundle",
_apple_tools: str = "prelude//apple/tools:apple-tools",
_apple_xctoolchain: str = "gh_facebook_buck2_shims_meta//:apple-xctoolchain",
_apple_xctoolchain_bundle_id: str = "gh_facebook_buck2_shims_meta//:apple-xctoolchain-bundle-id",
_bundling_cache_buster: None | str = None,
_bundling_log_file_enabled: bool = False,
_bundling_log_file_level: None | str = None,
_code_signing_configuration: None | str = None,
_codesign_command_override: None | str = None,
_codesign_entitlements: None | str = None,
_codesign_identities_command_override: None | str = None,
_codesign_type: None | str = None,
_compile_resources_locally_override: None | bool = None,
_embed_provisioning_profile_when_adhoc_code_signing: None | bool = None,
_fast_adhoc_signing_enabled_default: bool = select({"prelude//features/apple:fast_adhoc_signing_disabled": False, "prelude//features/apple:fast_adhoc_signing_enabled": True, "DEFAULT": True}),
_fast_provisioning_profile_parsing_enabled: bool = False,
_incremental_bundling_enabled: bool = False,
_info_plist_identify_build_system_default: bool = False,
_profile_bundling_enabled: bool = False,
_provisioning_profile_sources: str = "gh_facebook_buck2_shims_meta//xplat/buck2/platform/apple:provisioning_profile_sources",
_provisioning_profile_sources_enabled: bool = True,
_provisioning_profiles: str = "gh_facebook_buck2_shims_meta//xplat/buck2/platform/apple:provisioning_profiles",
_resource_bundle: None | str = None,
_skip_adhoc_resigning_scrubbed_frameworks_default: bool = select({"prelude//features/apple/constraints:skip_adhoc_resigning_scrubbed_frameworks_disabled": False, "prelude//features/apple/constraints:skip_adhoc_resigning_scrubbed_frameworks_enabled": True, "DEFAULT": False}),
_skip_adhoc_resigning_scrubbed_frameworks_override: None | bool = None,
_strict_provisioning_profile_search_default: bool = select({"prelude//features/apple:strict_provisioning_profile_search_enabled": True, "DEFAULT": True}),
_use_entitlements_when_adhoc_code_signing: None | bool = None,
asset_catalogs_compilation_options: dict[str, typing.Any] = {},
binary: None | str = None,
bundle_type: str = "default",
code_signing_configuration: None | str = None,
codesign_flags: list[str] = [],
codesign_identity: None | str = None,
codesign_type: None | str = None,
contacts: list[str] = [],
copy_public_framework_headers: None | bool = None,
debug_artifacts_validators: dict[str, (str, str)] = {},
default_platform: None | str = None,
deps: list[str] = [],
embed_provisioning_profile_when_adhoc_code_signing: bool = False,
embed_xctest_frameworks: bool = select({"prelude//marker/apple/constraints:embed_xctest_frameworks_enabled": True, "DEFAULT": False}),
enforce_minimum_os_plist_key: bool = False,
entitlements_removed_keys: list[str] = [],
entitlements_removed_values_map: dict[str, list[str]] = {},
entitlements_suffixed_key_map: dict[str, str] = {},
entitlements_verification_check_enabled: bool = select({"prelude//features/apple:entitlements_verification_check_disabled": False, "prelude//features/apple:entitlements_verification_check_enabled": True, "DEFAULT": True}),
extension: str,
fast_adhoc_signing_enabled: None | bool = None,
ibtool_flags: None | list[str] = None,
incremental_bundling_enabled: None | bool = None,
info_plist: str,
info_plist_identify_build_system: None | bool = None,
info_plist_substitutions: dict[str, str] = {},
labels: list[str] = [],
licenses: list[str] = [],
minimum_os_version: None | str = None,
module_map: None | str = None,
product_name: None | str = None,
product_name_from_module_name: bool = False,
provisioning_profile_filter: None | str = None,
resource_group: None | str = None,
resource_group_map: None | str = None,
selective_debugging: None | str = None,
skip_adhoc_resigning_scrubbed_frameworks: None | bool = None,
skip_copying_swift_stdlib: None | bool = None,
skip_private_swiftinterface: bool = False,
split_arch_dsym: bool = False,
strict_provisioning_profile_search: None | bool = None,
universal: None | bool = None,
use_entitlements_when_adhoc_code_signing: bool = False,
validation_deps: list[str] = [],
versioned_macos_bundle: bool = select({"prelude//features/apple/constraints:versioned_macos_bundle_false": False, "prelude//features/apple/constraints:versioned_macos_bundle_true": True, "DEFAULT": False}),
xcode_product_type: None | str = None,
xcode_scheme_settings: None | str = None,
) -> None

Parameters

  • name: (required)

    name of the target

  • default_target_platform: (defaults to: None)

    specifies the default target platform, used when no platforms are specified on the command line

  • target_compatible_with: (defaults to: [])

    a list of constraints that are required to be satisfied for this target to be compatible with a configuration

  • compatible_with: (defaults to: [])

    a list of constraints that are required to be satisfied for this target to be compatible with a configuration

  • exec_compatible_with: (defaults to: [])

    a list of constraints that are required to be satisfied for this target to be compatible with an execution platform

  • visibility: (defaults to: [])

    a list of visibility patterns restricting what targets can depend on this one

  • within_view: (defaults to: ["PUBLIC"])

    a list of visibility patterns restricting what this target can depend on

  • metadata: (defaults to: {})

    a key-value map of metadata associated with this target

  • tests: (defaults to: [])

    a list of targets that provide tests for this one

  • modifiers: (defaults to: [])

    an array of modifiers associated with this target

  • asset_catalogs_compilation_options: (defaults to: {})

    A dict holding parameters for asset catalogs compiler (actool). Its options include:

    • notices (defaults to True)
    • warnings (defaults to True)
    • errors (defaults to True)
    • compress_pngs (defaults to True)
    • optimization (defaults to 'space')
    • output_format (defaults to 'human-readable-text')
    • extra_flags (defaults to [])
  • contacts: (defaults to: [])

    A list of organizational contacts for this rule. These could be individuals who you would contact in the event of a failure or other issue with the rule.

    contacts = [ 'Joe Sixpack', 'Erika Mustermann' ]
  • entitlements_removed_keys: (defaults to: [])

    A list of entitlement keys to remove from the entitlements plist. Any key present in this list will be deleted from the final entitlements before code signing. For example, ["com.apple.developer.icloud-services"] will remove the com.apple.developer.icloud-services key from the entitlements.

  • entitlements_removed_values_map: (defaults to: {})

    A map of entitlement keys to a list of values to remove from that key's value in the entitlements plist. If the entitlement value is a list, the specified values are removed from it. If the entitlement value is a dict, the specified values are removed as keys from it. For example, {"keychain-access-groups": ["group1"]} will remove "group1" from the keychain-access-groups list.

  • entitlements_suffixed_key_map: (defaults to: {})

    A map of entitlement key to suffix string. For each entry, the corresponding value(s) in the entitlements plist will have the suffix appended. Values can be a single string or a list of strings; both are handled. For example, {"keychain-access-groups": ".suffix"} will append .suffix to every value under the keychain-access-groups key.

  • info_plist_substitutions: (defaults to: {})

    A dictionary that assigns variable names to their values. It is used for variable substitution when processing the file specified in info_plist. For example if this argument is set to {'VAR': 'MyValue'}, then each occurrence of $(VAR) or ${VAR} in the file will be replaced by MyValue.

  • labels: (defaults to: [])

    Set of arbitrary strings which allow you to annotate a build rule with tags that can be searched for over an entire dependency tree using buck query().

  • licenses: (defaults to: [])

    Set of license files for this library. To get the list of license files for a given build rule and all of its dependencies, you can use buck query

  • xcode_scheme_settings: (defaults to: None)

    Optional settings to set on schemes when this target is represented in Xcode.