rules_apple
3.13.0
published 1 week ago
514 stars
269 forks
35 watchers
Apache License 2.0
public
1 assets
3,862,331 downloads
2 MB
Compatability level 1
uJKREohxWzVOBbmm/pAJY19xVZkfJPJ+d5/oDUNckrw=
3.13.0
November 13, 2024

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/rules_apple/compare/3.12.0...3.13.0

This release is compatible with Bazel 6.x LTS, 7.x LTS, and 8.x rolling releases.

MODULE.bazel Snippet

bazel_dep(name = "rules_apple", version = "3.13.0", repo_name = "build_bazel_rules_apple")

Workspace Snippet

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

http_archive(
    name = "build_bazel_rules_apple",
    sha256 = "b892911288715b354e05b9a6fe9009635f7155991f24f27e779fe80d435c92bc",
    url = "https://github.com/bazelbuild/rules_apple/releases/download/3.13.0/rules_apple.3.13.0.tar.gz",
)

load(
    "@build_bazel_rules_apple//apple:repositories.bzl",
    "apple_rules_dependencies",
)

apple_rules_dependencies()

load(
    "@build_bazel_rules_swift//swift:repositories.bzl",
    "swift_rules_dependencies",
)

swift_rules_dependencies()

load(
    "@build_bazel_rules_swift//swift:extras.bzl",
    "swift_rules_extra_dependencies",
)

swift_rules_extra_dependencies()

load(
    "@build_bazel_apple_support//lib:repositories.bzl",
    "apple_support_dependencies",
)

apple_support_dependencies()
Deps:
Assets:

Apple Rules for Bazel

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.

If you are looking for an easy way to build mixed language frameworks, check out rules_ios.

Reference documentation

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

Quick setup

Copy the latest MODULE.bazel or WORKSPACE snippet from the releases page.

Examples

Minimal example:

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

swift_library(
    name = "MyLibrary",
    srcs = glob(["**/*.swift"]),
    data = [":Main.storyboard"],
)

# 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.
ios_application(
    name = "App",
    bundle_id = "com.example.app",
    families = [
        "iphone",
        "ipad",
    ],
    infoplists = [":Info.plist"],
    minimum_os_version = "15.0",
    deps = [":MyLibrary"],
)

See the examples directory for sample applications.

Supported bazel versions

rules_apple and rules_swift are often affected by changes in bazel itself. This means you generally need to update these rules as you update bazel.

You can also see the supported bazel versions in the notes for each release on the releases page.

Besides these constraints this repo follows semver as best as we can since the 1.0.0 release.

Bazel release Minimum supported rules version Final supported rules version Supporting Branch
8.x (most recent rolling) 2.* current master
7.x 2.* current master
6.x 2.* current master
5.x 0.33.0 1.* bazel/5.x
4.x 0.30.0 0.32.0 N/A
3.x 0.20.0 0.21.2 N/A