Index: build/android/gyp/generate_v14_compatible_resources.py |
diff --git a/build/android/gyp/generate_v14_compatible_resources.py b/build/android/gyp/generate_v14_compatible_resources.py |
index 03874f046c3d9d929ac7584613922ef341571246..bbfa1e5fc07d349d77458d7d83a0c5a5b9bd8b1e 100755 |
--- a/build/android/gyp/generate_v14_compatible_resources.py |
+++ b/build/android/gyp/generate_v14_compatible_resources.py |
@@ -280,12 +280,15 @@ |
build_utils.CheckOptions(options, parser, required=required_options) |
return options |
-def GenerateV14Resources(res_dir, res_v14_dir, verify_only): |
- build_utils.DeleteDirectory(res_v14_dir) |
- build_utils.MakeDirectory(res_v14_dir) |
- |
- for name in os.listdir(res_dir): |
- if not os.path.isdir(os.path.join(res_dir, name)): |
+ |
+def main(): |
+ options = ParseArgs() |
+ |
+ build_utils.DeleteDirectory(options.res_v14_compatibility_dir) |
+ build_utils.MakeDirectory(options.res_v14_compatibility_dir) |
+ |
+ for name in os.listdir(options.res_dir): |
+ if not os.path.isdir(os.path.join(options.res_dir, name)): |
continue |
dir_pieces = name.split('-') |
@@ -304,9 +307,9 @@ |
if 'ldrtl' in qualifiers: |
continue |
- input_dir = os.path.abspath(os.path.join(res_dir, name)) |
- |
- if verify_only: |
+ input_dir = os.path.abspath(os.path.join(options.res_dir, name)) |
+ |
+ if options.verify_only: |
if not api_level_qualifier or int(api_level_qualifier[1:]) < 17: |
VerifyV14ResourcesInDir(input_dir, resource_type) |
else: |
@@ -314,8 +317,9 @@ |
else: |
# We also need to copy the original v17 resource to *-v17 directory |
# because the generated v14 resource will hide the original resource. |
- output_v14_dir = os.path.join(res_v14_dir, name) |
- output_v17_dir = os.path.join(res_v14_dir, name + '-v17') |
+ output_v14_dir = os.path.join(options.res_v14_compatibility_dir, name) |
+ output_v17_dir = os.path.join(options.res_v14_compatibility_dir, name + |
+ '-v17') |
# We only convert layout resources under layout*/, xml*/, |
# and style resources under values*/. |
@@ -327,19 +331,13 @@ |
if api_level_qualifier == 'v17': |
output_qualifiers = qualifiers[:] |
del output_qualifiers[api_level_qualifier_index] |
- output_v14_dir = os.path.join(res_v14_dir, |
+ output_v14_dir = os.path.join(options.res_v14_compatibility_dir, |
'-'.join([resource_type] + |
output_qualifiers)) |
GenerateV14StyleResourcesInDir(input_dir, output_v14_dir) |
elif not api_level_qualifier: |
ErrorIfStyleResourceExistsInDir(input_dir) |
-def main(): |
- options = ParseArgs() |
- |
- GenerateV14Resources( |
- options.res_dir, options.res_v14_compatibility_dir, options.verify_only) |
- |
if options.stamp: |
build_utils.Touch(options.stamp) |