Add support for // to resource diff script
Adds support for specifying the paths in diff_resource_sizes.py
using paths starting with //.
Bug: 759087
Change-Id: Id3874ad465d6dfdcea7e203fa16eaa4b8f1b7cff
Reviewed-on: https://chromium-review.googlesource.com/678442
Reviewed-by: Andrew Grieve <[email protected]>
Commit-Queue: Brian Sheedy <[email protected]>
Cr-Commit-Position: refs/heads/master@{#503827}
diff --git a/build/android/diff_resource_sizes.py b/build/android/diff_resource_sizes.py
index 5c306a8..84559e2 100755
--- a/build/android/diff_resource_sizes.py
+++ b/build/android/diff_resource_sizes.py
@@ -78,16 +78,23 @@
def _CreateArgparser():
+ def chromium_path(arg):
+ if arg.startswith('//'):
+ return os.path.join(host_paths.DIR_SOURCE_ROOT, arg[2:])
+ return arg
+
argparser = argparse.ArgumentParser(
description='Diff resource sizes of two APKs. Arguments not listed here '
'will be passed on to both invocations of resource_sizes.py.')
argparser.add_argument('--chromium-output-directory-base',
dest='out_dir_base',
+ type=chromium_path,
help='Location of the build artifacts for the base '
'APK, i.e. what the size increase/decrease will '
'be measured from.')
argparser.add_argument('--chromium-output-directory-diff',
dest='out_dir_diff',
+ type=chromium_path,
help='Location of the build artifacts for the diff '
'APK.')
argparser.add_argument('--chartjson',
@@ -99,13 +106,16 @@
'runs in the chartjson output.')
argparser.add_argument('--output-dir',
default='.',
+ type=chromium_path,
help='Directory to save chartjson to.')
argparser.add_argument('--base-apk',
required=True,
+ type=chromium_path,
help='Path to the base APK, i.e. what the size '
'increase/decrease will be measured from.')
argparser.add_argument('--diff-apk',
required=True,
+ type=chromium_path,
help='Path to the diff APK, i.e. the APK whose size '
'increase/decrease will be measured against the '
'base APK.')