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 40f1017ce5cf92df9a7d8164812d17b5556e4230..47c161457945e784bafc7f95678d39beb6192fd8 100755 |
| --- a/build/android/gyp/process_resources.py |
| +++ b/build/android/gyp/process_resources.py |
| @@ -9,6 +9,7 @@ |
| import optparse |
| import os |
| import shlex |
| +import sys |
| from util import build_utils |
| @@ -25,10 +26,13 @@ def ParseArgs(): |
| parser.add_option('--R-dir', help='directory to hold generated R.java') |
| 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-and-mirror-input-dir', |
| + help='directory containing images to be crunched and' \ |
|
newt (away)
2013/04/25 00:47:58
don't need \
http://google-styleguide.googlecode.
Kibeom Kim (inactive)
2013/04/25 01:49:35
Done.
|
| + 'LTR resources to be mirrored') |
| parser.add_option('--crunch-output-dir', |
| help='directory to hold crunched resources') |
| + parser.add_option('--mirror-output-dir', |
| + help='directory to hold mirrored, RTL resources') |
| parser.add_option('--non-constant-id', action='store_true') |
| parser.add_option('--custom-package', help='Java package for R.java') |
| parser.add_option('--android-manifest', help='AndroidManifest.xml path') |
| @@ -44,7 +48,8 @@ def ParseArgs(): |
| # Check that required options have been provided. |
| required_options = ('android_sdk', 'android_sdk_tools', 'R_dir', 'res_dirs', |
| - 'crunch_input_dir', 'crunch_output_dir') |
| + 'crunch_and_mirror_input_dir', 'crunch_output_dir', |
| + 'mirror_output_dir') |
| build_utils.CheckOptions(options, parser, required=required_options) |
| return options |
| @@ -85,10 +90,19 @@ def main(): |
| aapt_cmd = [aapt, |
| 'crunch', |
| - '-S', options.crunch_input_dir, |
| + '-S', options.crunch_and_mirror_input_dir, |
| '-C', options.crunch_output_dir] |
| build_utils.CheckCallDie(aapt_cmd, suppress_output=True) |
| + # Generate RTL versions of layouts and other XML resources. |
| + build_utils.MakeDirectory(options.mirror_output_dir) |
| + mirror_cmd = [sys.executable, |
|
newt (away)
2013/04/25 00:47:58
Chris may know the best way to do this
cjhopman
2013/04/25 01:02:06
Haven't looked at the rest of the change yet, but
Kibeom Kim (inactive)
2013/04/25 01:49:35
OK I'll try to make this a separate gyp action aft
|
| + os.path.join(os.path.dirname(__file__), 'mirror_resources.py'), |
| + '--res-dir', options.crunch_and_mirror_input_dir, |
| + '--res-mirrored-dir', options.mirror_output_dir] |
| + build_utils.CheckCallDie(mirror_cmd, suppress_output=True) |
| + |
| + |
| if options.stamp: |
| build_utils.Touch(options.stamp) |