Commit 5b72f4a3 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Add support for proguard and asset/lib expectation diffs

* Refactors more common logic for the three expectation file types
  into diff_utils.py
* Changes sort order for proguard expectations so that they diff better
* Output "actual_data" rather than .stamp files for expectation targets
* Stop writing out .proguard_configs for all proguard runs
  * I don't think these files have been referenced for a long time, and
    the expectations file largely serves their purpose in a more
    discoverable way.
* Don't define validate_expectations GN group unless it will
  have deps (to prevent thinking your GN args are correct when
  they are not).

Bug: 1064151
Change-Id: I5394471e7defd2c2f7e2f2173097a11d830cde65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314265Reviewed-by: default avatarMohamed Heikal <mheikal@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791342}
parent e8a7d2db
...@@ -111,25 +111,6 @@ def _ParseArgs(args): ...@@ -111,25 +111,6 @@ def _ParseArgs(args):
'--best-compression', '--best-compression',
action='store_true', action='store_true',
help='Use zip -9 rather than zip -1') help='Use zip -9 rather than zip -1')
parser.add_argument(
'--stamp', help='If passed, the script touches the passed in stamp file.')
parser.add_argument(
'--expected-native-libs-and-assets',
help='Expected list of native libraries and assets.')
parser.add_argument(
'--native-libs-and-assets-expectation-failure-file',
help='Write to this file if the expected list of native libraries and '
'assets does not match the actual list.')
parser.add_argument(
'--only-verify-expectations',
action="store_true",
help='When passed, the script ends execution after verifying '
'expectations.')
parser.add_argument(
'--fail-on-expectations',
action="store_true",
help='When passed, fails the build on libraries and assets expectation '
'mismatches.')
parser.add_argument( parser.add_argument(
'--library-always-compress', '--library-always-compress',
action='append', action='append',
...@@ -138,6 +119,7 @@ def _ParseArgs(args): ...@@ -138,6 +119,7 @@ def _ParseArgs(args):
'--library-renames', '--library-renames',
action='append', action='append',
help='The list of library files that we prepend crazy. to their names.') help='The list of library files that we prepend crazy. to their names.')
diff_utils.AddCommandLineFlags(parser)
options = parser.parse_args(args) options = parser.parse_args(args)
options.assets = build_utils.ParseGnList(options.assets) options.assets = build_utils.ParseGnList(options.assets)
options.uncompressed_assets = build_utils.ParseGnList( options.uncompressed_assets = build_utils.ParseGnList(
...@@ -179,9 +161,6 @@ def _ParseArgs(args): ...@@ -179,9 +161,6 @@ def _ParseArgs(args):
and options.secondary_android_abi): and options.secondary_android_abi):
raise Exception('Must specify --is-multi-abi with both --android-abi ' raise Exception('Must specify --is-multi-abi with both --android-abi '
'and --secondary-android-abi.') 'and --secondary-android-abi.')
if options.only_verify_expectations and not options.stamp:
raise Exception('Must specify --stamp when using '
'--only-verify-expectations.')
return options return options
...@@ -310,56 +289,16 @@ def _GetNativeLibrariesToAdd(native_libs, android_abi, uncompress, fast_align, ...@@ -310,56 +289,16 @@ def _GetNativeLibrariesToAdd(native_libs, android_abi, uncompress, fast_align,
return libraries_to_add return libraries_to_add
def _VerifyNativeLibsAndAssets( def _CreateExpectationsData(native_libs, assets):
native_libs, assets, expectation_file_path, """Creates list of native libraries and assets."""
unexpected_native_libs_and_assets_failure_file_path, fail_on_mismatch):
"""Verifies the native libraries and assets are as expected.
Check that the native libraries and assets being added are consistent with
the expectation file.
"""
native_libs = sorted(native_libs) native_libs = sorted(native_libs)
assets = sorted(assets) assets = sorted(assets)
with tempfile.NamedTemporaryFile() as generated_output: ret = []
for apk_path, _, compress, alignment in native_libs + assets: for apk_path, _, compress, alignment in native_libs + assets:
generated_output.write('apk_path=%s, compress=%s, alignment=%s\n' % ret.append('apk_path=%s, compress=%s, alignment=%s\n' %
(apk_path, compress, alignment)) (apk_path, compress, alignment))
return ''.join(ret)
generated_output.flush()
msg = diff_utils.DiffFileContents(
expectation_file_path, generated_output.name, show_files_compared=False)
if not msg:
return
msg_header = """\
Native Libraries and Assets expectations file needs updating. For details see:
https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/android/java/README.md
"""
sys.stderr.write(msg_header)
sys.stderr.write(msg)
if unexpected_native_libs_and_assets_failure_file_path:
build_utils.MakeDirectory(
os.path.dirname(unexpected_native_libs_and_assets_failure_file_path))
with open(unexpected_native_libs_and_assets_failure_file_path, 'w') as f:
f.write(msg_header)
f.write(msg)
if fail_on_mismatch:
sys.exit(1)
def _MaybeWriteDepAndStampFiles(options, depfile_deps):
if options.stamp:
build_utils.Touch(options.stamp)
if options.depfile:
if options.only_verify_expectations:
output = options.stamp
else:
output = options.output_apk
build_utils.WriteDepfile(options.depfile, output, inputs=depfile_deps)
def main(args): def main(args):
...@@ -430,22 +369,16 @@ def main(args): ...@@ -430,22 +369,16 @@ def main(args):
apk_dex_dir = '' apk_dex_dir = ''
def _GetAssetDetails(assets, uncompressed_assets, fast_align, allow_reads): def _GetAssetDetails(assets, uncompressed_assets, fast_align, allow_reads):
asset_details = _GetAssetsToAdd( ret = _GetAssetsToAdd(assets,
assets, fast_align, disable_compression=False, allow_reads=allow_reads) fast_align,
asset_details.extend( disable_compression=False,
_GetAssetsToAdd( allow_reads=allow_reads)
uncompressed_assets, ret.extend(
fast_align, _GetAssetsToAdd(uncompressed_assets,
disable_compression=True, fast_align,
allow_reads=allow_reads)) disable_compression=True,
return asset_details allow_reads=allow_reads))
return ret
# We compute expectations without reading the files. This allows us to check
# expectations for different targets by just generating their build_configs
# and not have to first generate all the actual files and all their
# dependencies (for example by just passing --only-verify-expectations).
expectation_asset_details = _GetAssetDetails(
assets, uncompressed_assets, fast_align, allow_reads=False)
libs_to_add = _GetNativeLibrariesToAdd( libs_to_add = _GetNativeLibrariesToAdd(
native_libs, options.android_abi, options.uncompress_shared_libraries, native_libs, options.android_abi, options.uncompress_shared_libraries,
...@@ -457,14 +390,24 @@ def main(args): ...@@ -457,14 +390,24 @@ def main(args):
options.uncompress_shared_libraries, fast_align, options.uncompress_shared_libraries, fast_align,
options.library_always_compress, options.library_renames)) options.library_always_compress, options.library_renames))
if options.expected_native_libs_and_assets: if options.expected_file:
_VerifyNativeLibsAndAssets( # We compute expectations without reading the files. This allows us to check
libs_to_add, expectation_asset_details, # expectations for different targets by just generating their build_configs
options.expected_native_libs_and_assets, # and not have to first generate all the actual files and all their
options.native_libs_and_assets_expectation_failure_file, # dependencies (for example by just passing --only-verify-expectations).
options.fail_on_expectations) asset_details = _GetAssetDetails(assets,
uncompressed_assets,
fast_align,
allow_reads=False)
actual_data = _CreateExpectationsData(libs_to_add, asset_details)
diff_utils.CheckExpectations(actual_data, options)
if options.only_verify_expectations: if options.only_verify_expectations:
_MaybeWriteDepAndStampFiles(options, depfile_deps) if options.depfile:
build_utils.WriteDepfile(options.depfile,
options.actual_file,
inputs=depfile_deps)
return return
# If we are past this point, we are going to actually create the final apk so # If we are past this point, we are going to actually create the final apk so
...@@ -598,7 +541,10 @@ def main(args): ...@@ -598,7 +541,10 @@ def main(args):
options.key_name, int(options.min_sdk_version)) options.key_name, int(options.min_sdk_version))
logging.debug('Moving file into place') logging.debug('Moving file into place')
_MaybeWriteDepAndStampFiles(options, depfile_deps) if options.depfile:
build_utils.WriteDepfile(options.depfile,
options.output_apk,
inputs=depfile_deps)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -60,31 +60,6 @@ def _ParseArgs(args): ...@@ -60,31 +60,6 @@ def _ParseArgs(args):
'--aapt2-path', required=True, help='Path to the Android aapt2 tool.') '--aapt2-path', required=True, help='Path to the Android aapt2 tool.')
input_opts.add_argument( input_opts.add_argument(
'--android-manifest', required=True, help='AndroidManifest.xml path.') '--android-manifest', required=True, help='AndroidManifest.xml path.')
input_opts.add_argument(
'--expected-file',
help='Expected contents for the check. If'
'--android-manifest-verify-diff-base is set, this is a diff file. If'
'not, this is a AndroidManifest file.')
input_opts.add_argument(
'--android-manifest-normalized', help='Normalized manifest.')
input_opts.add_argument(
'--android-manifest-expectations-failure-file',
help='Write to this file if expected manifest contents do not match '
'final manifest contents.')
input_opts.add_argument(
'--fail-on-expectations',
action="store_true",
help='When passed, fails the build on AndroidManifest expectation '
'mismatches.')
input_opts.add_argument(
'--expected-manifest-base-expectation',
help='When we expect the actual normalized manifest is different from'
'the file from --android-manifest-expected, this file specifies the'
'difference.')
input_opts.add_argument(
'--only-verify-expectations',
action='store_true',
help='If passed, only verify the android manifest expectation and exit.')
input_opts.add_argument( input_opts.add_argument(
'--r-java-root-package-name', '--r-java-root-package-name',
default='base', default='base',
...@@ -255,6 +230,7 @@ def _ParseArgs(args): ...@@ -255,6 +230,7 @@ def _ParseArgs(args):
action='store_true', action='store_true',
help='Whether resources are being generated for a bundle module.') help='Whether resources are being generated for a bundle module.')
diff_utils.AddCommandLineFlags(parser)
options = parser.parse_args(args) options = parser.parse_args(args)
resource_utils.HandleCommonOptions(options) resource_utils.HandleCommonOptions(options)
...@@ -485,41 +461,6 @@ def _FixManifest(options, temp_dir): ...@@ -485,41 +461,6 @@ def _FixManifest(options, temp_dir):
return debug_manifest_path, orig_package return debug_manifest_path, orig_package
def _VerifyManifest(actual_manifest, expected_file, normalized_manifest,
expected_manifest_base_expectation,
unexpected_manifest_failure_file, fail_on_mismatch):
with build_utils.AtomicOutput(normalized_manifest) as normalized_output:
normalized_output.write(manifest_utils.NormalizeManifest(actual_manifest))
if expected_manifest_base_expectation:
with tempfile.NamedTemporaryFile() as generated_diff:
actual_diff_content = diff_utils.GenerateDiffWithOnlyAdditons(
expected_manifest_base_expectation, normalized_manifest)
generated_diff.write(actual_diff_content)
generated_diff.flush()
msg = diff_utils.DiffFileContents(expected_file, generated_diff.name)
else:
msg = diff_utils.DiffFileContents(expected_file, normalized_manifest)
if not msg:
return
msg_header = """\
AndroidManifest.xml expectations file needs updating. For details see:
https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/android/java/README.md
"""
sys.stderr.write(msg_header)
sys.stderr.write(msg)
if unexpected_manifest_failure_file:
build_utils.MakeDirectory(os.path.dirname(unexpected_manifest_failure_file))
with open(unexpected_manifest_failure_file, 'w') as f:
f.write(msg_header)
f.write(msg)
if fail_on_mismatch:
sys.exit(1)
def _CreateKeepPredicate(resource_exclusion_regex, def _CreateKeepPredicate(resource_exclusion_regex,
resource_exclusion_exceptions): resource_exclusion_exceptions):
"""Return a predicate lambda to determine which resource files to keep. """Return a predicate lambda to determine which resource files to keep.
...@@ -1048,14 +989,10 @@ def _WriteOutputs(options, build): ...@@ -1048,14 +989,10 @@ def _WriteOutputs(options, build):
shutil.move(temp, final) shutil.move(temp, final)
def _VerifyExpectations(options): def _CreateNormalizedManifest(options):
with build_utils.TempDir() as tempdir: with build_utils.TempDir() as tempdir:
fixed_manifest, _ = _FixManifest(options, tempdir) fixed_manifest, _ = _FixManifest(options, tempdir)
_VerifyManifest(fixed_manifest, options.expected_file, return manifest_utils.NormalizeManifest(fixed_manifest)
options.android_manifest_normalized,
options.expected_manifest_base_expectation,
options.android_manifest_expectations_failure_file,
options.fail_on_expectations)
def _OnStaleMd5(options): def _OnStaleMd5(options):
...@@ -1152,9 +1089,10 @@ def main(args): ...@@ -1152,9 +1089,10 @@ def main(args):
options = _ParseArgs(args) options = _ParseArgs(args)
if options.expected_file: if options.expected_file:
_VerifyExpectations(options) actual_data = _CreateNormalizedManifest(options)
if options.only_verify_expectations: diff_utils.CheckExpectations(actual_data, options)
return if options.only_verify_expectations:
return
depfile_deps = (options.dependencies_res_zips + depfile_deps = (options.dependencies_res_zips +
options.extra_main_r_text_files + options.include_resources) options.extra_main_r_text_files + options.include_resources)
...@@ -1163,7 +1101,7 @@ def main(args): ...@@ -1163,7 +1101,7 @@ def main(args):
options.aapt2_path, options.aapt2_path,
options.android_manifest, options.android_manifest,
options.expected_file, options.expected_file,
options.expected_manifest_base_expectation, options.expected_file_base,
options.resources_config_path, options.resources_config_path,
options.shared_resources_allowlist, options.shared_resources_allowlist,
options.use_resource_ids_path, options.use_resource_ids_path,
...@@ -1171,11 +1109,11 @@ def main(args): ...@@ -1171,11 +1109,11 @@ def main(args):
] ]
input_paths = [p for p in possible_input_paths if p] input_paths = [p for p in possible_input_paths if p]
input_strings = [ input_strings = [
options.android_manifest_expectations_failure_file,
options.app_as_shared_lib, options.app_as_shared_lib,
options.arsc_package_name, options.arsc_package_name,
options.debuggable, options.debuggable,
options.extra_res_packages, options.extra_res_packages,
options.failure_file,
options.include_resources, options.include_resources,
options.locale_allowlist, options.locale_allowlist,
options.manifest_package, options.manifest_package,
...@@ -1202,7 +1140,7 @@ def main(args): ...@@ -1202,7 +1140,7 @@ def main(args):
] ]
output_paths = [options.srcjar_out] output_paths = [options.srcjar_out]
possible_output_paths = [ possible_output_paths = [
options.android_manifest_normalized, options.actual_file,
options.arsc_path, options.arsc_path,
options.emit_ids_out, options.emit_ids_out,
options.info_path, options.info_path,
......
...@@ -93,26 +93,6 @@ def _ParseOptions(): ...@@ -93,26 +93,6 @@ def _ParseOptions():
parser.add_argument( parser.add_argument(
'--extra-mapping-output-paths', '--extra-mapping-output-paths',
help='GN-list of additional paths to copy output mapping file to.') help='GN-list of additional paths to copy output mapping file to.')
parser.add_argument(
'--output-config',
help='Path to write the merged ProGuard config file to.')
parser.add_argument(
'--expected-configs-file',
help='Path to a file containing the expected merged ProGuard configs')
parser.add_argument(
'--proguard-expectations-failure-file',
help='Path to file written to if the expected merged ProGuard configs '
'differ from the generated merged ProGuard configs.')
parser.add_argument(
'--fail-on-expectations',
action="store_true",
help='When passed fails the build on proguard config expectation '
'mismatches.')
parser.add_argument(
'--only-verify-expectations',
action='store_true',
help='If passed only verifies that the proguard configs match '
'expectations but does not do any optimization with proguard/R8.')
parser.add_argument( parser.add_argument(
'--classpath', '--classpath',
action='append', action='append',
...@@ -167,12 +147,13 @@ def _ParseOptions(): ...@@ -167,12 +147,13 @@ def _ParseOptions():
parser.add_argument('--desugared-library-keep-rule-output', parser.add_argument('--desugared-library-keep-rule-output',
help='Path to desugared library keep rule output file.') help='Path to desugared library keep rule output file.')
diff_utils.AddCommandLineFlags(parser)
options = parser.parse_args(args) options = parser.parse_args(args)
if options.feature_names: if options.feature_names:
if options.output_path: if options.output_path:
parser.error('Feature splits cannot specify an output in GN.') parser.error('Feature splits cannot specify an output in GN.')
if not options.stamp: if not options.actual_file and not options.stamp:
parser.error('Feature splits require a stamp file as output.') parser.error('Feature splits require a stamp file as output.')
elif not options.output_path: elif not options.output_path:
parser.error('Output path required when feature splits aren\'t used') parser.error('Output path required when feature splits aren\'t used')
...@@ -180,12 +161,6 @@ def _ParseOptions(): ...@@ -180,12 +161,6 @@ def _ParseOptions():
if options.main_dex_rules_path and not options.r8_path: if options.main_dex_rules_path and not options.r8_path:
parser.error('R8 must be enabled to pass main dex rules.') parser.error('R8 must be enabled to pass main dex rules.')
if options.expected_configs_file and not options.output_config:
parser.error('--expected-configs-file requires --output-config')
if options.only_verify_expectations and not options.stamp:
parser.error('--only-verify-expectations requires --stamp')
options.classpath = build_utils.ParseGnList(options.classpath) options.classpath = build_utils.ParseGnList(options.classpath)
options.proguard_configs = build_utils.ParseGnList(options.proguard_configs) options.proguard_configs = build_utils.ParseGnList(options.proguard_configs)
options.input_paths = build_utils.ParseGnList(options.input_paths) options.input_paths = build_utils.ParseGnList(options.input_paths)
...@@ -206,27 +181,6 @@ def _ParseOptions(): ...@@ -206,27 +181,6 @@ def _ParseOptions():
return options return options
def _VerifyExpectedConfigs(expected_path, actual_path, failure_file_path,
fail_on_mismatch):
msg = diff_utils.DiffFileContents(expected_path, actual_path)
if not msg:
return
msg_header = """\
ProGuard flag expectations file needs updating. For details see:
https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/android/java/README.md
"""
sys.stderr.write(msg_header)
sys.stderr.write(msg)
if failure_file_path:
build_utils.MakeDirectory(os.path.dirname(failure_file_path))
with open(failure_file_path, 'w') as f:
f.write(msg_header)
f.write(msg)
if fail_on_mismatch:
sys.exit(1)
class _DexPathContext(object): class _DexPathContext(object):
def __init__(self, name, output_path, input_jars, work_dir): def __init__(self, name, output_path, input_jars, work_dir):
self.name = name self.name = name
...@@ -388,16 +342,16 @@ def _OptimizeWithR8(options, ...@@ -388,16 +342,16 @@ def _OptimizeWithR8(options,
def _CombineConfigs(configs, dynamic_config_data, exclude_generated=False): def _CombineConfigs(configs, dynamic_config_data, exclude_generated=False):
ret = [] ret = []
def add_header(name): # Sort in this way so //clank versions of the same libraries will sort
ret.append('#' * 80) # to the same spot in the file.
ret.append('# ' + name) def sort_key(path):
ret.append('#' * 80) return tuple(reversed(path.split(os.path.sep)))
for config in sorted(configs): for config in sorted(configs, key=sort_key):
if exclude_generated and config.endswith('.resources.proguard.txt'): if exclude_generated and config.endswith('.resources.proguard.txt'):
continue continue
add_header(config) ret.append('# File: ' + config)
with open(config) as config_file: with open(config) as config_file:
contents = config_file.read().rstrip() contents = config_file.read().rstrip()
...@@ -410,7 +364,7 @@ def _CombineConfigs(configs, dynamic_config_data, exclude_generated=False): ...@@ -410,7 +364,7 @@ def _CombineConfigs(configs, dynamic_config_data, exclude_generated=False):
ret.append('') ret.append('')
if dynamic_config_data: if dynamic_config_data:
add_header('Dynamically generated from build/android/gyp/proguard.py') ret.append('# File: //build/android/gyp/proguard.py (generated rules)')
ret.append(dynamic_config_data) ret.append(dynamic_config_data)
ret.append('') ret.append('')
return '\n'.join(ret) return '\n'.join(ret)
...@@ -511,26 +465,13 @@ def main(): ...@@ -511,26 +465,13 @@ def main():
proguard_configs, dynamic_config_data, exclude_generated=True) proguard_configs, dynamic_config_data, exclude_generated=True)
print_stdout = _ContainsDebuggingConfig(merged_configs) or options.verbose print_stdout = _ContainsDebuggingConfig(merged_configs) or options.verbose
if options.expected_file:
if options.expected_configs_file: diff_utils.CheckExpectations(merged_configs, options)
with tempfile.NamedTemporaryFile() as f: if options.only_verify_expectations:
f.write(merged_configs) build_utils.WriteDepfile(options.depfile,
f.flush() options.actual_file,
_VerifyExpectedConfigs(options.expected_configs_file, f.name, inputs=options.proguard_configs)
options.proguard_expectations_failure_file, return
options.fail_on_expectations)
if options.only_verify_expectations:
_MaybeWriteStampAndDepFile(options, options.proguard_configs)
return
# Writing the config output before we know ProGuard is going to succeed isn't
# great, since then a failure will result in one of the outputs being updated.
# We do it anyways though because the error message prints out the path to the
# config. Ninja will still know to re-run the command because of the other
# stale outputs.
if options.output_config:
with open(options.output_config, 'w') as f:
f.write(merged_configs)
_OptimizeWithR8(options, proguard_configs, libraries, dynamic_config_data, _OptimizeWithR8(options, proguard_configs, libraries, dynamic_config_data,
print_stdout) print_stdout)
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import os import os
import sys
import difflib import difflib
from util import build_utils from util import build_utils
...@@ -23,28 +24,29 @@ def _SkipOmitted(line): ...@@ -23,28 +24,29 @@ def _SkipOmitted(line):
return line return line
def GenerateDiffWithOnlyAdditons(expected_path, actual_path): def _GenerateDiffWithOnlyAdditons(expected_path, actual_data):
"""Generate a diff that only contains additions""" """Generate a diff that only contains additions"""
with open(expected_path) as expected, open(actual_path) as actual: # Ignore blank lines when creating the diff to cut down on whitespace-only
expected_lines = expected.readlines() # lines in the diff.
actual_lines = actual.readlines() with open(expected_path) as expected:
expected_lines = [l for l in expected.readlines() if l.strip()]
actual_lines = [l for l in actual_data.splitlines(True) if l.strip()]
diff = difflib.ndiff(expected_lines, actual_lines) diff = difflib.ndiff(expected_lines, actual_lines)
filtered_diff = (line for line in diff if line.startswith('+')) filtered_diff = (line for line in diff if line.startswith('+'))
return ''.join(filtered_diff) return ''.join(filtered_diff)
def DiffFileContents(expected_path, actual_path, show_files_compared=True): def _DiffFileContents(expected_path, actual_data):
"""Check file contents for equality and return the diff or None.""" """Check file contents for equality and return the diff or None."""
with open(expected_path) as f_expected, open(actual_path) as f_actual: with open(expected_path) as f_expected:
expected_lines = f_expected.readlines() expected_lines = f_expected.readlines()
actual_lines = [_SkipOmitted(line) for line in f_actual] actual_lines = [_SkipOmitted(line) for line in actual_data.splitlines(True)]
if expected_lines == actual_lines: if expected_lines == actual_lines:
return None return None
expected_path = os.path.relpath(expected_path, build_utils.DIR_SOURCE_ROOT) expected_path = os.path.relpath(expected_path, build_utils.DIR_SOURCE_ROOT)
actual_path = os.path.relpath(actual_path, build_utils.DIR_SOURCE_ROOT)
diff = difflib.unified_diff( diff = difflib.unified_diff(
expected_lines, expected_lines,
...@@ -53,22 +55,60 @@ def DiffFileContents(expected_path, actual_path, show_files_compared=True): ...@@ -53,22 +55,60 @@ def DiffFileContents(expected_path, actual_path, show_files_compared=True):
tofile=os.path.join('after', expected_path), tofile=os.path.join('after', expected_path),
n=0) n=0)
files_compared_msg = """\ return ''.join(diff).rstrip()
Files Compared:
* {}
* {} def AddCommandLineFlags(parser):
""".format(expected_path, actual_path) group = parser.add_argument_group('Expectations')
group.add_argument(
patch_msg = """\ '--expected-file',
If you are looking at this through LogDog, click "Raw log" before copying. help='Expected contents for the check. If --expected-file-base is set, '
See https://bugs.chromium.org/p/chromium/issues/detail?id=984616. 'this is a diff of --actual-file and --expected-file-base.')
group.add_argument(
To update the file, run: '--expected-file-base',
help='File to diff against before comparing to --expected-file.')
group.add_argument('--actual-file',
help='Path to write actual file (for reference).')
group.add_argument('--failure-file',
help='Write to this file if expectations fail.')
group.add_argument('--fail-on-expectations',
action="store_true",
help='Fail on expectation mismatches.')
group.add_argument('--only-verify-expectations',
action='store_true',
help='Verify the expectation and exit.')
def CheckExpectations(actual_data, options):
with build_utils.AtomicOutput(options.actual_file) as f:
f.write(actual_data)
if options.expected_file_base:
actual_data = _GenerateDiffWithOnlyAdditons(options.expected_file_base,
actual_data)
diff_text = _DiffFileContents(options.expected_file, actual_data)
if not diff_text:
return
fail_msg = """
Expectations need updating:
https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/android/expecations/README.md
LogDog tip: Use "Raw log" or "Switch to lite mode" before copying:
https://bugs.chromium.org/p/chromium/issues/detail?id=984616
To update expectations, run:
########### START ########### ########### START ###########
patch -p1 <<'END_DIFF' patch -p1 <<'END_DIFF'
{} {}
END_DIFF END_DIFF
############ END ############ ############ END ############
""".format(''.join(diff).rstrip()) """.format(diff_text)
return files_compared_msg + patch_msg if show_files_compared else patch_msg sys.stderr.write(fail_msg)
if options.failure_file:
build_utils.MakeDirectory(os.path.dirname(options.failure_file))
with open(options.failure_file, 'w') as f:
f.write(fail_msg)
if options.fail_on_expectations:
sys.exit(1)
...@@ -1206,15 +1206,6 @@ if (enable_java_templates) { ...@@ -1206,15 +1206,6 @@ if (enable_java_templates) {
] ]
} }
if (defined(invoker.config_output_path)) {
# Do not add as an explicit output since it's only for debugging.
_config_output_path = invoker.config_output_path
_args += [
"--output-config",
rebase_path(_config_output_path, root_build_dir),
]
}
if (_enable_jdk_library_desugaring) { if (_enable_jdk_library_desugaring) {
_args += [ _args += [
"--desugar-jdk-libs-json", "--desugar-jdk-libs-json",
...@@ -1264,22 +1255,29 @@ if (enable_java_templates) { ...@@ -1264,22 +1255,29 @@ if (enable_java_templates) {
invoker.build_config, invoker.build_config,
invoker.expected_proguard_config, invoker.expected_proguard_config,
] ]
_actual_file = "$target_gen_dir/$target_name.proguard_configs"
_failure_file = _failure_file =
"$android_configuration_failure_dir/" + "$android_configuration_failure_dir/" +
string_replace(invoker.expected_proguard_config, "/", "_") string_replace(invoker.expected_proguard_config, "/", "_")
_expectation_stamp = "$target_gen_dir/$target_name.stamp" outputs = [ _actual_file ]
outputs = [ _expectation_stamp ]
args = _args + [ args = _args + [
"--depfile", "--depfile",
rebase_path(depfile, root_build_dir), rebase_path(depfile, root_build_dir),
"--proguard-expectations-failure-file", "--failure-file",
rebase_path(_failure_file, root_build_dir), rebase_path(_failure_file, root_build_dir),
"--expected-configs-file", "--expected-file",
rebase_path(invoker.expected_proguard_config, root_build_dir), rebase_path(invoker.expected_proguard_config, root_build_dir),
"--stamp", "--actual-file",
rebase_path(_expectation_stamp, root_build_dir), rebase_path(_actual_file, root_build_dir),
"--only-verify-expectations", "--only-verify-expectations",
] ]
if (defined(invoker.expected_proguard_config_base)) {
inputs += [ invoker.expected_proguard_config_base ]
args += [
"--expected-file-base",
rebase_path(invoker.expected_proguard_config_base, root_build_dir),
]
}
if (fail_on_android_expectations) { if (fail_on_android_expectations) {
args += [ "--fail-on-expectations" ] args += [ "--fail-on-expectations" ]
} }
...@@ -1405,9 +1403,6 @@ if (enable_java_templates) { ...@@ -1405,9 +1403,6 @@ if (enable_java_templates) {
} }
if (_proguard_enabled) { if (_proguard_enabled) {
if (defined(invoker.output)) {
_proguard_output_path = invoker.output
}
_proguard_target_name = target_name _proguard_target_name = target_name
proguard(_proguard_target_name) { proguard(_proguard_target_name) {
...@@ -1420,6 +1415,7 @@ if (enable_java_templates) { ...@@ -1420,6 +1415,7 @@ if (enable_java_templates) {
"disable_checkdiscard", "disable_checkdiscard",
"disable_r8_outlining", "disable_r8_outlining",
"expected_proguard_config", "expected_proguard_config",
"expected_proguard_config_base",
"is_static_library", "is_static_library",
"modules", "modules",
"proguard_mapping_path", "proguard_mapping_path",
...@@ -1487,12 +1483,10 @@ if (enable_java_templates) { ...@@ -1487,12 +1483,10 @@ if (enable_java_templates) {
inputs += [ _main_dex_rules ] inputs += [ _main_dex_rules ]
} }
if (defined(_proguard_output_path)) { if (defined(invoker.output)) {
output_path = _proguard_output_path output_path = invoker.output
config_output_path = "$_proguard_output_path.proguard_flags"
} else { } else {
mapping_path = "$target_out_dir/$target_name.mapping" mapping_path = "$target_out_dir/$target_name.mapping"
config_output_path = "$target_out_dir/$target_name.proguard_flags"
} }
} }
} else { # !_proguard_enabled } else { # !_proguard_enabled
...@@ -2637,7 +2631,7 @@ if (enable_java_templates) { ...@@ -2637,7 +2631,7 @@ if (enable_java_templates) {
_expectations_target = _expectations_target =
"${invoker.top_target_name}_validate_android_manifest" "${invoker.top_target_name}_validate_android_manifest"
action_with_pydeps(_expectations_target) { action_with_pydeps(_expectations_target) {
_normalized_output = "${invoker.android_manifest}.normalized" _actual_file = "${invoker.android_manifest}.normalized"
_failure_file = _failure_file =
"$android_configuration_failure_dir/" + "$android_configuration_failure_dir/" +
string_replace(invoker.expected_android_manifest, "/", "_") string_replace(invoker.expected_android_manifest, "/", "_")
...@@ -2646,18 +2640,7 @@ if (enable_java_templates) { ...@@ -2646,18 +2640,7 @@ if (enable_java_templates) {
invoker.build_config, invoker.build_config,
invoker.expected_android_manifest, invoker.expected_android_manifest,
] ]
if (defined(invoker.expected_android_manifest_base)) { outputs = [ _actual_file ]
_args += [
"--expected-manifest-base-expectation",
rebase_path(invoker.expected_android_manifest_base, root_build_dir),
]
inputs += [ invoker.expected_android_manifest_base ]
}
if (fail_on_android_expectations) {
_args += [ "--fail-on-expectations" ]
}
outputs = [ _normalized_output ]
deps = [ deps = [
invoker.android_manifest_dep, invoker.android_manifest_dep,
invoker.build_config_dep, invoker.build_config_dep,
...@@ -2666,12 +2649,22 @@ if (enable_java_templates) { ...@@ -2666,12 +2649,22 @@ if (enable_java_templates) {
args = _args + [ args = _args + [
"--expected-file", "--expected-file",
rebase_path(invoker.expected_android_manifest, root_build_dir), rebase_path(invoker.expected_android_manifest, root_build_dir),
"--android-manifest-normalized", "--actual-file",
rebase_path(_normalized_output, root_build_dir), rebase_path(_actual_file, root_build_dir),
"--android-manifest-expectations-failure-file", "--failure-file",
rebase_path(_failure_file, root_build_dir), rebase_path(_failure_file, root_build_dir),
"--only-verify-expectations", "--only-verify-expectations",
] ]
if (defined(invoker.expected_android_manifest_base)) {
args += [
"--expected-file-base",
rebase_path(invoker.expected_android_manifest_base, root_build_dir),
]
inputs += [ invoker.expected_android_manifest_base ]
}
if (fail_on_android_expectations) {
args += [ "--fail-on-expectations" ]
}
} }
_deps += [ ":$_expectations_target" ] _deps += [ ":$_expectations_target" ]
} }
...@@ -2765,6 +2758,10 @@ if (enable_java_templates) { ...@@ -2765,6 +2758,10 @@ if (enable_java_templates) {
# asset information. # asset information.
# deps: Specifies the dependencies of this target. # deps: Specifies the dependencies of this target.
# dex_path: Path to classes.dex file to include (optional). # dex_path: Path to classes.dex file to include (optional).
# expected_libs_and_assets: Verify the list of included native libraries
# and assets is consistent with the given expectation file.
# expected_libs_and_assets_base: Treat expected_libs_and_assets as a diff
# with this file as the base.
# jdk_libs_dex: Path to classes.dex for desugar_jdk_libs. # jdk_libs_dex: Path to classes.dex for desugar_jdk_libs.
# packaged_resources_path: Path to .ap_ to use. # packaged_resources_path: Path to .ap_ to use.
# output_apk_path: Output path for the generated .apk. # output_apk_path: Output path for the generated .apk.
...@@ -2784,8 +2781,6 @@ if (enable_java_templates) { ...@@ -2784,8 +2781,6 @@ if (enable_java_templates) {
# keystore_password: Keystore password. # keystore_password: Keystore password.
# uncompress_shared_libraries: (optional, default false) Whether to store # uncompress_shared_libraries: (optional, default false) Whether to store
# native libraries inside the APK uncompressed and page-aligned. # native libraries inside the APK uncompressed and page-aligned.
# expected_libs_and_assets: (optional): Verify the list of included native
# libraries and assets is consistent with the given expectation file.
template("package_apk") { template("package_apk") {
forward_variables_from(invoker, forward_variables_from(invoker,
[ [
...@@ -2915,7 +2910,7 @@ if (enable_java_templates) { ...@@ -2915,7 +2910,7 @@ if (enable_java_templates) {
_expectations_target = _expectations_target =
"${invoker.top_target_name}_validate_libs_and_assets" "${invoker.top_target_name}_validate_libs_and_assets"
action_with_pydeps(_expectations_target) { action_with_pydeps(_expectations_target) {
_stamp = "$target_gen_dir/$target_name.stamp" _actual_file = "$target_gen_dir/$target_name.libs_and_assets"
_failure_file = _failure_file =
"$android_configuration_failure_dir/" + "$android_configuration_failure_dir/" +
string_replace(invoker.expected_libs_and_assets, "/", "_") string_replace(invoker.expected_libs_and_assets, "/", "_")
...@@ -2924,17 +2919,24 @@ if (enable_java_templates) { ...@@ -2924,17 +2919,24 @@ if (enable_java_templates) {
invoker.expected_libs_and_assets, invoker.expected_libs_and_assets,
] ]
deps = [ invoker.build_config_dep ] deps = [ invoker.build_config_dep ]
outputs = [ _stamp ] outputs = [ _actual_file ]
script = _script script = _script
args = _args + [ args = _args + [
"--expected-native-libs-and-assets", "--expected-file",
rebase_path(invoker.expected_libs_and_assets, root_build_dir), rebase_path(invoker.expected_libs_and_assets, root_build_dir),
"--native-libs-and-assets-expectation-failure-file", "--actual-file",
rebase_path(_actual_file, root_build_dir),
"--failure-file",
rebase_path(_failure_file, root_build_dir), rebase_path(_failure_file, root_build_dir),
"--stamp",
rebase_path(_stamp, root_build_dir),
"--only-verify-expectations", "--only-verify-expectations",
] ]
if (defined(invoker.expected_libs_and_assets_base)) {
inputs += [ invoker.expected_libs_and_assets_base ]
args += [
"--expected-file-base",
rebase_path(invoker.expected_libs_and_assets_base, root_build_dir),
]
}
if (fail_on_android_expectations) { if (fail_on_android_expectations) {
args += [ "--fail-on-expectations" ] args += [ "--fail-on-expectations" ]
} }
...@@ -4024,13 +4026,15 @@ if (enable_java_templates) { ...@@ -4024,13 +4026,15 @@ if (enable_java_templates) {
# is the path to its dex file and is passed directly to the creation script. # is the path to its dex file and is passed directly to the creation script.
# Otherwise, dex_path is undefined and we retrieve the module's dex file # Otherwise, dex_path is undefined and we retrieve the module's dex file
# using its build_config. # using its build_config.
# expected_libs_and_assets: Verify the list of included native libraries
# and assets is consistent with the given expectation file.
# expected_libs_and_assets_base: Treat expected_libs_and_assets as a diff
# with this file as the base.
# is_multi_abi: If true will add a library placeholder for the missing ABI if
# either the primary or the secondary ABI has no native libraries set.
# module_name: The module's name. # module_name: The module's name.
# native_libraries_config: Path to file listing native libraries to be # native_libraries_config: Path to file listing native libraries to be
# packaged into each module. # packaged into each module.
# is_multi_abi: If true will add a library placeholder for the missing ABI if
# either the primary or the secondary ABI has no native libraries set.
# expected_libs_and_assets: (optional): Verify the list of included native
# libraries and assets is consistent with the given expectation file.
# proguard_enabled: Optional. True if proguarding is enabled for this # proguard_enabled: Optional. True if proguarding is enabled for this
# bundle. Default is to enable this only for release builds. Note that # bundle. Default is to enable this only for release builds. Note that
# this will always perform synchronized proguarding. # this will always perform synchronized proguarding.
...@@ -4127,7 +4131,7 @@ template("create_android_app_bundle_module") { ...@@ -4127,7 +4131,7 @@ template("create_android_app_bundle_module") {
if (defined(invoker.expected_libs_and_assets)) { if (defined(invoker.expected_libs_and_assets)) {
_expectations_target = "${invoker.top_target_name}_validate_libs_and_assets" _expectations_target = "${invoker.top_target_name}_validate_libs_and_assets"
action_with_pydeps(_expectations_target) { action_with_pydeps(_expectations_target) {
_stamp = "$target_gen_dir/$target_name.stamp" _actual_file = "$target_gen_dir/$target_name.libs_and_assets"
_failure_file = "$android_configuration_failure_dir/" + _failure_file = "$android_configuration_failure_dir/" +
string_replace(invoker.expected_libs_and_assets, "/", "_") string_replace(invoker.expected_libs_and_assets, "/", "_")
inputs = [ inputs = [
...@@ -4143,17 +4147,24 @@ template("create_android_app_bundle_module") { ...@@ -4143,17 +4147,24 @@ template("create_android_app_bundle_module") {
inputs += [ invoker.secondary_abi_native_libraries_config ] inputs += [ invoker.secondary_abi_native_libraries_config ]
deps += [ invoker.secondary_abi_native_libraries_config_target ] deps += [ invoker.secondary_abi_native_libraries_config_target ]
} }
outputs = [ _stamp ] outputs = [ _actual_file ]
script = _script script = _script
args = _args + [ args = _args + [
"--expected-native-libs-and-assets", "--expected-file",
rebase_path(invoker.expected_libs_and_assets, root_build_dir), rebase_path(invoker.expected_libs_and_assets, root_build_dir),
"--native-libs-and-assets-expectation-failure-file", "--actual-file",
rebase_path(_actual_file, root_build_dir),
"--failure-file",
rebase_path(_failure_file, root_build_dir), rebase_path(_failure_file, root_build_dir),
"--stamp",
rebase_path(_stamp, root_build_dir),
"--only-verify-expectations", "--only-verify-expectations",
] ]
if (defined(invoker.expected_libs_and_assets_base)) {
inputs += [ invoker.expected_libs_and_assets_base ]
args += [
"--expected-file-base",
rebase_path(invoker.expected_libs_and_assets_base, root_build_dir),
]
}
if (fail_on_android_expectations) { if (fail_on_android_expectations) {
args += [ "--fail-on-expectations" ] args += [ "--fail-on-expectations" ]
} }
......
...@@ -2130,9 +2130,14 @@ if (enable_java_templates) { ...@@ -2130,9 +2130,14 @@ if (enable_java_templates) {
# main_component_library: Specifies the name of the base component's library # main_component_library: Specifies the name of the base component's library
# in a component build. If given, the system will find dependent native # in a component build. If given, the system will find dependent native
# libraries at runtime by inspecting this library (optional). # libraries at runtime by inspecting this library (optional).
# expected_libs_and_assets: (optional): Verify the list # expected_libs_and_assets: Verify the list of included native libraries
# of included native libraries and assets is consistent with the given # and assets is consistent with the given expectation file.
# expectation file. # expected_libs_and_assets_base: Treat expected_libs_and_assets as a diff
# with this file as the base.
# expected_proguard_config: Checks that the merged set of proguard flags
# matches the given config.
# expected_proguard_config_base: Treat expected_proguard_config as a diff
# with this file as the base.
template("android_apk_or_module") { template("android_apk_or_module") {
forward_variables_from(invoker, [ "testonly" ]) forward_variables_from(invoker, [ "testonly" ])
assert(defined(invoker.android_manifest)) assert(defined(invoker.android_manifest))
...@@ -3130,6 +3135,7 @@ if (enable_java_templates) { ...@@ -3130,6 +3135,7 @@ if (enable_java_templates) {
forward_variables_from(invoker, forward_variables_from(invoker,
[ [
"expected_libs_and_assets", "expected_libs_and_assets",
"expected_libs_and_assets_base",
"native_lib_placeholders", "native_lib_placeholders",
"secondary_abi_loadable_modules", "secondary_abi_loadable_modules",
"secondary_native_lib_placeholders", "secondary_native_lib_placeholders",
...@@ -3453,6 +3459,10 @@ if (enable_java_templates) { ...@@ -3453,6 +3459,10 @@ if (enable_java_templates) {
"enable_jetify", "enable_jetify",
"enable_multidex", "enable_multidex",
"enable_native_mocks", "enable_native_mocks",
"expected_android_manifest",
"expected_android_manifest_base",
"expected_libs_and_assets",
"expected_libs_and_assets_base",
"generate_buildconfig_java", "generate_buildconfig_java",
"generate_final_jni", "generate_final_jni",
"input_jars_paths", "input_jars_paths",
...@@ -3514,9 +3524,6 @@ if (enable_java_templates) { ...@@ -3514,9 +3524,6 @@ if (enable_java_templates) {
"library_always_compress", "library_always_compress",
"library_renames", "library_renames",
"use_chromium_linker", "use_chromium_linker",
"expected_android_manifest",
"expected_android_manifest_base",
"expected_libs_and_assets",
"version_code", "version_code",
"version_name", "version_name",
]) ])
...@@ -3588,6 +3595,8 @@ if (enable_java_templates) { ...@@ -3588,6 +3595,8 @@ if (enable_java_templates) {
"data_deps", "data_deps",
"deps", "deps",
"enable_multidex", "enable_multidex",
"expected_android_manifest",
"expected_android_manifest_base",
"generate_buildconfig_java", "generate_buildconfig_java",
"generate_final_jni", "generate_final_jni",
"input_jars_paths", "input_jars_paths",
...@@ -3639,8 +3648,6 @@ if (enable_java_templates) { ...@@ -3639,8 +3648,6 @@ if (enable_java_templates) {
"library_renames", "library_renames",
"use_chromium_linker", "use_chromium_linker",
"use_modern_linker", "use_modern_linker",
"expected_android_manifest",
"expected_android_manifest_base",
"version_code", "version_code",
"version_name", "version_name",
]) ])
...@@ -4469,18 +4476,20 @@ if (enable_java_templates) { ...@@ -4469,18 +4476,20 @@ if (enable_java_templates) {
# avoid library duplication. Effectively, the static library will be # avoid library duplication. Effectively, the static library will be
# treated as the parent of the base module. # treated as the parent of the base module.
# #
# expected_libs_and_assets: Verify the list of included native libraries
# and assets is consistent with the given expectation file.
# expected_libs_and_assets_base: Treat expected_libs_and_assets as a diff
# with this file as the base.
# expected_proguard_config: Checks that the merged set of proguard flags # expected_proguard_config: Checks that the merged set of proguard flags
# matches the given config. # matches the given config.
# expected_proguard_config_base: Treat expected_proguard_config as a diff
# with this file as the base.
# #
# version_code: Optional. Version code of the target. # version_code: Optional. Version code of the target.
# #
# is_multi_abi: If true will add a library placeholder for the missing ABI # is_multi_abi: If true will add a library placeholder for the missing ABI
# if either the primary or the secondary ABI has no native libraries set. # if either the primary or the secondary ABI has no native libraries set.
# #
# expected_libs_and_assets: (optional): Verify the list
# of included native libraries and assets is consistent with the given
# expectation file.
#
# default_modules_for_testing: (optional): A list of DFM that the wrapper # default_modules_for_testing: (optional): A list of DFM that the wrapper
# script should install. This is for local testing only, and does not # script should install. This is for local testing only, and does not
# affect the actual DFM in production. # affect the actual DFM in production.
...@@ -4704,6 +4713,7 @@ if (enable_java_templates) { ...@@ -4704,6 +4713,7 @@ if (enable_java_templates) {
forward_variables_from(invoker, forward_variables_from(invoker,
[ [
"expected_proguard_config", "expected_proguard_config",
"expected_proguard_config_base",
"min_sdk_version", "min_sdk_version",
]) ])
if (defined(expected_proguard_config)) { if (defined(expected_proguard_config)) {
...@@ -4758,8 +4768,12 @@ if (enable_java_templates) { ...@@ -4758,8 +4768,12 @@ if (enable_java_templates) {
if (module_name == "base" && if (module_name == "base" &&
defined(invoker.expected_libs_and_assets)) { defined(invoker.expected_libs_and_assets)) {
forward_variables_from(invoker,
[
"expected_libs_and_assets",
"expected_libs_and_assets_base",
])
top_target_name = _target_name top_target_name = _target_name
expected_libs_and_assets = invoker.expected_libs_and_assets
build_config_target = _module_build_config_target build_config_target = _module_build_config_target
native_libraries_config_target = ":$_native_libraries_config_target" native_libraries_config_target = ":$_native_libraries_config_target"
if (defined(android_app_secondary_abi)) { if (defined(android_app_secondary_abi)) {
......
...@@ -3243,25 +3243,27 @@ generate_jni("native_j_unittests_jni_headers") { ...@@ -3243,25 +3243,27 @@ generate_jni("native_j_unittests_jni_headers") {
feature_list_file = "//chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java" feature_list_file = "//chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java"
} }
# Used by android-binary-size trybot to know which expectations to validate. # Used by android-binary-size trybot to validate expectations.
group("validate_expectations") { if (_enable_libs_and_assets_verification || _enable_manifest_verification) {
deps = [] group("validate_expectations") {
if (_enable_libs_and_assets_verification) { deps = []
deps += [ if (_enable_libs_and_assets_verification) {
":chrome_modern_public_bundle_validate_libs_and_assets", deps += [
":monochrome_public_bundle_validate_libs_and_assets", ":chrome_modern_public_bundle_validate_libs_and_assets",
":trichrome_chrome_bundle_validate_libs_and_assets", ":monochrome_public_bundle_validate_libs_and_assets",
":trichrome_library_apk_validate_libs_and_assets", ":trichrome_chrome_bundle_validate_libs_and_assets",
] ":trichrome_library_apk_validate_libs_and_assets",
} ]
if (_enable_manifest_verification) { }
deps += [ if (_enable_manifest_verification) {
":monochrome_public_bundle__base_bundle_module_validate_android_manifest", deps += [
":monochrome_public_bundle_validate_proguard_config", ":monochrome_public_bundle__base_bundle_module_validate_android_manifest",
":trichrome_chrome_bundle__base_bundle_module_validate_android_manifest", ":monochrome_public_bundle_validate_proguard_config",
":trichrome_library_apk_validate_android_manifest", ":trichrome_chrome_bundle__base_bundle_module_validate_android_manifest",
"//android_webview:system_webview_base_bundle_module_validate_android_manifest", ":trichrome_library_apk_validate_android_manifest",
"//android_webview:trichrome_webview_base_bundle_module_validate_android_manifest", "//android_webview:system_webview_base_bundle_module_validate_android_manifest",
] "//android_webview:trichrome_webview_base_bundle_module_validate_android_manifest",
]
}
} }
} }
################################################################################ # File: ../../third_party/android_deps/androidx_mediarouter.flags
# ../../android_webview/nonembedded/java/proguard.flags # Copyright 2019 The Chromium Authors. All rights reserved.
################################################################################
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
-keepclassmembers class org.chromium.android_webview.AwPdfExporter { # Help R8 to remove debug related coded. All of these static constants are
android.view.ViewGroup mContainerView; # initialized to: Log.isLoggable(DEBUG, TAG).
}
# Keep the factory and its public members; it's the main entry point used by the
# framework.
-keep class com.android.webview.chromium.WebViewChromiumFactoryProvider {
public *;
}
-keep class * implements android.webkit.WebViewFactoryProvider$Statics {
*;
}
-keep class com.android.webview.chromium.ContentSettingsAdapter {
public *;
}
-keep class com.android.webview.chromium.WebViewChromiumFactoryProviderFor* {
public *;
}
-keep class com.android.webview.chromium.WebViewDatabaseAdapter {
public *;
}
# This is the main entry point for APIs. It is kept to make developing with
# unreleased Android easier.
-keep class com.android.webview.chromium.WebViewChromium {
public *;
}
# Functor classes with native methods implemented in Android.
-keep class com.android.webview.chromium.DrawFunctor
-keep class com.android.webview.chromium.DrawGLFunctor
-keep class com.android.webview.chromium.GraphicsUtils
# The lock file object must be kept explicitly to avoid it being optimized
# away and the lock released by the object's finalizer.
-keep class org.chromium.android_webview.AwDataDirLock {
java.nio.channels.FileLock sExclusiveFileLock;
java.io.RandomAccessFile sLockFile;
}
# Workaround for crbug/1002847. Methods of BaseGmsClient are incorrectly -assumevalues class androidx.mediarouter.** {
# removed even though they are required for the derived class GmsClient static boolean DEBUG return false;
# to correctly implement Api$Client.
# TODO: remove once crbug/1002847 resolved.
-keep public class com.google.android.gms.common.internal.BaseGmsClient {
public void disconnect();
public void dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[]);
public int getMinApkVersion();
public boolean requiresSignIn();
} }
################################################################################ # File: ../../base/android/proguard/chromium_apk.flags
# ../../android_webview/support_library/boundary_interfaces/proguard.flags
################################################################################
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# We need to avoid obfuscating the support library boundary interface because
# this API is shared with the Android Support Library.
# Note that we only 'keep' the package org.chromium.support_lib_boundary itself,
# any sub-packages of that package can still be obfuscated.
-keep public class org.chromium.support_lib_boundary.* { public *; }
################################################################################
# ../../base/android/proguard/chromium_apk.flags
################################################################################
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -162,9 +97,7 @@ ...@@ -162,9 +97,7 @@
public boolean requiresSignIn(); public boolean requiresSignIn();
} }
################################################################################ # File: ../../base/android/proguard/chromium_code.flags
# ../../base/android/proguard/chromium_code.flags
################################################################################
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -265,20 +198,7 @@ ...@@ -265,20 +198,7 @@
public static **[] values(); public static **[] values();
} }
################################################################################ # File: ../../build/android/dcheck_is_off.flags
# ../../base/android/proguard/enable_obfuscation.flags
################################################################################
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# As of August 11, 2016, obfuscation was found to save 660kb on our .dex size
# and 53kb memory/process (through shrinking method/string counts).
-repackageclasses ''
################################################################################
# ../../build/android/dcheck_is_off.flags
################################################################################
# Copyright 2019 The Chromium Authors. All rights reserved. # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -297,42 +217,16 @@ ...@@ -297,42 +217,16 @@
@org.chromium.base.annotations.RemovableInRelease *; @org.chromium.base.annotations.RemovableInRelease *;
} }
################################################################################ # File: ../../base/android/proguard/enable_obfuscation.flags
# ../../chrome/android/features/start_surface/internal/proguard.flags # Copyright 2016 The Chromium Authors. All rights reserved.
################################################################################
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# To fix crbug/1017396. This is because AppBarLayout$ScrollingViewBehavior # As of August 11, 2016, obfuscation was found to save 660kb on our .dex size
# is instantiated via java.lang.reflect.Constructor in CoordinatorLayout.java. # and 53kb memory/process (through shrinking method/string counts).
# Note that AppBarLayout$Behavior is needed to keep the scrolling behavior. -repackageclasses ''
# TODO(bjoyce): Remove the android support library keep after verifying
# AndroidX migration is sound.
-keep class android.support.design.widget.AppBarLayout$Behavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
-keep class android.support.design.widget.AppBarLayout$ScrollingViewBehavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
# To fix crbug/1017396. This is because AppBarLayout$ScrollingViewBehavior
# is instantiated via java.lang.reflect.Constructor in CoordinatorLayout.java.
# Note that AppBarLayout$Behavior is needed to keep the scrolling behavior.
-keep class com.google.android.material.appbar.AppBarLayout$Behavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
-keep class com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
################################################################################ # File: ../../chrome/android/proguard/main.flags
# ../../chrome/android/proguard/main.flags
################################################################################
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -393,80 +287,11 @@ ...@@ -393,80 +287,11 @@
*** build() return null; *** build() return null;
} }
################################################################################ # File: ../../third_party/gvr-android-sdk/proguard-gvr-chromium.txt
# ../../third_party/android_deps/androidx_mediarouter.flags
################################################################################
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Help R8 to remove debug related coded. All of these static constants are
# initialized to: Log.isLoggable(DEBUG, TAG).
-assumevalues class androidx.mediarouter.** {
static boolean DEBUG return false;
}
################################################################################
# ../../third_party/arcore-android-sdk-client/proguard.txt
################################################################################
# Keep ARCore public-facing classes
# This line from the ARCore SDK's .aar should not be needed when consuming ARCore SDK:
# -keepparameternames
# These are part of the Java <-> native interfaces for ARCore.
-keepclasseswithmembernames,includedescriptorclasses class !com.google.ar.core.viewer.**, !com.google.ar.core.services.logging.**, !com.google.ar.sceneform.**, com.google.ar.** {
native <methods>;
}
# This line from the ARCore SDK's .aar should not be needed when consuming ARCore SDK:
# -keep public class !com.google.ar.core.viewer.**, !com.google.ar.core**.R$*, !com.google.ar.core.services.logging.**, com.google.ar.core.** {*;}
# If you need to build a library on top of arcore_client, and use this library for your project
# Please un-comment this line below.
# -keepattributes *Annotation*
-keep class com.google.ar.core.annotations.UsedByNative
-keep @com.google.ar.core.annotations.UsedByNative class *
-keepclassmembers class * {
@com.google.ar.core.annotations.UsedByNative *;
}
-keep class com.google.ar.core.annotations.UsedByReflection
-keep @com.google.ar.core.annotations.UsedByReflection class *
-keepclassmembers class * {
@com.google.ar.core.annotations.UsedByReflection *;
}
# Keep Dynamite classes
# .aidl file will be proguarded, we should keep all Aidls.
# These lines from the ARCore SDK's .aar should not be needed when consuming ARCore SDK:
# -keep class com.google.vr.dynamite.client.IObjectWrapper { *; }
# -keep class com.google.vr.dynamite.client.ILoadedInstanceCreator { *; }
# -keep class com.google.vr.dynamite.client.INativeLibraryLoader { *; }
# Keep annotation files and the file got annotated.
-keep class com.google.vr.dynamite.client.UsedByNative
-keep @com.google.vr.dynamite.client.UsedByNative class *
-keepclassmembers class * {
@com.google.vr.dynamite.client.UsedByNative *;
}
-keep class com.google.vr.dynamite.client.UsedByReflection
-keep @com.google.vr.dynamite.client.UsedByReflection class *
-keepclassmembers class * {
@com.google.vr.dynamite.client.UsedByReflection *;
}
################################################################################
# ../../third_party/gvr-android-sdk/proguard-gvr-chromium.txt
################################################################################
-dontwarn com.google.common.logging.nano.Vr$** -dontwarn com.google.common.logging.nano.Vr$**
-dontwarn com.google.vr.** -dontwarn com.google.vr.**
################################################################################ # File: ../../third_party/gvr-android-sdk/src/proguard-gvr.txt
# ../../third_party/gvr-android-sdk/src/proguard-gvr.txt
################################################################################
# Don't obfuscate any NDK/SDK code. This makes the debugging of stack traces # Don't obfuscate any NDK/SDK code. This makes the debugging of stack traces
# in release builds easier. # in release builds easier.
-keepnames class com.google.vr.ndk.** { *; } -keepnames class com.google.vr.ndk.** { *; }
...@@ -502,9 +327,109 @@ ...@@ -502,9 +327,109 @@
-dontwarn com.google.protobuf.nano.NanoEnumValue -dontwarn com.google.protobuf.nano.NanoEnumValue
################################################################################ # File: ../../android_webview/support_library/boundary_interfaces/proguard.flags
# obj/third_party/android_deps/androidx_appcompat_appcompat_java/proguard.txt # Copyright 2018 The Chromium Authors. All rights reserved.
################################################################################ # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# We need to avoid obfuscating the support library boundary interface because
# this API is shared with the Android Support Library.
# Note that we only 'keep' the package org.chromium.support_lib_boundary itself,
# any sub-packages of that package can still be obfuscated.
-keep public class org.chromium.support_lib_boundary.* { public *; }
# File: ../../chrome/android/features/start_surface/internal/proguard.flags
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# To fix crbug/1017396. This is because AppBarLayout$ScrollingViewBehavior
# is instantiated via java.lang.reflect.Constructor in CoordinatorLayout.java.
# Note that AppBarLayout$Behavior is needed to keep the scrolling behavior.
# TODO(bjoyce): Remove the android support library keep after verifying
# AndroidX migration is sound.
-keep class android.support.design.widget.AppBarLayout$Behavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
-keep class android.support.design.widget.AppBarLayout$ScrollingViewBehavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
# To fix crbug/1017396. This is because AppBarLayout$ScrollingViewBehavior
# is instantiated via java.lang.reflect.Constructor in CoordinatorLayout.java.
# Note that AppBarLayout$Behavior is needed to keep the scrolling behavior.
-keep class com.google.android.material.appbar.AppBarLayout$Behavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
-keep class com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
# File: ../../android_webview/nonembedded/java/proguard.flags
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-keepclassmembers class org.chromium.android_webview.AwPdfExporter {
android.view.ViewGroup mContainerView;
}
# Keep the factory and its public members; it's the main entry point used by the
# framework.
-keep class com.android.webview.chromium.WebViewChromiumFactoryProvider {
public *;
}
-keep class * implements android.webkit.WebViewFactoryProvider$Statics {
*;
}
-keep class com.android.webview.chromium.ContentSettingsAdapter {
public *;
}
-keep class com.android.webview.chromium.WebViewChromiumFactoryProviderFor* {
public *;
}
-keep class com.android.webview.chromium.WebViewDatabaseAdapter {
public *;
}
# This is the main entry point for APIs. It is kept to make developing with
# unreleased Android easier.
-keep class com.android.webview.chromium.WebViewChromium {
public *;
}
# Functor classes with native methods implemented in Android.
-keep class com.android.webview.chromium.DrawFunctor
-keep class com.android.webview.chromium.DrawGLFunctor
-keep class com.android.webview.chromium.GraphicsUtils
# The lock file object must be kept explicitly to avoid it being optimized
# away and the lock released by the object's finalizer.
-keep class org.chromium.android_webview.AwDataDirLock {
java.nio.channels.FileLock sExclusiveFileLock;
java.io.RandomAccessFile sLockFile;
}
# Workaround for crbug/1002847. Methods of BaseGmsClient are incorrectly
# removed even though they are required for the derived class GmsClient
# to correctly implement Api$Client.
# TODO: remove once crbug/1002847 resolved.
-keep public class com.google.android.gms.common.internal.BaseGmsClient {
public void disconnect();
public void dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[]);
public int getMinApkVersion();
public boolean requiresSignIn();
}
# File: obj/third_party/android_deps/androidx_appcompat_appcompat_java/proguard.txt
# Copyright (C) 2018 The Android Open Source Project # Copyright (C) 2018 The Android Open Source Project
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
...@@ -528,9 +453,7 @@ ...@@ -528,9 +453,7 @@
<methods>; <methods>;
} }
################################################################################ # File: obj/third_party/android_deps/androidx_lifecycle_lifecycle_viewmodel_savedstate_java/proguard.txt
# obj/third_party/android_deps/androidx_lifecycle_lifecycle_viewmodel_savedstate_java/proguard.txt
################################################################################
-keepclassmembers,allowobfuscation class * extends androidx.lifecycle.ViewModel { -keepclassmembers,allowobfuscation class * extends androidx.lifecycle.ViewModel {
<init>(androidx.lifecycle.SavedStateHandle); <init>(androidx.lifecycle.SavedStateHandle);
} }
...@@ -539,9 +462,7 @@ ...@@ -539,9 +462,7 @@
<init>(android.app.Application,androidx.lifecycle.SavedStateHandle); <init>(android.app.Application,androidx.lifecycle.SavedStateHandle);
} }
################################################################################ # File: obj/third_party/android_deps/androidx_media_media_java/proguard.txt
# obj/third_party/android_deps/androidx_media_media_java/proguard.txt
################################################################################
# Copyright (C) 2017 The Android Open Source Project # Copyright (C) 2017 The Android Open Source Project
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
...@@ -566,9 +487,7 @@ ...@@ -566,9 +487,7 @@
public static final android.os.Parcelable$Creator *; public static final android.os.Parcelable$Creator *;
} }
################################################################################ # File: obj/third_party/android_deps/androidx_recyclerview_recyclerview_java/proguard.txt
# obj/third_party/android_deps/androidx_recyclerview_recyclerview_java/proguard.txt
################################################################################
# Copyright (C) 2015 The Android Open Source Project # Copyright (C) 2015 The Android Open Source Project
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
...@@ -595,9 +514,7 @@ ...@@ -595,9 +514,7 @@
public boolean isLayoutSuppressed(); public boolean isLayoutSuppressed();
} }
################################################################################ # File: obj/third_party/android_deps/androidx_savedstate_savedstate_java/proguard.txt
# obj/third_party/android_deps/androidx_savedstate_savedstate_java/proguard.txt
################################################################################
# Copyright (C) 2019 The Android Open Source Project # Copyright (C) 2019 The Android Open Source Project
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
...@@ -616,9 +533,7 @@ ...@@ -616,9 +533,7 @@
<init>(); <init>();
} }
################################################################################ # File: obj/third_party/android_deps/androidx_transition_transition_java/proguard.txt
# obj/third_party/android_deps/androidx_transition_transition_java/proguard.txt
################################################################################
# Copyright (C) 2017 The Android Open Source Project # Copyright (C) 2017 The Android Open Source Project
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
...@@ -638,9 +553,7 @@ ...@@ -638,9 +553,7 @@
androidx.transition.ChangeBounds$ViewBounds mViewBounds; androidx.transition.ChangeBounds$ViewBounds mViewBounds;
} }
################################################################################ # File: obj/third_party/android_deps/androidx_vectordrawable_vectordrawable_animated_java/proguard.txt
# obj/third_party/android_deps/androidx_vectordrawable_vectordrawable_animated_java/proguard.txt
################################################################################
# Copyright (C) 2016 The Android Open Source Project # Copyright (C) 2016 The Android Open Source Project
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
...@@ -661,25 +574,68 @@ ...@@ -661,25 +574,68 @@
*** get*(); *** get*();
} }
################################################################################ # File: obj/third_party/android_deps/androidx_versionedparcelable_versionedparcelable_java/proguard.txt
# obj/third_party/android_deps/androidx_versionedparcelable_versionedparcelable_java/proguard.txt
################################################################################
-keep public class * implements androidx.versionedparcelable.VersionedParcelable -keep public class * implements androidx.versionedparcelable.VersionedParcelable
-keep public class android.support.**Parcelizer { *; } -keep public class android.support.**Parcelizer { *; }
-keep public class androidx.**Parcelizer { *; } -keep public class androidx.**Parcelizer { *; }
-keep public class androidx.versionedparcelable.ParcelImpl -keep public class androidx.versionedparcelable.ParcelImpl
################################################################################ # File: ../../third_party/arcore-android-sdk-client/proguard.txt
# obj/third_party/android_deps/google_play_services_base_java/proguard.txt # Keep ARCore public-facing classes
################################################################################ # This line from the ARCore SDK's .aar should not be needed when consuming ARCore SDK:
# -keepparameternames
# These are part of the Java <-> native interfaces for ARCore.
-keepclasseswithmembernames,includedescriptorclasses class !com.google.ar.core.viewer.**, !com.google.ar.core.services.logging.**, !com.google.ar.sceneform.**, com.google.ar.** {
native <methods>;
}
# This line from the ARCore SDK's .aar should not be needed when consuming ARCore SDK:
# -keep public class !com.google.ar.core.viewer.**, !com.google.ar.core**.R$*, !com.google.ar.core.services.logging.**, com.google.ar.core.** {*;}
# If you need to build a library on top of arcore_client, and use this library for your project
# Please un-comment this line below.
# -keepattributes *Annotation*
-keep class com.google.ar.core.annotations.UsedByNative
-keep @com.google.ar.core.annotations.UsedByNative class *
-keepclassmembers class * {
@com.google.ar.core.annotations.UsedByNative *;
}
-keep class com.google.ar.core.annotations.UsedByReflection
-keep @com.google.ar.core.annotations.UsedByReflection class *
-keepclassmembers class * {
@com.google.ar.core.annotations.UsedByReflection *;
}
# Keep Dynamite classes
# .aidl file will be proguarded, we should keep all Aidls.
# These lines from the ARCore SDK's .aar should not be needed when consuming ARCore SDK:
# -keep class com.google.vr.dynamite.client.IObjectWrapper { *; }
# -keep class com.google.vr.dynamite.client.ILoadedInstanceCreator { *; }
# -keep class com.google.vr.dynamite.client.INativeLibraryLoader { *; }
# Keep annotation files and the file got annotated.
-keep class com.google.vr.dynamite.client.UsedByNative
-keep @com.google.vr.dynamite.client.UsedByNative class *
-keepclassmembers class * {
@com.google.vr.dynamite.client.UsedByNative *;
}
-keep class com.google.vr.dynamite.client.UsedByReflection
-keep @com.google.vr.dynamite.client.UsedByReflection class *
-keepclassmembers class * {
@com.google.vr.dynamite.client.UsedByReflection *;
}
# File: obj/third_party/android_deps/google_play_services_base_java/proguard.txt
# b/35135904 Ensure that proguard will not strip the mResultGuardian. # b/35135904 Ensure that proguard will not strip the mResultGuardian.
-keepclassmembers class com.google.android.gms.common.api.internal.BasePendingResult { -keepclassmembers class com.google.android.gms.common.api.internal.BasePendingResult {
com.google.android.gms.common.api.internal.BasePendingResult$ReleasableResultGuardian mResultGuardian; com.google.android.gms.common.api.internal.BasePendingResult$ReleasableResultGuardian mResultGuardian;
} }
################################################################################ # File: obj/third_party/android_deps/google_play_services_basement_java/proguard.txt
# obj/third_party/android_deps/google_play_services_basement_java/proguard.txt
################################################################################
# Proguard flags for consumers of the Google Play services SDK # Proguard flags for consumers of the Google Play services SDK
# https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project # https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project
...@@ -738,14 +694,10 @@ ...@@ -738,14 +694,10 @@
-dontwarn javax.annotation.** -dontwarn javax.annotation.**
-dontwarn org.checkerframework.** -dontwarn org.checkerframework.**
################################################################################ # File: obj/third_party/android_deps/google_play_services_cast_framework_java/proguard.txt
# obj/third_party/android_deps/google_play_services_cast_framework_java/proguard.txt
################################################################################
-keep public class * implements com.google.android.gms.cast.framework.OptionsProvider -keep public class * implements com.google.android.gms.cast.framework.OptionsProvider
################################################################################ # File: obj/third_party/android_deps/google_play_services_clearcut_java/proguard.txt
# obj/third_party/android_deps/google_play_services_clearcut_java/proguard.txt
################################################################################
# We keep all fields for every generated proto file as the runtime uses # We keep all fields for every generated proto file as the runtime uses
# reflection over them that ProGuard cannot detect. Without this keep # reflection over them that ProGuard cannot detect. Without this keep
# rule, fields may be removed that would cause runtime failures. # rule, fields may be removed that would cause runtime failures.
...@@ -753,24 +705,18 @@ ...@@ -753,24 +705,18 @@
<fields>; <fields>;
} }
################################################################################ # File: obj/third_party/android_deps/google_play_services_fido_java/proguard.txt
# obj/third_party/android_deps/google_play_services_fido_java/proguard.txt
################################################################################
# Methods enable and disable in this class are complained as unresolved # Methods enable and disable in this class are complained as unresolved
# references, but they are system APIs and are not used by Fido client apps. # references, but they are system APIs and are not used by Fido client apps.
-dontwarn android.nfc.NfcAdapter -dontwarn android.nfc.NfcAdapter
################################################################################ # File: obj/third_party/android_deps/google_play_services_gcm_java/proguard.txt
# obj/third_party/android_deps/google_play_services_gcm_java/proguard.txt
################################################################################
# Ensure that proguard will not strip the handleIntent method. # Ensure that proguard will not strip the handleIntent method.
-keepclassmembers class com.google.android.gms.gcm.GcmListenerService { -keepclassmembers class com.google.android.gms.gcm.GcmListenerService {
public void handleIntent(android.content.Intent); public void handleIntent(android.content.Intent);
} }
################################################################################ # File: obj/third_party/android_deps/google_play_services_vision_common_java/proguard.txt
# obj/third_party/android_deps/google_play_services_vision_common_java/proguard.txt
################################################################################
# We keep all fields for every generated proto file as the runtime uses # We keep all fields for every generated proto file as the runtime uses
# reflection over them that ProGuard cannot detect. Without this keep # reflection over them that ProGuard cannot detect. Without this keep
# rule, fields may be removed that would cause runtime failures. # rule, fields may be removed that would cause runtime failures.
...@@ -778,9 +724,7 @@ ...@@ -778,9 +724,7 @@
<fields>; <fields>;
} }
################################################################################ # File: obj/third_party/android_deps/google_play_services_vision_java/proguard.txt
# obj/third_party/android_deps/google_play_services_vision_java/proguard.txt
################################################################################
# We keep all fields for every generated proto file as the runtime uses # We keep all fields for every generated proto file as the runtime uses
# reflection over them that ProGuard cannot detect. Without this keep # reflection over them that ProGuard cannot detect. Without this keep
# rule, fields may be removed that would cause runtime failures. # rule, fields may be removed that would cause runtime failures.
...@@ -788,9 +732,7 @@ ...@@ -788,9 +732,7 @@
<fields>; <fields>;
} }
################################################################################ # File: //build/android/gyp/proguard.py (generated rules)
# Dynamically generated from build/android/gyp/proguard.py
################################################################################
# THIS LINE WAS OMITTED # THIS LINE WAS OMITTED
-keep @interface org.chromium.base.annotations.VerifiesOnNMR1 -keep @interface org.chromium.base.annotations.VerifiesOnNMR1
-if @org.chromium.base.annotations.VerifiesOnNMR1 class * { -if @org.chromium.base.annotations.VerifiesOnNMR1 class * {
......
...@@ -77,7 +77,10 @@ template("chrome_bundle") { ...@@ -77,7 +77,10 @@ template("chrome_bundle") {
"base_module_target", "base_module_target",
"bundle_name", "bundle_name",
"compress_shared_libraries", "compress_shared_libraries",
"expected_libs_and_assets",
"expected_libs_and_assets_base",
"expected_proguard_config", "expected_proguard_config",
"expected_proguard_config_base",
"keystore_name", "keystore_name",
"keystore_password", "keystore_password",
"keystore_path", "keystore_path",
...@@ -89,7 +92,6 @@ template("chrome_bundle") { ...@@ -89,7 +92,6 @@ template("chrome_bundle") {
"sign_bundle", "sign_bundle",
"static_library_provider", "static_library_provider",
"static_library_synchronized_proguard", "static_library_synchronized_proguard",
"expected_libs_and_assets",
"version_code", "version_code",
]) ])
command_line_flags_file = "chrome-command-line" command_line_flags_file = "chrome-command-line"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment