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

Unified Diff: build/android/process_resources.py

Issue 12529025: Generate Android string files from generated_resources.grd. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: flip coin to decide which type of gyp variable expansion to use Created 7 years, 9 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/common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/process_resources.py
diff --git a/build/android/process_resources.py b/build/android/process_resources.py
index f5de24df07d70d10e669821c0812aae45588fe33..63582df360987f4f2842276c7759ad1d4275bc89 100755
--- a/build/android/process_resources.py
+++ b/build/android/process_resources.py
@@ -8,6 +8,7 @@
import optparse
import os
+import shlex
import subprocess
from pylib import build_utils
@@ -23,8 +24,11 @@ def ParseArgs():
parser.add_option('--android-sdk-tools',
help='path to the Android SDK platform tools folder')
parser.add_option('--R-dir', help='directory to hold generated R.java')
- parser.add_option('--res-dir', help='directory containing resources')
- parser.add_option('--out-res-dir',
+ parser.add_option('--res-dirs',
+ help='directories containing resources to be packaged')
+ parser.add_option('--crunch-input-dir',
+ help='directory containing images to be crunched')
+ parser.add_option('--crunch-output-dir',
help='directory to hold crunched resources')
parser.add_option('--non-constant-id', action='store_true')
parser.add_option('--custom-package', help='Java package for R.java')
@@ -40,10 +44,10 @@ def ParseArgs():
parser.error('No positional arguments should be given.')
# Check that required options have been provided.
- required_options = ('android_sdk', 'android_sdk_tools',
- 'R_dir', 'res_dir', 'out_res_dir')
+ required_options = ('android_sdk', 'android_sdk_tools', 'R_dir', 'res_dirs',
+ 'crunch_input_dir', 'crunch_output_dir')
for option_name in required_options:
- if getattr(options, option_name) is None:
+ if not getattr(options, option_name):
parser.error('--%s is required' % option_name.replace('_', '-'))
return options
@@ -65,14 +69,13 @@ def main():
'package',
'-m',
'-M', options.android_manifest,
- '-S', options.res_dir,
'--auto-add-overlay',
'-I', android_jar,
'--output-text-symbols', options.R_dir,
'-J', options.R_dir]
- # If strings.xml was generated from a grd file, it will be in out_res_dir.
- if os.path.isdir(options.out_res_dir):
- package_command += ['-S', options.out_res_dir]
+ res_dirs = shlex.split(options.res_dirs)
+ for res_dir in res_dirs:
+ package_command += ['-S', res_dir]
if options.non_constant_id:
package_command.append('--non-constant-id')
if options.custom_package:
@@ -83,8 +86,8 @@ def main():
# images to display correctly.
subprocess.check_call([aapt,
'crunch',
- '-S', options.res_dir,
- '-C', options.out_res_dir])
+ '-S', options.crunch_input_dir,
+ '-C', options.crunch_output_dir])
build_utils.Touch(options.stamp)
« no previous file with comments | « no previous file | build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698