Maintain Android strings in grd files.

This removes the Android/Java strings.xml files, which are now
generated at build time from grd files. New strings should now be
added to the grd files.

BUG=167248


Review URL: https://chromiumcodereview.appspot.com/12259017

git-svn-id: http://src.chromium.org/svn/trunk/src/build@185218 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
newt@chromium.org 2013-02-28 11:05:57 +00:00
Родитель f7fe703f61
Коммит 21542f3b68
2 изменённых файлов: 19 добавлений и 14 удалений

Просмотреть файл

@ -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__':

Просмотреть файл

@ -137,7 +137,7 @@
'--R-package', '<(R_package)',
'--R-dir', '<(R_dir)',
'--res-dir', '<(res_dir)',
'--crunched-res-dir', '<(out_res_dir)',
'--out-res-dir', '<(out_res_dir)',
],
},
],