summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornewt@chromium.org <newt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-10 21:05:48 +0000
committernewt@chromium.org <newt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-10 21:05:48 +0000
commit832fcca9ee8c6ee9e9cd4f4a9dbb28472c40f774 (patch)
tree9038a42dee1d29607a70f189dbbb87ea3f0ee7fc
parent219c503bb3c190bf3dfcf902d1de38ae9a8b0a71 (diff)
downloadchromium_src-832fcca9ee8c6ee9e9cd4f4a9dbb28472c40f774.zip
chromium_src-832fcca9ee8c6ee9e9cd4f4a9dbb28472c40f774.tar.gz
chromium_src-832fcca9ee8c6ee9e9cd4f4a9dbb28472c40f774.tar.bz2
Revert 176134
> [Android] Generate localized strings.xml files at build time. > > This generates localized strings.xml files (e.g. > values-fr/strings.xml) from grd and xtb files at build time. This > means we no longer need to check in localized strings.xml files. Note: > the xtb files are empty until translations are available. > > Benefits: > - 41 fewer extraneous results when grepping Java string IDs > - Switching from maintaining strings in strings.xml over to using a > grd file is One Trivial CL* away: just include English in the list > of languages for which we generate strings.xml files. > > *Restrictions may apply > > BUG=167248 > > Review URL: https://codereview.chromium.org/11659006 TBR=newt@chromium.org Review URL: https://codereview.chromium.org/11820058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176151 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/grit_action.gypi2
-rw-r--r--build/java.gypi36
-rw-r--r--build/java_apk.gypi51
-rw-r--r--chrome/chrome.gyp1
-rw-r--r--content/content.gyp1
-rw-r--r--ui/ui.gyp1
6 files changed, 14 insertions, 78 deletions
diff --git a/build/grit_action.gypi b/build/grit_action.gypi
index af1b4d7..ef67ab5 100644
--- a/build/grit_action.gypi
+++ b/build/grit_action.gypi
@@ -28,7 +28,7 @@
],
'action': ['<@(grit_cmd)',
'-i', '<(grit_grd_file)', 'build',
- '-f', '<(grit_resource_ids)',
+ '-f<(grit_resource_ids)',
'-o', '<(grit_out_dir)',
'<@(grit_defines)' ],
'msvs_cygwin_shell': 0,
diff --git a/build/java.gypi b/build/java.gypi
index 910a2a0..a13c88f 100644
--- a/build/java.gypi
+++ b/build/java.gypi
@@ -44,8 +44,6 @@
# R_package - The java package in which the R class (which maps resources to
# integer IDs) should be generated, e.g. org.chromium.content.
# R_package_relpath - Same as R_package, but replace each '.' with '/'.
-# java_strings_grd - The name of the grd file from which to generate localized
-# strings.xml files, if any.
{
'dependencies': [
@@ -67,19 +65,16 @@
'generated_R_dirs': [],
'additional_R_files': [],
'has_java_resources%': 0,
- 'java_strings_grd%': '',
},
'conditions': [
['has_java_resources == 1', {
'variables': {
'res_dir': '<(java_in_dir)/res',
- 'out_res_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/res',
+ 'crunched_res_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/res',
'R_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/java_R',
'R_file': '<(R_dir)/<(R_package_relpath)/R.java',
'generated_src_dirs': ['<(R_dir)'],
'additional_input_paths': ['<(R_file)'],
- # grit_grd_file is used by grit_action.gypi, included below.
- 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)',
},
'all_dependent_settings': {
'variables': {
@@ -90,40 +85,15 @@
# Dependent APKs include this target's resources via
# additional_res_dirs and additional_res_packages.
- 'additional_res_dirs': ['<(out_res_dir)', '<(res_dir)'],
+ 'additional_res_dirs': ['<(crunched_res_dir)', '<(res_dir)'],
'additional_res_packages': ['<(R_package)'],
},
},
- 'conditions': [
- ['java_strings_grd != ""', {
- 'actions': [
- {
- 'action_name': 'generate_localized_strings_xml',
- 'variables': {
- 'grit_out_dir': '<(out_res_dir)',
- # resource_ids is unneeded since we don't generate .h headers.
- 'grit_resource_ids': '',
- },
- 'includes': ['../build/grit_action.gypi'],
- },
- ],
- }],
- ],
'actions': [
# Generate R.java and crunch image resources.
{
'action_name': 'process_resources',
'message': 'processing resources for <(package_name)',
- 'conditions': [
- ['java_strings_grd != ""', {
- 'inputs': [
- # TODO(newt): replace this with .../values/strings.xml once
- # the English strings.xml is generated as well? That would be
- # simpler and faster and should be equivalent.
- '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(out_res_dir)" <(grit_grd_file))',
- ],
- }],
- ],
'inputs': [
'<(DEPTH)/build/android/process_resources.py',
'<!@(find <(res_dir) -type f)',
@@ -138,7 +108,7 @@
'--R-package', '<(R_package)',
'--R-dir', '<(R_dir)',
'--res-dir', '<(res_dir)',
- '--crunched-res-dir', '<(out_res_dir)',
+ '--crunched-res-dir', '<(crunched_res_dir)',
],
},
],
diff --git a/build/java_apk.gypi b/build/java_apk.gypi
index 9edd420..6d39188 100644
--- a/build/java_apk.gypi
+++ b/build/java_apk.gypi
@@ -59,8 +59,6 @@
# resource_dir - The directory for resources.
# R_package - A custom Java package to generate the resource file R.java in.
# By default, the package given in AndroidManifest.xml will be used.
-# java_strings_grd - The name of the grd file from which to generate localized
-# strings.xml files, if any.
{
'variables': {
@@ -80,8 +78,6 @@
'additional_res_dirs': [],
'additional_res_packages': [],
'is_test_apk%': 0,
- 'java_strings_grd%': '',
- 'grit_grd_file%': '',
},
'sources': [
'<@(native_libs_paths)'
@@ -115,35 +111,6 @@
],
},
],
- 'conditions': [
- ['R_package != ""', {
- 'variables': {
- # We generate R.java in package R_package (in addition to the package
- # listed in the AndroidManifest.xml, which is unavoidable).
- 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'],
- 'additional_res_packages': ['<(R_package)'],
- },
- }],
- ['java_strings_grd != ""', {
- 'variables': {
- 'out_res_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res',
- 'additional_res_dirs': ['<(out_res_dir)'],
- # grit_grd_file is used by grit_action.gypi, included below.
- 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)',
- },
- 'actions': [
- {
- 'action_name': 'generate_localized_strings_xml',
- 'variables': {
- 'grit_out_dir': '<(out_res_dir)',
- # resource_ids is unneeded since we don't generate .h headers.
- 'grit_resource_ids': '',
- },
- 'includes': ['../build/grit_action.gypi'],
- },
- ],
- }],
- ],
'actions': [
{
'action_name': 'ant_<(package_name)_apk',
@@ -164,14 +131,6 @@
['resource_dir!=""', {
'inputs': ['<!@(find <(java_in_dir)/<(resource_dir) -name "*")']
}],
- ['java_strings_grd != ""', {
- 'inputs': [
- # TODO(newt): replace this with .../values/strings.xml once
- # the English strings.xml is generated as well? That would be
- # simpler and faster and should be equivalent.
- '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(out_res_dir)" <(grit_grd_file))',
- ],
- }],
['is_test_apk == 1', {
'variables': {
'additional_res_dirs=': [],
@@ -223,4 +182,14 @@
]
},
],
+ 'conditions': [
+ ['R_package != ""', {
+ 'variables': {
+ # We generate R.java in package R_package (in addition to the package
+ # listed in the AndroidManifest.xml, which is unavoidable).
+ 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'],
+ 'additional_res_packages': ['<(R_package)'],
+ },
+ }],
+ ],
}
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index c163716..6e0cb29 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -1081,7 +1081,6 @@
'has_java_resources': 1,
'R_package': 'org.chromium.chrome',
'R_package_relpath': 'org/chromium/chrome',
- 'java_strings_grd': 'android_chrome_strings.grd',
},
'includes': [
'../build/java.gypi',
diff --git a/content/content.gyp b/content/content.gyp
index 4bb2f33..f295a4f 100644
--- a/content/content.gyp
+++ b/content/content.gyp
@@ -295,7 +295,6 @@
'has_java_resources': 1,
'R_package': 'org.chromium.content',
'R_package_relpath': 'org/chromium/content',
- 'java_strings_grd': 'android_content_strings.grd',
},
'conditions': [
['android_build_type == 0', {
diff --git a/ui/ui.gyp b/ui/ui.gyp
index b032052..947ea2a 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -893,7 +893,6 @@
'has_java_resources': 1,
'R_package': 'org.chromium.ui',
'R_package_relpath': 'org/chromium/ui',
- 'java_strings_grd': 'android_ui_strings.grd',
},
'dependencies': [
'../base/base.gyp:base_java',