Skip to content

Commit

Permalink
Tell _incremental targets to fail fast when load_library_from_apk=true
Browse files Browse the repository at this point in the history
BUG=587584

Review URL: https://codereview.chromium.org/1709543003

Cr-Commit-Position: refs/heads/master@{#376165}
  • Loading branch information
agrieve authored and Commit bot committed Feb 18, 2016
1 parent 1289493 commit c578713
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build/android/incremental_install/create_install_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ def _ResolvePath(path):
# Exported to allow test runner to be able to install incremental apks.
def GetInstallParameters():
apk_path = {apk_path}
native_libs = {native_libs}
dex_files = {dex_files}
splits = {splits}
dont_even_try = {dont_even_try}
native_libs = {native_libs}
show_proguard_warning = {show_proguard_warning}
splits = {splits}
return dict(apk_path=_ResolvePath(apk_path),
dex_files=[_ResolvePath(p) for p in dex_files],
dont_even_try=dont_even_try,
native_libs=[_ResolvePath(p) for p in native_libs],
show_proguard_warning=show_proguard_warning,
splits=[_ResolvePath(p) for p in splits])
Expand All @@ -64,6 +66,8 @@ def main():
for split in params['splits']:
cmd_args.extend(('--split', split))
cmd_args.append(params['apk_path'])
if params['dont_even_try']:
cmd_args.extend(('--dont-even-try', params['dont_even_try']))
if params['show_proguard_warning']:
cmd_args.append('--show-proguard-warning')
return subprocess.call(cmd_args + sys.argv[1:])
Expand Down Expand Up @@ -108,6 +112,8 @@ def _ParseArgs(args):
action='store_true',
default=False,
help='Print a warning about proguard being disabled')
parser.add_argument('--dont-even-try',
help='Prints this message and exits.')

options = parser.parse_args(args)
options.dex_files += build_utils.ParseGypList(options.dex_file_list)
Expand All @@ -134,6 +140,7 @@ def relativize(path):
'output_directory': pformat(relativize(options.output_directory)),
'native_libs': pformat([relativize(p) for p in options.native_libs]),
'dex_files': pformat([relativize(p) for p in options.dex_files]),
'dont_even_try': pformat(options.dont_even_try),
'show_proguard_warning': pformat(options.show_proguard_warning),
'splits': pformat([relativize(p) for p in options.splits]),
}
Expand Down
6 changes: 6 additions & 0 deletions build/android/incremental_install/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ def main():
action='store_true',
default=False,
help='Print a warning about proguard being disabled')
parser.add_argument('--dont-even-try',
help='Prints this message and exits.')
parser.add_argument('-v',
'--verbose',
dest='verbose_count',
Expand All @@ -278,6 +280,10 @@ def main():

devil_chromium.Initialize(output_directory=constants.GetOutDirectory())

if args.dont_even_try:
logging.fatal(args.dont_even_try)
return 1

if args.device:
# Retries are annoying when commands fail for legitimate reasons. Might want
# to enable them if this is ever used on bots though.
Expand Down
3 changes: 3 additions & 0 deletions build/config/android/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,9 @@ template("android_apk") {
if (_create_language_splits) {
args += [ "--split=${_rebased_apk_path_no_ext}-language-*.apk" ]
}
if (_load_library_from_apk) {
args += [ "--dont-even-try=Incremental builds do not work with load_library_from_apk. Try setting is_component_build=true in your GN args." ]
}
}

group(target_name) {
Expand Down

0 comments on commit c578713

Please sign in to comment.