Awesome Open Source
Awesome Open Source

Apple Rules for Bazel

Build status

This repository contains rules for Bazel that can be used to bundle applications for Apple platforms.

These rules handle the linking and bundling of applications and extensions (that is, the formation of an .app with an executable and resources, archived in an .ipa). Compilation is still performed by the existing objc_library rule in Bazel, and by the swift_library rule available from rules_swift.

Reference documentation

Click here for the reference documentation for the rules and other definitions in this repository.

Quick setup

Add the following to your WORKSPACE file to add the external repositories, replacing the version number in the tag attribute with the version of the rules you wish to depend on:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

    name = "build_bazel_rules_apple",
    sha256 = "c84962b64d9ae4472adfb01ec2cf1aa73cb2ee8308242add55fa7cc38602d882",
    url = "",








Minimal example:

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

    name = "Lib",
    srcs = glob([
    data = [

# Links code from "deps" into an executable, collects and compiles resources
# from "deps" and places them with the executable in an .app bundle, and then
# outputs an .ipa with the bundle in its Payload directory.
    name = "App",
    bundle_id = "",
    families = ["iphone", "ipad"],
    infoplists = [":Info.plist"],
    deps = [":Lib"],

See the examples directory for sample applications.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
apple (276
bazel (71
starlark (56
bazel-rules (31