Commit 2b7115f8 authored by kkimlabs's avatar kkimlabs Committed by Commit bot

[Android] Add an option to skip v14 resource verification.

Android AAPT 21+ will automatically move attributes to a version
of the XML file with -vXX resource qualifier. So we no longer need
our generate_v14_compatible_resources.py script.

But AAPT only drops the attributes, so if we don't use our script,
we need to put left/right in addition to start/end in our layout xmls.

The plan is, disabling our script for Android support library and
keep using for ourselves, until we can drop the script entirely
when we discontinue support for JB.

TBR=cjhopman@chromium.org
BUG=487391

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

Cr-Commit-Position: refs/heads/master@{#329947}
parent 51f97d05
......@@ -73,6 +73,10 @@ def ParseArgs(args):
help='Do not generate v14 resources. Instead, just verify that the '
'resources are already compatible with v14, i.e. they don\'t use '
'attributes that cause crashes on certain devices.')
parser.add_option(
'--v14-skip',
action="store_true",
help='Do not generate nor verify v14 resources')
parser.add_option(
'--extra-res-packages',
......@@ -319,11 +323,12 @@ def main():
input_resource_dirs = build_utils.ParseGypList(options.resource_dirs)
for resource_dir in input_resource_dirs:
generate_v14_compatible_resources.GenerateV14Resources(
resource_dir,
v14_dir,
options.v14_verify_only)
if not options.v14_skip:
for resource_dir in input_resource_dirs:
generate_v14_compatible_resources.GenerateV14Resources(
resource_dir,
v14_dir,
options.v14_verify_only)
dep_zips = build_utils.ParseGypList(options.dependencies_res_zips)
input_files += dep_zips
......
......@@ -69,6 +69,7 @@
'has_java_resources%': 0,
'res_extra_dirs': [],
'res_extra_files': [],
'res_v14_skip%': 0,
'res_v14_verify_only%': 0,
'resource_input_paths': ['>@(res_extra_files)'],
'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)',
......@@ -157,6 +158,9 @@
'inputs_list_file': '>|(java_resources.<(_target_name).gypcmd >@(resource_input_paths))',
'process_resources_options': [],
'conditions': [
['res_v14_skip == 1', {
'process_resources_options': ['--v14-skip']
}],
['res_v14_verify_only == 1', {
'process_resources_options': ['--v14-verify-only']
}],
......
......@@ -141,6 +141,7 @@
'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh',
'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh',
'create_standalone_apk%': 1,
'res_v14_skip%': 0,
'res_v14_verify_only%': 0,
'variables': {
'variables': {
......@@ -607,6 +608,9 @@
'dependencies_res_zip_paths=': [],
'additional_res_packages=': [],
}],
['res_v14_skip == 1', {
'process_resources_options+': ['--v14-skip']
}],
['res_v14_verify_only == 1', {
'process_resources_options+': ['--v14-verify-only']
}],
......
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