-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move parse_xcframework_info_plist from feature to build setting (#2054)
- Introduce build settings for rules_apple with `parse_xcframework_info_plist`. - Adds support for configurable build settings into `apple_verification_test`. - Updates XCFramework import rules and tests for XCFramework processor tool. (cherry picked from commit 5bdfb0a)
- Loading branch information
Showing
10 changed files
with
177 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Build settings used throughout rules_apple build rules. | ||
|
||
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") | ||
load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
licenses(["notice"]) | ||
|
||
# Configuration for enabling XCFramework import rules use the xcframework_processor_tool to | ||
# parse the XCFramework bundle Info.plist file. See apple/internal/apple_xcframework_import.bzl | ||
bool_flag( | ||
name = "parse_xcframework_info_plist", | ||
build_setting_default = False, | ||
) | ||
|
||
bzl_library( | ||
name = "attrs", | ||
srcs = ["attrs.bzl"], | ||
) | ||
|
||
# Consumed by bazel tests. | ||
filegroup( | ||
name = "for_bazel_tests", | ||
testonly = 1, | ||
srcs = glob(["**"]), | ||
visibility = [ | ||
"//apple:__subpackages__", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright 2022 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Apple build settings attributes to be added to rules that read configuration settings.""" | ||
|
||
# List of all registered build settings at `rules_apple/apple/build_settings/BUILD`. | ||
_BUILD_SETTINGS = [ | ||
"parse_xcframework_info_plist", | ||
] | ||
|
||
# Build settings label template including label prefix. | ||
_BUILD_SETTING_LABEL_TEMPLATE = "@build_bazel_rules_apple//apple/build_settings:{name}" | ||
|
||
build_settings = struct( | ||
# A list of labels is shared for apple_verification_test transition to allow | ||
# tests set these custom build settings. | ||
all_labels = [ | ||
_BUILD_SETTING_LABEL_TEMPLATE.format( | ||
name = build_setting, | ||
) | ||
for build_setting in _BUILD_SETTINGS | ||
], | ||
# The following struct fields are dynamically generated using each build | ||
# setting. Each build setting struct will have the following format: | ||
# | ||
# struct( | ||
# build_setting_a = struct( | ||
# label = "rules_apple/apple/build_settings:build_setting_a" | ||
# attr = { | ||
# "_build_setting_a": attr.label( | ||
# default = "rules_apple/apple/build_settings:build_setting_a", | ||
# ) | ||
# } | ||
# ) | ||
# ) | ||
**{ | ||
build_setting: struct( | ||
label = _BUILD_SETTING_LABEL_TEMPLATE.format( | ||
name = build_setting, | ||
), | ||
attr = { | ||
"_{build_setting_name}".format( | ||
build_setting_name = build_setting, | ||
): attr.label( | ||
default = _BUILD_SETTING_LABEL_TEMPLATE.format( | ||
name = build_setting, | ||
), | ||
), | ||
}, | ||
) | ||
for build_setting in _BUILD_SETTINGS | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters