Move get_dexopts_supported_in_dex_merger into starlark. Also no longer pass dexopts to create_dex_merger_actions, as the internal implementation effectively filters out everything other than --forceJumbo which is not set (and I'm pretty sure the correct flag is actually --force-jumbo) PiperOrigin-RevId: 949341252 Change-Id: I9ac36eba58642628cde9a19894686c65eff61377
diff --git a/rules/dex.bzl b/rules/dex.bzl index 96ea2a8..eacbb03 100644 --- a/rules/dex.bzl +++ b/rules/dex.bzl
@@ -40,6 +40,10 @@ # Previously this was exposed via the --dexopts_supported_in_incremental_dexing native flag. _DEXOPTS_SUPPORTED_IN_INCREMENTAL_DEXING = ["--no-optimize", "--no-locals"] +# Dexing flags that are allowed in dex merger. +# Previously this was exposed via the --dexopts_supported_in_dexmerger native flag. +_DEXOPTS_SUPPORTED_IN_DEX_MERGER = ["--minimal-main-dex", "--forceJumbo"] + _tristate = _attrs.tristate def _resource_set_for_monolithic_dexing(_os, _inputs_size): @@ -80,7 +84,7 @@ includes = incremental_dexopt_filter, needs_normalization = not should_optimize_dex, ) - merger_dexopt_filter = list(ctx.fragments.android.get_dexopts_supported_in_dex_merger) + merger_dexopt_filter = list(_DEXOPTS_SUPPORTED_IN_DEX_MERGER) if should_optimize_dex: merger_dexopt_filter += _EXTRA_DEXOPTS_SUPPORTED_IN_OPTIMIZED_DEX merger_dexopts = _filter_dexopts( @@ -198,7 +202,7 @@ ctx, output = dexes, input = shards, - dexopts = dexopts, + dexopts = [], # The internal impl filters out effectively everything, so just pass an empty list dexmerger = dexmerger, min_sdk_version = min_sdk_version, )