Ensure R8 is built when run_on_as_app.py is run
Add the --no-build option to not build.
When --disable-tot is specified R8 is alos not built, as is is not
used.
Bug: 122575617
Change-Id: I402001c0826d09c0135331ff0bc8931c2b9bc481
diff --git a/tools/run_on_as_app.py b/tools/run_on_as_app.py
index eab815d..28eeb2c 100755
--- a/tools/run_on_as_app.py
+++ b/tools/run_on_as_app.py
@@ -4,6 +4,7 @@
# BSD-style license that can be found in the LICENSE file.
import apk_utils
+import gradle
import os
import optparse
import subprocess
@@ -371,17 +372,21 @@
help='Whether to pull the latest version of each app',
default=False,
action='store_true')
- result.add_option('--sign_apks',
+ result.add_option('--sign-apks', '--sign_apks',
help='Whether the APKs should be signed',
default=False,
action='store_true')
result.add_option('--shrinker',
help='The shrinkers to use (by default, all are run)',
action='append')
- result.add_option('--disable_tot',
+ 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')
(options, args) = result.parse_args(argv)
if options.shrinker:
for shrinker in options.shrinker:
@@ -403,6 +408,9 @@
shrinker for shrinker in SHRINKERS
if 'minified' not in shrinker]
+ if not options.no_build and not options.disable_tot:
+ gradle.RunGradle(['r8', 'r8lib'])
+
result_per_shrinker_per_app = {}
if options.app: