Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions apple/internal/xctrunner.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Rule for creating a XCTRunner.app with one or more .xctest bundles. Retains same
platform and architectures as the given `tests` bundles.
"""

load(
"@build_bazel_apple_support//lib:apple_support.bzl",
"apple_support",
)
load(
"//apple:providers.bzl",
"AppleBundleInfo",
Expand Down Expand Up @@ -92,6 +96,9 @@ test_bundle_info_aspect = aspect(
)

def _xctrunner_impl(ctx):
apple_fragment = ctx.fragments.apple
xcode_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig]

output = ctx.actions.declare_directory(ctx.attr.name + ".app")
infos = [target[_TestBundleInfo] for target in ctx.attr.tests]
infoplists = depset(
Expand All @@ -117,7 +124,10 @@ def _xctrunner_impl(ctx):

args.add("--output", output.path)

ctx.actions.run(
apple_support.run(
actions = ctx.actions,
xcode_config = xcode_config,
apple_fragment = apple_fragment,
inputs = depset(transitive = [xctests, infoplists]),
outputs = [output],
executable = ctx.attr._xctrunnertool[DefaultInfo].files_to_run,
Expand Down Expand Up @@ -163,7 +173,7 @@ An executable binary that can merge separate xctest into a single XCTestRunner
bundle.
""",
),
},
} | apple_support.action_required_attrs(),
doc = """
Packages one or more .xctest bundles into a XCTRunner.app. Retains same
platform and architectures as the given `tests` bundles.
Expand All @@ -188,4 +198,5 @@ xctrunner(
)
````
""",
fragments = ["apple"],
)