Sort arguments and apps by ignoring case in run_on_as_app
Change-Id: I31a5663922e48ed347a368af88f3b53ac588aec2
diff --git a/tools/run_on_as_app.py b/tools/run_on_as_app.py
index 1d8b04a..a810b3a 100755
--- a/tools/run_on_as_app.py
+++ b/tools/run_on_as_app.py
@@ -265,7 +265,7 @@
BuildAppWithShrinker(app, config, shrinker, checkout_dir, out_dir,
temp_dir, options)
dex_size = ComputeSizeOfDexFilesInApk(apk_dest)
- result['apk_dest'] = apk_dest,
+ result['apk_dest'] = apk_dest
result['build_status'] = 'success'
result['dex_size'] = dex_size
result['profile_dest_dir'] = profile_dest_dir
@@ -584,6 +584,12 @@
result.add_option('--app',
help='What app to run on',
choices=APPS.keys())
+ result.add_option('--disable-tot', '--disable_tot',
+ help='Whether to disable the use of the ToT version of R8',
+ default=False,
+ action='store_true')
+ result.add_option('--gradle-flags', '--gradle_flags',
+ help='Flags to pass in to gradle')
result.add_option('--keystore',
help='Path to app.keystore',
default='app.keystore')
@@ -598,10 +604,22 @@
help='Number of events that the monkey should trigger',
default=250,
type=int)
+ result.add_option('--no-build', '--no_build',
+ help='Run without building ToT first (only when using ToT)',
+ default=False,
+ action='store_true')
result.add_option('--pull',
help='Whether to pull the latest version of each app',
default=False,
action='store_true')
+ result.add_option('--quiet',
+ help='Disable verbose logging',
+ default=False,
+ action='store_true')
+ result.add_option('--r8-compilation-steps', '--r8_compilation_steps',
+ help='Number of times R8 should be run on each app',
+ default=2,
+ type=int)
result.add_option('--sign-apks', '--sign_apks',
help='Whether the APKs should be signed',
default=False,
@@ -609,24 +627,6 @@
result.add_option('--shrinker',
help='The shrinkers to use (by default, all are run)',
action='append')
- result.add_option('--r8-compilation-steps', '--r8_compilation_steps',
- help='Number of times R8 should be run on each app',
- default=2,
- type=int)
- result.add_option('--disable-tot', '--disable_tot',
- help='Whether to disable the use of the ToT version of R8',
- default=False,
- action='store_true')
- result.add_option('--no-build', '--no_build',
- help='Run without building ToT first (only when using ToT)',
- default=False,
- action='store_true')
- result.add_option('--gradle-flags', '--gradle_flags',
- help='Flags to pass in to gradle')
- result.add_option('--quiet',
- help='Disable verbose logging',
- default=False,
- action='store_true')
(options, args) = result.parse_args(argv)
if options.disable_tot:
# r8.jar is required for recompiling the generated APK
@@ -667,7 +667,7 @@
result_per_shrinker_per_app[options.app] = GetResultsForApp(
options.app, APPS.get(options.app), options, temp_dir)
else:
- for app, config in sorted(APPS.iteritems()):
+ for app, config in sorted(APPS.iteritems(), key=lambda s: s[0].lower()):
if not config.get('skip', False):
result_per_shrinker_per_app[app] = GetResultsForApp(
app, config, options, temp_dir)