Index: build/android/incremental_install/installer.py |
diff --git a/build/android/incremental_install/installer.py b/build/android/incremental_install/installer.py |
index 635627b90e7e08804d4edbf341a7d6d758913d0e..54fb73ef4fda461236022130390c0934c8c504a4 100755 |
--- a/build/android/incremental_install/installer.py |
+++ b/build/android/incremental_install/installer.py |
@@ -32,6 +32,9 @@ sys.path = prev_sys_path |
def _TransformDexPaths(paths): |
"""Given paths like ["/a/b/c", "/a/c/d"], returns ["b.c", "c.d"].""" |
+ if len(paths) == 1: |
+ return [os.path.basename(paths[0])] |
+ |
prefix_len = len(os.path.commonprefix(paths)) |
return [p[prefix_len:].replace(os.sep, '.') for p in paths] |
@@ -63,7 +66,8 @@ def Uninstall(device, package): |
def Install(device, apk, split_globs=None, lib_dir=None, dex_files=None, |
- enable_device_cache=True, use_concurrency=True): |
+ enable_device_cache=True, use_concurrency=True, |
+ show_proguard_warning=False): |
"""Installs the given incremental apk and all required supporting files. |
Args: |
@@ -74,6 +78,8 @@ def Install(device, apk, split_globs=None, lib_dir=None, dex_files=None, |
dex_files: List of .dex.jar files that comprise the app's Dalvik code. |
enable_device_cache: Whether to enable on-device caching of checksums. |
use_concurrency: Whether to speed things up using multiple threads. |
+ show_proguard_warning: Whether to print a warning about Proguard not being |
+ enabled after installing. |
""" |
main_timer = time_profile.TimeProfile() |
install_timer = time_profile.TimeProfile() |
@@ -180,6 +186,10 @@ def Install(device, apk, split_globs=None, lib_dir=None, dex_files=None, |
main_timer.GetDelta(), setup_timer.GetDelta(), install_timer.GetDelta(), |
push_native_timer.GetDelta(), push_dex_timer.GetDelta(), |
finalize_timer.GetDelta()) |
+ if show_proguard_warning: |
+ logging.warning('Target had proguard enabled, but incremental install uses ' |
+ 'non-proguarded .dex files. Performance characteristics ' |
+ 'may differ.') |
def main(): |
@@ -216,6 +226,10 @@ def main(): |
dest='cache', |
help='Do not use cached information about what files are ' |
'currently on the target device.') |
+ parser.add_argument('--show-proguard-warning', |
+ action='store_true', |
+ default=False, |
+ help='Print a warning about proguard being disabled') |
parser.add_argument('-v', |
'--verbose', |
dest='verbose_count', |
@@ -258,7 +272,8 @@ def main(): |
else: |
Install(device, apk, split_globs=args.splits, lib_dir=args.lib_dir, |
dex_files=args.dex_files, enable_device_cache=args.cache, |
- use_concurrency=args.threading) |
+ use_concurrency=args.threading, |
+ show_proguard_warning=args.show_proguard_warning) |
if __name__ == '__main__': |