Skip to content

Latest commit

 

History

History
149 lines (140 loc) · 5.18 KB

types.md

File metadata and controls

149 lines (140 loc) · 5.18 KB

Related types

This file documents other special types used by the Apple Bazel rules.

apple_product_type

A struct containing product type identifiers used by special application and extension types.

Some applications and extensions, such as Messages Extensions and Sticker Packs in iOS 10, receive special treatment when building (for example, some product types bundle a stub executable instead of a user-defined binary, and some pass extra arguments to tools like the asset compiler). These behaviors are captured in the product type identifier. The product types currently supported are:

Product types
application

A basic iOS, macOS, or tvOS application. This is the default product type for those targets; it can be overridden with a more specific product type if needed.

app_extension

A basic iOS, macOS, or tvOS application extension. This is the default product type for those targets; it can be overridden with a more specific product type if needed.

framework

A basic dynamic framework. This is the default product type for those targets; it does not need to be set explicitly (and cannot be changed).

messages_application

Applies to ios_application targets built for iOS 10 and above.

A "stub" application used to distribute a standalone Messages Extension or Sticker Pack. This application must include an ios_extension whose product type is messages_extension or messages_sticker_pack_extension (or it can include both).

This product type does not contain a user-provided binary; any code in its deps will be ignored.

This stub application is not displayed on the home screen and its features are only accessible through the Messages user interface. If you are building a Messages Extension or Sticker Pack as part of a larger application that is launchable, do not use this product type; simply add those extensions to the existing application.

messages_extension

Applies to ios_extension targets built for iOS 10 and above.

An extension that integrates custom behavior into the Apple Messages application. Such extensions can present a custom user interface in the keyboard area of the app and interact with users' conversations.

messages_sticker_pack_extension

Applies to ios_extension targets built for iOS 10 and above.

An extension that defines custom sticker packs for the Apple Messages app. Stickers are provided by including an asset catalog named *.xcstickers in the extension's asset_catalogs attribute.

This product type does not contain a user-provided binary; any code in its deps will be ignored.

ui_test_bundle

A UI testing bundle (`.xctest`). This is the default product type for those targets; it does not need to be set explicitly (and cannot be changed).

unit_test_bundle

A unit test bundle (`.xctest`). This is the default product type for those targets; it does not need to be set explicitly (and cannot be changed).

watch2_application

A watchOS 2+ application. This is the default product type for those targets; it does not need to be set explicitly (and cannot be changed).

watch2_extension

A watchOS 2+ application extension. This is the default product type for those targets; it does not need to be set explicitly (and cannot be changed).

Example usage:

load("@build_bazel_rules_apple//apple:ios.bzl",
     "apple_product_type", "ios_application", "ios_extension")

ios_application(
    name = "StickerPackApp",
    extensions = [":StickerPackExtension"],
    product_type = apple_product_type.messages_application,
    # other attributes...
)

ios_extension(
    name = "StickerPackExtension",
    product_type = apple_product_type.messages_sticker_pack_extension,
    # other attributes...
)