Skip to content
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

Cherrypick for 4.2.0: Export proguard specs from aar_import #13705

Merged
merged 1 commit into from
Jul 19, 2021
Merged

Cherrypick for 4.2.0: Export proguard specs from aar_import #13705

merged 1 commit into from
Jul 19, 2021

Conversation

cpsauer
Copy link
Contributor

@cpsauer cpsauer commented Jul 17, 2021

Cherrypick of c8c0d94 for 4.2.0 (#13558).

Without this bug fix, using the proguard feature subtly breaks a wide range of android dependencies, including official ones from Google.

Original commit message below:

Background
#3778

proguard specs from the aar_import rule do not get bubbled up to android_binary. In this PR, I wire up a ProguardSpecProvider from this rule that exports the proguard.txt within an AAR if it exists and any transitive proguard specs from the exports attribute.

Changes

  • Add an aar_embedded_proguard_extractor script to extract proguard.txt from an AAR if it exists otherwise generate an empty proguard specs file
  • In AarImport, wire up the proguard extractor action and export results through a ProguardSpecProvider.

Once this lands, the android rules would need to be bumped.

Test Plan

  • Added tests for the extraction python script
  • Added tests for the aar_import rule changes

Closes #12749.

PiperOrigin-RevId: 359667674

**Background**
#3778

proguard specs from the `aar_import` rule do not get bubbled up to `android_binary`. In this PR, I wire up a `ProguardSpecProvider` from this rule that exports the `proguard.txt` within an AAR if it exists and any transitive proguard specs from the `exports` attribute.

**Changes**
* Add an `aar_embedded_proguard_extractor` script to extract `proguard.txt` from an AAR if it exists otherwise generate an empty proguard specs file
* In AarImport, wire up the proguard extractor action and export results through a `ProguardSpecProvider`.

Once this lands, the android rules would need to be bumped.

**Test Plan**
* Added tests for the extraction python script
* Added tests for the `aar_import` rule changes

Closes #12749.

PiperOrigin-RevId: 359667674
@cpsauer
Copy link
Contributor Author

cpsauer commented Jul 17, 2021

I don't have the permissions to assign, but this cherrypick should go to @katre, per #13558 (comment)

@katre katre self-assigned this Jul 19, 2021
@katre katre requested review from katre and removed request for lberki and ahumesky July 19, 2021 11:11
@katre katre merged commit ff9919b into bazelbuild:release-4.2.0-patches Jul 19, 2021
@katre katre mentioned this pull request Jul 19, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants