Skip to content

Commit

Permalink
Add an analysis time check to ensure main_dex_proguard_specs is used …
Browse files Browse the repository at this point in the history
…when multidex is legacy.

PiperOrigin-RevId: 635617623
Change-Id: If810fdec0c22238690754fe103bcebd58edfbf04
  • Loading branch information
Zhaoqing Xu authored and Copybara-Service committed May 21, 2024
1 parent 4f68718 commit da25c2b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rules/android_binary_internal/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ def _base_validations_processor(ctx, **_unused_ctxs):
if ctx.attr.min_sdk_version != 0 and not acls.in_android_binary_min_sdk_version_attribute_allowlist(str(ctx.label)):
fail("Target %s is not allowed to set a min_sdk_version value." % str(ctx.label))

if ctx.attr.multidex != "legacy" and ctx.attr.main_dex_proguard_specs:
fail("The 'main_dex_proguard_specs' attribute is only allowed if 'multidex' is set to 'legacy'")

use_r8 = acls.use_r8(str(ctx.label)) and bool(ctx.files.proguard_specs)
return ProviderInfo(
name = "validation_ctx",
Expand Down

0 comments on commit da25c2b

Please sign in to comment.