bazelbuild / rules_apple

Bazel rules to build apps for Apple platforms.
Apache License 2.0
509 stars 264 forks source link

Add support for macos in `apple_*_xcframework` rules #2459

Open luispadron opened 4 months ago

luispadron commented 4 months ago

This commit adds a macos attr to both the apple_xcframework and apple_static_xcframework rules. This allows building for multiple architectures and platforms.

The new macos attr is a string_list (unlike the ios attr which is a dict for the simulator/device split).

Example:

apple_xcframework(
    name = "ios_and_macos_dynamic_xcframework",
    bundle_id = "com.google.example",
    extension_safe = True,
    infoplists = [
        "//test/starlark_tests/resources:Info.plist",
    ],
    ios = {
        "simulator": ["x86_64"],
        "device": ["arm64"],
    },
    macos = [
        "arm64",
        "x86_64",
    ],
    minimum_os_versions = {
        "ios": common.min_os_ios.baseline,
        "macos": common.min_os_macos.baseline,
    },
    public_hdrs = [
        "//test/starlark_tests/resources:shared.h",
    ],
    tags = common.fixture_tags,
    deps = [":fmwk_lib"],
)

Fixes https://github.com/bazelbuild/rules_apple/issues/1475