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

aar_import should propagate proguard specs #3778

Closed
aj-michael opened this issue Sep 20, 2017 · 4 comments
Closed

aar_import should propagate proguard specs #3778

aj-michael opened this issue Sep 20, 2017 · 4 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Android Issues for Android team type: feature request

Comments

@aj-michael
Copy link
Contributor

AAR files may contain a file called proguard.txt at the top level. These should be propagated up to the android_binary level and concatenated if a proguarded build is requested. This is especially important for the Android Support Libraries.

@aj-michael aj-michael added category: rules > android P2 We'll consider working on this in future. (Assignee optional) type: feature request labels Sep 20, 2017
@jin jin added team-Android Issues for Android team and removed category: rules > android labels Aug 11, 2018
nkoroste pushed a commit to nkoroste/bazel that referenced this issue Feb 23, 2021
**Background**
bazelbuild#3778
Add support for `proguard.txt` in `aar_import`

**Changes**
* Add new action and python script to extract `proguard.txt` from an aar if it exists
* Add proguard spec to `aar_import` rule's output through a `ProguardSpecProvider`

**Test Plan**
* Tested with https://github.sc-corp.net/Snapchat/rules_kotlin/pull/71
---
Automatic squash commit from https://github.sc-corp.net/Snapchat/bazel/pull/85
Cooled by bromano
bazel-io pushed a commit that referenced this issue Feb 26, 2021
**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

cpsauer commented Jul 1, 2021

Should this have been closed by #12749?

(Happened across these while searching after running into the bug--fix still unreleased, I think, right?)

@cpsauer
Copy link
Contributor

cpsauer commented Jul 8, 2021

^ tagging also @benjaminRomano and @philwo

@benjaminRomano
Copy link
Contributor

Yes, this should be resolved by #12749. @cpsauer maybe try asking in #13558 to get this cherrypicked in. My change is self-contained so it should be straightforward.

@cpsauer
Copy link
Contributor

cpsauer commented Jul 9, 2021

Done. Thanks again, guys.

I don't have the power to close the issue either--could I ask someone who can to do so? @philwo?

@philwo philwo closed this as completed Jul 9, 2021
katre pushed a commit that referenced this issue Jul 12, 2021
**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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Android Issues for Android team type: feature request
Projects
None yet
Development

No branches or pull requests

5 participants