Apple Bazel definitions

Guides

Platform-specific rules

Each Apple platform has its own rules for building bundles (applications, extensions, and frameworks) and for running unit tests and UI tests.

Platform .bzl file Bundling rules Testing rules
iOS @build_bazel_rules_apple//apple:ios.bzl ios_application
ios_imessage_application
ios_extension
ios_imessage_extension
ios_sticker_pack_extension
ios_framework
ios_static_framework
ios_ui_test
ios_ui_test_suite
ios_unit_test
ios_unit_test_suite
ios_build_test
macOS @build_bazel_rules_apple//apple:macos.bzl macos_application
macos_bundle
macos_command_line_application
macos_extension
macos_unit_test
macos_build_test
tvOS @build_bazel_rules_apple//apple:tvos.bzl tvos_application
tvos_extension
tvos_ui_test
tvos_unit_test
tvos_build_test
watchOS @build_bazel_rules_apple//apple:watchos.bzl watchos_application
watchos_extension
watchos_build_test

Other rules

General rules that are not specific to a particular Apple platform are listed below.

Category .bzl file Rules
General @build_bazel_rules_apple//apple:versioning.bzl apple_bundle_version
@build_bazel_rules_apple//apple:apple.bzl apple_dynamic_framework_import
apple_static_framework_import
Resources @build_bazel_rules_apple//apple:resources.bzl apple_bundle_import
apple_resource_bundle
apple_resource_group

Available options

Check out this page for more information on available options that these rules honor during a build.

Extending or integrating with these rules

If you want to write custom rules that integrate with these Apple platform rules (for example, write a rule that provides resources to an application or takes an application as a dependency), then please refer to the documentation on providers to see the data that these rules propagate as output and expect as input.