-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write R8 proguard mappings to a file #130
base: main
Are you sure you want to change the base?
Conversation
rules/android_binary_internal/r8.bzl
Outdated
@@ -104,6 +106,7 @@ def process_r8(ctx, jvm_ctx, packaged_resources_ctx, build_info_ctx, **_unused_c | |||
name = "r8_ctx", | |||
value = struct( | |||
final_classes_dex_zip = dexes_zip, | |||
proguard_mappings_file = proguard_mappings_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be bundled up into the AAB later either directly or by reading this file from ProguardMappingInfo
.
if ProguardMappingInfo in ctx.attr.base_module: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's also the matter of hooking this into native android_binary's proguard map implicit output, which was just recently done for the "discrete" style dex/desugar/optimize pipeline: bazelbuild/bazel@3faa686
rules/android_binary_internal/r8.bzl
Outdated
@@ -104,6 +106,7 @@ def process_r8(ctx, jvm_ctx, packaged_resources_ctx, build_info_ctx, **_unused_c | |||
name = "r8_ctx", | |||
value = struct( | |||
final_classes_dex_zip = dexes_zip, | |||
proguard_mappings_file = proguard_mappings_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's also the matter of hooking this into native android_binary's proguard map implicit output, which was just recently done for the "discrete" style dex/desugar/optimize pipeline: bazelbuild/bazel@3faa686
rules/android_binary_internal/r8.bzl
Outdated
@@ -73,9 +73,11 @@ def process_r8(ctx, jvm_ctx, packaged_resources_ctx, build_info_ctx, **_unused_c | |||
|
|||
android_jar = get_android_sdk(ctx).android_jar | |||
proguard_specs = proguard.get_proguard_specs(ctx, packaged_resources_ctx.resource_proguard_config) | |||
proguard_mappings_file = ctx.actions.declare_file(ctx.label.name + "_proguard.map") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Native android_binary generates the mapping file only if proguard_generate_mapping
is enabled: https://bazel.build/reference/be/android#android_binary.proguard_generate_mapping
617b91a
to
978790f
Compare
Support writing R8 pg mappings out to a file.