Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(922)

Unified Diff: build/android/gyp/aar.py

Issue 2570313002: Use R.txt from AAR to generate R.java for it when building APK. (Closed)
Patch Set: Added workaround for aars with empty R.txt and no resources. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/gyp/process_resources.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/aar.py
diff --git a/build/android/gyp/aar.py b/build/android/gyp/aar.py
index 566cab37d98d7c3f02a9c3e1b1d5b742f01222ed..6c0bc892b0d386e1f2570c1c86856e6aea229b6a 100755
--- a/build/android/gyp/aar.py
+++ b/build/android/gyp/aar.py
@@ -77,6 +77,7 @@ def main():
data['has_classes_jar'] = False
data['has_proguard_flags'] = False
data['has_native_libraries'] = False
+ data['has_r_text_file'] = False
with zipfile.ZipFile(aar_file) as z:
data['is_manifest_empty'] = (
_IsManifestEmpty(z.read('AndroidManifest.xml')))
@@ -101,6 +102,10 @@ def main():
data['has_classes_jar'] = True
elif name == 'proguard.txt':
data['has_proguard_flags'] = True
+ elif name == 'R.txt':
+ # Some AARs, e.g. gvr_controller_java, have empty R.txt. Such AARs
+ # have no resources as well. We treat empty R.txt as having no R.txt.
+ data['has_r_text_file'] = (z.read('R.txt').strip() != '')
print gn_helpers.ToGNString(data)
« no previous file with comments | « no previous file | build/android/gyp/process_resources.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698