Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Unified Diff: build/android/gyp/generate_v14_compatible_resources.py

Issue 314363002: Revert of Add creation of v14 compatible resources to process_resources.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/gyp/process_resources.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | build/android/gyp/process_resources.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698