Skip to content

Commit eabea08

Browse files
xctrunner - Use apple_support.run (#2734)
Use `apple_support.run` to use the correct Xcode dirs when multiple versions are installed.
1 parent b7b640b commit eabea08

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

apple/internal/xctrunner.bzl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Rule for creating a XCTRunner.app with one or more .xctest bundles. Retains same
1717
platform and architectures as the given `tests` bundles.
1818
"""
1919

20+
load(
21+
"@build_bazel_apple_support//lib:apple_support.bzl",
22+
"apple_support",
23+
)
2024
load(
2125
"//apple:providers.bzl",
2226
"AppleBundleInfo",
@@ -92,6 +96,9 @@ test_bundle_info_aspect = aspect(
9296
)
9397

9498
def _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
163173
bundle.
164174
""",
165175
),
166-
},
176+
} | apple_support.action_required_attrs(),
167177
doc = """
168178
Packages one or more .xctest bundles into a XCTRunner.app. Retains same
169179
platform and architectures as the given `tests` bundles.
@@ -188,4 +198,5 @@ xctrunner(
188198
)
189199
````
190200
""",
201+
fragments = ["apple"],
191202
)

0 commit comments

Comments
 (0)