Skip to content

Commit

Permalink
Add a CoverageProcessor to migrate InstrumentedFilesInfoBuilder from …
Browse files Browse the repository at this point in the history
…Native to Starlark.

PiperOrigin-RevId: 617357883
Change-Id: I9fd61a94a41f8d49deccaae43891b29b4c5a5b75
  • Loading branch information
Zhaoqing Xu authored and copybara-github committed Mar 20, 2024
1 parent e25c68e commit 09bfe46
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rules/android_binary_internal/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,22 @@ def _process_intellij(ctx, java_package, manifest_ctx, packaged_resources_ctx, j
),
)

def _process_coverage(ctx, **_unused_ctxs):
providers = []
if acls.in_android_binary_starlark_rollout(str(ctx.label)):
providers.append(coverage_common.instrumented_files_info(
ctx,
source_attributes = ["srcs"],
dependency_attributes = ["assets", "deps", "instruments"],
))

return ProviderInfo(
name = "coverage_ctx",
value = struct(
providers = providers,
),
)

# Order dependent, as providers will not be available to downstream processors
# that may depend on the provider. Iteration order for a dictionary is based on
# insertion.
Expand All @@ -1052,6 +1068,7 @@ PROCESSORS = dict(
IdlProcessor = _process_idl,
ApkPackagingProcessor = _process_apk_packaging,
IntellijProcessor = _process_intellij,
CoverageProcessor = _process_coverage,
)

_PROCESSING_PIPELINE = processing_pipeline.make_processing_pipeline(
Expand Down

0 comments on commit 09bfe46

Please sign in to comment.