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

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

Issue 1451483002: [Android] Add gn support for multidex. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: agrieve comments Created 5 years, 1 month 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
« base/BUILD.gn ('K') | « base/BUILD.gn ('k') | build/android/gyp/dex.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/apkbuilder.py
diff --git a/build/android/gyp/apkbuilder.py b/build/android/gyp/apkbuilder.py
index c44173f0f941f21c179ebd68e4bdd4938206a17b..317c3c439a29799b121f6397f0b4f54b001c5b52 100755
--- a/build/android/gyp/apkbuilder.py
+++ b/build/android/gyp/apkbuilder.py
@@ -146,7 +146,12 @@ def main(args):
# ignored by md5_check.
apk.writestr('lib/%s/libplaceholder.so' % options.android_abi, ':-)')
if options.dex_file:
- apk.write(options.dex_file, 'classes.dex')
+ if options.dex_file.endswith('.zip'):
+ with zipfile.ZipFile(options.dex_file, 'r') as dex_zip:
+ for dex in (d for d in dex_zip.namelist() if d.endswith('.dex')):
+ apk.writestr(dex, dex_zip.read(dex))
+ else:
+ apk.write(options.dex_file, 'classes.dex')
shutil.move(tmp_apk, options.output_apk)
finally:
« base/BUILD.gn ('K') | « base/BUILD.gn ('k') | build/android/gyp/dex.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698