@@ -17,6 +17,10 @@ Rule for creating a XCTRunner.app with one or more .xctest bundles. Retains same
1717platform and architectures as the given `tests` bundles.
1818"""
1919
20+ load (
21+ "@build_bazel_apple_support//lib:apple_support.bzl" ,
22+ "apple_support" ,
23+ )
2024load (
2125 "//apple:providers.bzl" ,
2226 "AppleBundleInfo" ,
@@ -92,6 +96,9 @@ test_bundle_info_aspect = aspect(
9296)
9397
9498def _xctrunner_impl (ctx ):
99+ apple_fragment = ctx .fragments .apple
100+ xcode_config = ctx .attr ._xcode_config [apple_common .XcodeVersionConfig ]
101+
95102 output = ctx .actions .declare_directory (ctx .attr .name + ".app" )
96103 infos = [target [_TestBundleInfo ] for target in ctx .attr .tests ]
97104 infoplists = depset (
@@ -117,7 +124,10 @@ def _xctrunner_impl(ctx):
117124
118125 args .add ("--output" , output .path )
119126
120- ctx .actions .run (
127+ apple_support .run (
128+ actions = ctx .actions ,
129+ xcode_config = xcode_config ,
130+ apple_fragment = apple_fragment ,
121131 inputs = depset (transitive = [xctests , infoplists ]),
122132 outputs = [output ],
123133 executable = ctx .attr ._xctrunnertool [DefaultInfo ].files_to_run ,
@@ -163,7 +173,7 @@ An executable binary that can merge separate xctest into a single XCTestRunner
163173bundle.
164174""" ,
165175 ),
166- },
176+ } | apple_support . action_required_attrs () ,
167177 doc = """
168178Packages one or more .xctest bundles into a XCTRunner.app. Retains same
169179platform and architectures as the given `tests` bundles.
@@ -188,4 +198,5 @@ xctrunner(
188198)
189199````
190200""" ,
201+ fragments = ["apple" ],
191202)
0 commit comments