| Index: build/android/process_resources.py
|
| diff --git a/build/android/process_resources.py b/build/android/process_resources.py
|
| index b0a04af22869c5588f512a9667d7844da5dfb09f..b34f576a99905fa4e71493b5d8372ad96de94288 100755
|
| --- a/build/android/process_resources.py
|
| +++ b/build/android/process_resources.py
|
| @@ -27,7 +27,7 @@ def ParseArgs():
|
| parser.add_option('--R-package', help='Java package for generated R.java')
|
| parser.add_option('--R-dir', help='directory to hold generated R.java')
|
| parser.add_option('--res-dir', help='directory containing resources')
|
| - parser.add_option('--crunched-res-dir',
|
| + parser.add_option('--out-res-dir',
|
| help='directory to hold crunched resources')
|
| (options, args) = parser.parse_args()
|
|
|
| @@ -36,7 +36,7 @@ def ParseArgs():
|
|
|
| # Check that required options have been provided.
|
| required_options = ('android_sdk', 'android_sdk_tools', 'R_package',
|
| - 'R_dir', 'res_dir', 'crunched_res_dir')
|
| + 'R_dir', 'res_dir', 'out_res_dir')
|
| for option_name in required_options:
|
| if getattr(options, option_name) is None:
|
| parser.error('--%s is required' % option_name.replace('_', '-'))
|
| @@ -55,23 +55,28 @@ def main():
|
| # an apk, a new R.java file with the correct resource -> ID mappings will be
|
| # generated by merging the resources from all libraries and the main apk
|
| # project.
|
| - subprocess.check_call([aapt,
|
| - 'package',
|
| - '-m',
|
| - '--non-constant-id',
|
| - '--custom-package', options.R_package,
|
| - '-M', dummy_manifest,
|
| - '-S', options.res_dir,
|
| - '-I', android_jar,
|
| - '--output-text-symbols', options.R_dir,
|
| - '-J', options.R_dir])
|
| + package_command = [aapt,
|
| + 'package',
|
| + '-m',
|
| + '--non-constant-id',
|
| + '--custom-package', options.R_package,
|
| + '-M', dummy_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]
|
| + subprocess.check_call(package_command)
|
|
|
| # Crunch image resources. This shrinks png files and is necessary for 9-patch
|
| # images to display correctly.
|
| subprocess.check_call([aapt,
|
| 'crunch',
|
| '-S', options.res_dir,
|
| - '-C', options.crunched_res_dir])
|
| + '-C', options.out_res_dir])
|
|
|
|
|
| if __name__ == '__main__':
|
|
|