Chromium Code Reviews| Index: build/android/gyp/process_resources.py |
| diff --git a/build/android/gyp/process_resources.py b/build/android/gyp/process_resources.py |
| index 64a756048da9dc4d707bc1bc2c4e3c651c33bcc5..0215c392aa60f78a7999396c6a4eb0d51d5ee98f 100755 |
| --- a/build/android/gyp/process_resources.py |
| +++ b/build/android/gyp/process_resources.py |
| @@ -4,7 +4,11 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| -"""Process Android library resources to generate R.java and crunched images.""" |
| +"""Process Android resources to generate R.java, and prepare for packaging. |
| + |
| +This will crunch images and generate v14 compatible resources |
| +(see generate_v14_compatible_resources.py). |
| +""" |
| import optparse |
| import os |
| @@ -12,6 +16,8 @@ import re |
| import shlex |
| import shutil |
| +import generate_v14_compatible_resources as v14_resources |
|
newt (away)
2014/06/06 01:37:35
do you really need to "import as"? :)
cjhopman
2014/06/06 01:46:55
Ha, the other name was just so long. Done.
|
| + |
| from util import build_utils |
| def ParseArgs(): |
| @@ -36,7 +42,16 @@ def ParseArgs(): |
| parser.add_option('--android-manifest', help='AndroidManifest.xml path') |
| parser.add_option('--proguard-file', |
| help='Path to proguard.txt generated file') |
| - parser.add_option('--stamp', help='File to touch on success') |
| + |
| + parser.add_option('--res-v14-compatibility-dir', |
| + help='output directory into which ' |
| + 'v14 compatible resources will be generated') |
| + parser.add_option( |
| + '--v14-verify-only', |
| + action='store_true', |
| + 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( |
| '--extra-res-packages', |
| @@ -47,6 +62,8 @@ def ParseArgs(): |
| 'list of resources to be included in the R.java file in the format ' |
| 'generated by aapt') |
| + parser.add_option('--stamp', help='File to touch on success') |
| + |
| (options, args) = parser.parse_args() |
| if args: |
| @@ -61,6 +78,7 @@ def ParseArgs(): |
| 'resource_dir', |
| 'crunch_output_dir', |
| 'R_dir', |
| + 'res_v14_compatibility_dir', |
| ) |
| build_utils.CheckOptions(options, parser, required=required_options) |
| @@ -142,6 +160,14 @@ def main(): |
| build_utils.DeleteDirectory(options.R_dir) |
| build_utils.MakeDirectory(options.R_dir) |
| + build_utils.DeleteDirectory(options.res_v14_compatibility_dir) |
|
newt (away)
2014/06/06 01:37:35
This directory is deleted and created in generate_
cjhopman
2014/06/06 01:46:55
Done.
|
| + build_utils.MakeDirectory(options.res_v14_compatibility_dir) |
| + |
| + v14_resources.GenerateV14Resources( |
| + options.resource_dir, |
| + options.res_v14_compatibility_dir, |
| + options.v14_verify_only) |
| + |
| # Generate R.java. This R.java contains non-final constants and is used only |
| # while compiling the library jar (e.g. chromium_content.jar). When building |
| # an apk, a new R.java file with the correct resource -> ID mappings will be |