diff --git a/apple/internal/rule_factory.bzl b/apple/internal/rule_factory.bzl index 87a642e2d2..106b5ea208 100644 --- a/apple/internal/rule_factory.bzl +++ b/apple/internal/rule_factory.bzl @@ -99,13 +99,6 @@ A file that will be used in lcov export calls to limit the scope of files instru """, allow_single_file = True, ), - "bundle_name": attr.string( - mandatory = False, - doc = """ -The desired name of the bundle (without the extension). If this attribute is not set, then the name -of the target will be used instead. -""", - ), } def _create_apple_rule( @@ -170,6 +163,23 @@ def _create_apple_test_rule(*, doc, implementation, platform_type): # The aspect is withheld to avoid unnecessary overhead in this instance of `test_host`, and # the provider is unnecessarily generic to accomodate any possible value of `test_host`. rule_attrs.test_host_attrs(aspects = [], providers = [[AppleBundleInfo]]), + # Add bundle attributes to make them visible in documentation + rule_attrs.infoplist_attrs(default_infoplist = "//apple/testing:DefaultTestBundlePlist"), + { + "bundle_name": attr.string( + mandatory = False, + doc = """ +The desired name of the bundle (without the extension). If this attribute is not set, then the name +of the target will be used instead. +""", + ), + "frameworks": attr.label_list( + providers = [[AppleBundleInfo]], + doc = """ +A list of framework targets that this target depends on. +""", + ), + }, ] return rule( diff --git a/apple/internal/testing/apple_test_assembler.bzl b/apple/internal/testing/apple_test_assembler.bzl index c696a313b5..689beaf11f 100644 --- a/apple/internal/testing/apple_test_assembler.bzl +++ b/apple/internal/testing/apple_test_assembler.bzl @@ -28,10 +28,7 @@ _BUNDLE_ATTRS = { "base_bundle_id", "bundle_id", "bundle_id_suffix", - "bundle_name", "families", - "frameworks", - "infoplists", "linkopts", "provisioning_profile", "resources", @@ -43,7 +40,10 @@ _BUNDLE_ATTRS = { _SHARED_TEST_BUNDLE_ATTRS = { x: None for x in [ + "bundle_name", "features", + "frameworks", + "infoplists", "minimum_os_version", "tags", "test_host", diff --git a/doc/rules-ios.md b/doc/rules-ios.md index bbef7e5ebb..f8c576bb43 100644 --- a/doc/rules-ios.md +++ b/doc/rules-ios.md @@ -591,8 +591,8 @@ Outputs:
load("@rules_apple//apple:ios.doc.bzl", "ios_ui_test")
-ios_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
+ios_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit, frameworks,
+ infoplists, minimum_deployment_os_version, minimum_os_version, platform_type, runner,
test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
@@ -622,6 +622,8 @@ of the attributes inherited by all test rules, please check the
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"ios"` |
@@ -639,8 +641,8 @@ of the attributes inherited by all test rules, please check the
load("@rules_apple//apple:ios.doc.bzl", "ios_unit_test")
-ios_unit_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
+ios_unit_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit, frameworks,
+ infoplists, minimum_deployment_os_version, minimum_os_version, platform_type, runner,
test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
@@ -676,6 +678,8 @@ of the attributes inherited by all test rules, please check the
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"ios"` |
diff --git a/doc/rules-macos.md b/doc/rules-macos.md
index 59a3b6e3c3..985e47e28b 100644
--- a/doc/rules-macos.md
+++ b/doc/rules-macos.md
@@ -643,8 +643,8 @@ i.e. `--features=-swift.no_generated_header`).
load("@rules_apple//apple:macos.doc.bzl", "macos_ui_test")
-macos_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
+macos_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit, frameworks,
+ infoplists, minimum_deployment_os_version, minimum_os_version, platform_type, runner,
test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
@@ -665,6 +665,8 @@ Note: macOS UI tests are not currently supported in the default test runner.
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"macos"` |
@@ -682,8 +684,8 @@ Note: macOS UI tests are not currently supported in the default test runner.
load("@rules_apple//apple:macos.doc.bzl", "macos_unit_test")
-macos_unit_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
+macos_unit_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit, frameworks,
+ infoplists, minimum_deployment_os_version, minimum_os_version, platform_type, runner,
test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
@@ -710,6 +712,8 @@ find more information about testing for Apple platforms
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"macos"` |
diff --git a/doc/rules-tvos.md b/doc/rules-tvos.md
index 28d7a30624..d527b96eca 100644
--- a/doc/rules-tvos.md
+++ b/doc/rules-tvos.md
@@ -340,8 +340,8 @@ i.e. `--features=-swift.no_generated_header`).
load("@rules_apple//apple:tvos.doc.bzl", "tvos_ui_test")
-tvos_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
+tvos_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit, frameworks,
+ infoplists, minimum_deployment_os_version, minimum_os_version, platform_type, runner,
test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
@@ -366,6 +366,8 @@ the attributes inherited by all test rules, please check the
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"tvos"` |
@@ -383,8 +385,8 @@ the attributes inherited by all test rules, please check the
load("@rules_apple//apple:tvos.doc.bzl", "tvos_unit_test")
-tvos_unit_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
+tvos_unit_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit, frameworks,
+ infoplists, minimum_deployment_os_version, minimum_os_version, platform_type, runner,
test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
@@ -417,6 +419,8 @@ of the attributes inherited by all test rules, please check the
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"tvos"` |
diff --git a/doc/rules-visionos.md b/doc/rules-visionos.md
index c31655fe44..4031da7e66 100755
--- a/doc/rules-visionos.md
+++ b/doc/rules-visionos.md
@@ -286,8 +286,8 @@ i.e. `--features=-swift.no_generated_header`).
load("@rules_apple//apple:visionos.doc.bzl", "visionos_ui_test")
-visionos_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
+visionos_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit, frameworks,
+ infoplists, minimum_deployment_os_version, minimum_os_version, platform_type, runner,
test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
@@ -312,6 +312,8 @@ the attributes inherited by all test rules, please check the
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"visionos"` |
@@ -330,8 +332,9 @@ the attributes inherited by all test rules, please check the
load("@rules_apple//apple:visionos.doc.bzl", "visionos_unit_test")
visionos_unit_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
- test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
+ frameworks, infoplists, minimum_deployment_os_version, minimum_os_version,
+ platform_type, runner, test_coverage_manifest, test_filter, test_host,
+ test_host_is_bundle_loader)
Builds and bundles a visionOS Unit `.xctest` test bundle. Runs the tests using the
@@ -363,6 +366,8 @@ of the attributes inherited by all test rules, please check the
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"visionos"` |
diff --git a/doc/rules-watchos.md b/doc/rules-watchos.md
index d6877b8c07..7e8d30efd4 100644
--- a/doc/rules-watchos.md
+++ b/doc/rules-watchos.md
@@ -306,8 +306,8 @@ Builds and bundles a watchOS Static Framework.
load("@rules_apple//apple:watchos.doc.bzl", "watchos_ui_test")
-watchos_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
+watchos_ui_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit, frameworks,
+ infoplists, minimum_deployment_os_version, minimum_os_version, platform_type, runner,
test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
@@ -325,6 +325,8 @@ watchOS UI Test rule.
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"watchos"` |
@@ -343,8 +345,9 @@ watchOS UI Test rule.
load("@rules_apple//apple:watchos.doc.bzl", "watchos_unit_test")
watchos_unit_test(name, deps, data, bundle_name, collect_code_coverage, env, env_inherit,
- minimum_deployment_os_version, minimum_os_version, platform_type, runner,
- test_coverage_manifest, test_filter, test_host, test_host_is_bundle_loader)
+ frameworks, infoplists, minimum_deployment_os_version, minimum_os_version,
+ platform_type, runner, test_coverage_manifest, test_filter, test_host,
+ test_host_is_bundle_loader)
watchOS Unit Test rule.
@@ -361,6 +364,8 @@ watchOS Unit Test rule.
| collect_code_coverage | Whether to collect code coverage for this test if `--collect_code_coverage=yes`. | Boolean | optional | `True` |
| env | Dictionary of environment variables that should be set during the test execution. The values of the dictionary are subject to "Make" variable expansion. | Dictionary: String -> String | optional | `{}` |
| env_inherit | List of environment variables to inherit from the external environment. | List of strings | optional | `[]` |
+| frameworks | A list of framework targets that this target depends on. | List of labels | optional | `[]` |
+| infoplists | A list of .plist files that will be merged to form the Info.plist for this target. At least one file must be specified. Please see [Info.plist Handling](https://github.com/bazelbuild/rules_apple/blob/master/doc/common_info.md#infoplist-handling) for what is supported. | List of labels | optional | `["@rules_apple//apple/testing:DefaultTestBundlePlist"]` |
| minimum_deployment_os_version | A required string indicating the minimum deployment OS version supported by the target, represented as a dotted version number (for example, "9.0"). This is different from `minimum_os_version`, which is effective at compile time. Ensure version specific APIs are guarded with `available` clauses. | String | optional | `""` |
| minimum_os_version | A required string indicating the minimum OS version supported by the target, represented as a dotted version number (for example, "9.0"). | String | required | |
| platform_type | - | String | optional | `"watchos"` |