rules_android icon indicating copy to clipboard operation
rules_android copied to clipboard

Accept proguard mapping file in resource shrinker

Open mauriciogg opened this issue 1 year ago • 2 comments

Implementation of resource_shrinker cli. This is a direct copy pasta of the gradle resource shrinker https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/shrinker/src/main/java/com/android/build/shrinker/ResourceShrinkerCli.java?q=ResourceShrinkerCli With the addition of the --proguard_mapping in order to allow obfuscated builds to provide the obfuscation mapping to the resource shrinker.

This is half of the work needed to resolve https://github.com/bazelbuild/rules_android/issues/133 A follow up pr will wire the generated map by the r8 action to the srhinker action

mauriciogg avatar Sep 21 '23 17:09 mauriciogg

since the original file is "Copyright (C) 2022 The Android Open Source Project" I think we may need to set up a third_party directory and maintain the original copyright header -- but this is actually more complicated than just adding a directory to this repo, because internally we have this code in a third_party directory, and we can't have a third_party directory within the third_party directory, so we'll have to figure out what to do here

ahumesky avatar Dec 12 '23 20:12 ahumesky

since the original file is "Copyright (C) 2022 The Android Open Source Project" I think we may need to set up a third_party directory and maintain the original copyright header -- but this is actually more complicated than just adding a directory to this repo, because internally we have this code in a third_party directory, and we can't have a third_party directory within the third_party directory, so we'll have to figure out what to do here

The flag is now available in R8 (https://partnerissuetracker.corp.google.com/issues/299961324). I think we can just wait for it to be released and remove the need for the custom tool

mauriciogg avatar Dec 18 '23 18:12 mauriciogg