Chromium Code Reviews| Index: chromecast/BUILD.gn |
| diff --git a/chromecast/BUILD.gn b/chromecast/BUILD.gn |
| index 223c541ffbbd3e75a81243c93206b4d319fdf52f..154f61c36aa7efc4b0a4c388b12bf1b6d69bfb6b 100644 |
| --- a/chromecast/BUILD.gn |
| +++ b/chromecast/BUILD.gn |
| @@ -409,56 +409,43 @@ repack("cast_shell_pak") { |
| } |
| } |
| -action("chromecast_locales_pak") { |
| - script = "//chromecast/tools/build/chromecast_repack_locales.py" |
| +template("cast_repack_locales") { |
| + output_dir = invoker.output_dir |
| - # .pak resources in |grit_out_dir| with the same suffix are packed into a |
| - # single resource and placed in |locales_dir|. The original .pak resources |
| - # are generated by this target's dependencies. |
| - grit_out_dir = "$root_gen_dir/chromecast_strings" |
| - locales_dir = "$root_out_dir/chromecast_locales" |
| + # |locales| is an array of suffixes declared in //build/config/locales.gni. |
| + foreach(locale, locales) { |
| + repack("_cast_repack_${locale}") { |
| + output = "${output_dir}/${locale}.pak" |
| + sources = [ |
| + "$root_gen_dir/chromecast/app/chromecast_settings_${locale}.pak", |
| + ] |
| + deps = [ |
| + "//chromecast/app:chromecast_settings", |
| + ] |
| - sources = [] |
| - outputs = [] |
| + if (chromecast_branding != "public") { |
| + sources += |
| + [ "$root_gen_dir/chromecast_strings/app_strings_${locale}.pak" ] |
|
mbjorge
2017/03/22 21:26:33
Any benefit in moving the webui strings to output
slan
2017/03/22 22:54:52
Yeah, ok... Will need a corresponding internal cha
|
| + deps += [ "//chromecast/internal/webui:chromecast_app_strings" ] |
| - # |locales| is an array of suffixes declared in //build/config/locals.gni. |
| - foreach(locale, locales) { |
| - sources += [ "$grit_out_dir/chromecast_settings_$locale.pak" ] |
| - outputs += [ "$locales_dir/$locale.pak" ] |
| + if (enable_chromecast_webui) { |
| + sources += [ "$root_gen_dir/chromecast_strings/webui_localized_${locale}.pak" ] |
| + deps += [ "//chromecast/internal/webui:chromecast_webui_localized" ] |
| + } |
| + } |
| + } |
| } |
| - deps = [ |
| - "//chromecast/app:chromecast_settings", |
| - ] |
| - # Include string and other localized resources for internal builds. |
| - if (chromecast_branding != "public") { |
| + group(target_name) { |
| + deps = [] |
| foreach(locale, locales) { |
| - sources += [ "$grit_out_dir/app_strings_$locale.pak" ] |
| - if (enable_chromecast_webui) { |
| - sources += [ "$grit_out_dir/webui_localized_$locale.pak" ] |
| - } |
| - } |
| - deps += [ "//chromecast/internal/webui:chromecast_app_strings" ] |
| - if (enable_chromecast_webui) { |
| - deps += [ "//chromecast/internal/webui:chromecast_webui_localized" ] |
| + deps += [ ":_cast_repack_${locale}" ] |
| } |
| } |
| +} |
| - # This script only accepts the following values for branding: |
| - assert(chromecast_branding == "public" || chromecast_branding == "internal" || |
| - chromecast_branding == "google") |
| - args = [ |
| - "-b", |
| - "$chromecast_branding", |
| - "-g", |
| - rebase_path("$root_gen_dir/chromecast_strings"), |
| - "-x", |
| - rebase_path("$root_out_dir/chromecast_locales"), |
| - ] |
| - if (enable_chromecast_webui) { |
| - args += [ "-u" ] |
| - } |
| - args += locales |
| +cast_repack_locales("chromecast_locales_pak") { |
|
mbjorge
2017/03/22 21:26:33
Is the template actually necessary?
Could you jus
slan
2017/03/22 22:54:52
Yes, I can. I think it's cleaner too. Brilliant!
|
| + output_dir = "$root_out_dir/chromecast_locales" |
| } |
| buildflag_header("chromecast_features") { |