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..132cdf62f1455b81f4928bd135febec14c4ae9f8 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 |
+ |
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,11 @@ def main(): |
build_utils.DeleteDirectory(options.R_dir) |
build_utils.MakeDirectory(options.R_dir) |
+ generate_v14_compatible_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 |