Skip to content

Commit

Permalink
Allow overriding Chromium-branded Android resources.
Browse files Browse the repository at this point in the history
The chrome_java target includes several resources that are specific to a
Chromium-branded build (e.g. the Chromium icon and app name). It's now
possible to set a value for the GYP/GN variable
android_branding_res_dirs to override the directory in which these
branding resources live. This enables easy swapping of the resources
when building, e.g., a Google Chrome-branded build.

R=yfriedman@chromium.org
TBR=thestig@chromium.org
BUG=520794,474747

Review URL: https://codereview.chromium.org/1301613002 .

Cr-Commit-Position: refs/heads/master@{#343746}
  • Loading branch information
Newton Allen committed Aug 17, 2015
1 parent 2b4dd97 commit 60e61e8
Show file tree
Hide file tree
Showing 23 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions chrome/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ locale_pak_resources("chrome_locale_paks") {

# GYP: //chrome/chrome.gyp:chrome_java (resources part)
android_resources("chrome_java_resources") {
resource_dirs = [
"java/res",
"java/res_default",
]
if (!defined(android_branding_res_dirs)) {
android_branding_res_dirs = [ "//chrome/android/java/res_chromium" ]
}
resource_dirs = [ "java/res" ] + android_branding_res_dirs
deps = [
":chrome_locale_paks",
":chrome_strings_grd",
Expand Down
8 changes: 5 additions & 3 deletions chrome/chrome.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -620,19 +620,21 @@
'../ui/android/ui_android.gyp:ui_java',
],
'variables': {
'variables': {
'android_branding_res_dirs%': ['<(java_in_dir)/res_chromium'],
},
'java_in_dir': '../chrome/android/java',
'has_java_resources': 1,
'R_package': 'org.chromium.chrome',
'R_package_relpath': 'org/chromium/chrome',
# Include channel-specific resources and xml string files generated
# from generated_resources.grd
'res_channel_dir': '<(java_in_dir)/res_default',
'res_extra_dirs': [
'<(res_channel_dir)',
'<@(android_branding_res_dirs)',
'<(SHARED_INTERMEDIATE_DIR)/chrome/java/res',
],
'res_extra_files': [
'<!@(find <(res_channel_dir) -type f)',
'<!@(find <(android_branding_res_dirs) -type f)',
'<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(SHARED_INTERMEDIATE_DIR)/chrome" app/generated_resources.grd)',
],
},
Expand Down

0 comments on commit 60e61e8

Please sign in to comment.