OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/buildflag_header.gni") | 5 import("//build/buildflag_header.gni") |
6 import("//build/config/features.gni") | 6 import("//build/config/features.gni") |
7 import("//build/config/locales.gni") | 7 import("//build/config/locales.gni") |
8 import("//build/config/sanitizers/sanitizers.gni") | 8 import("//build/config/sanitizers/sanitizers.gni") |
9 import("//build/config/ui.gni") | 9 import("//build/config/ui.gni") |
10 import("//chromecast/build/tests/cast_test.gni") | 10 import("//chromecast/build/tests/cast_test.gni") |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 "//ui/strings", | 402 "//ui/strings", |
403 ] | 403 ] |
404 | 404 |
405 if (chromecast_branding != "public") { | 405 if (chromecast_branding != "public") { |
406 sources += [ "$root_gen_dir/chromecast/internal/cast_shell_internal.pak" ] | 406 sources += [ "$root_gen_dir/chromecast/internal/cast_shell_internal.pak" ] |
407 | 407 |
408 deps += [ "//chromecast/internal:cast_shell_internal_pak" ] | 408 deps += [ "//chromecast/internal:cast_shell_internal_pak" ] |
409 } | 409 } |
410 } | 410 } |
411 | 411 |
412 action("chromecast_locales_pak") { | 412 template("cast_repack_locales") { |
413 script = "//chromecast/tools/build/chromecast_repack_locales.py" | 413 output_dir = invoker.output_dir |
414 | 414 |
415 # .pak resources in |grit_out_dir| with the same suffix are packed into a | 415 # |locales| is an array of suffixes declared in //build/config/locales.gni. |
416 # single resource and placed in |locales_dir|. The original .pak resources | 416 foreach(locale, locales) { |
417 # are generated by this target's dependencies. | 417 repack("_cast_repack_${locale}") { |
418 grit_out_dir = "$root_gen_dir/chromecast_strings" | 418 output = "${output_dir}/${locale}.pak" |
419 locales_dir = "$root_out_dir/chromecast_locales" | 419 sources = [ |
420 "$root_gen_dir/chromecast/app/chromecast_settings_${locale}.pak", | |
421 ] | |
422 deps = [ | |
423 "//chromecast/app:chromecast_settings", | |
424 ] | |
420 | 425 |
421 sources = [] | 426 if (chromecast_branding != "public") { |
422 outputs = [] | 427 sources += |
428 [ "$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
| |
429 deps += [ "//chromecast/internal/webui:chromecast_app_strings" ] | |
423 | 430 |
424 # |locales| is an array of suffixes declared in //build/config/locals.gni. | 431 if (enable_chromecast_webui) { |
425 foreach(locale, locales) { | 432 sources += [ "$root_gen_dir/chromecast_strings/webui_localized_${local e}.pak" ] |
426 sources += [ "$grit_out_dir/chromecast_settings_$locale.pak" ] | 433 deps += [ "//chromecast/internal/webui:chromecast_webui_localized" ] |
427 outputs += [ "$locales_dir/$locale.pak" ] | 434 } |
428 } | |
429 deps = [ | |
430 "//chromecast/app:chromecast_settings", | |
431 ] | |
432 | |
433 # Include string and other localized resources for internal builds. | |
434 if (chromecast_branding != "public") { | |
435 foreach(locale, locales) { | |
436 sources += [ "$grit_out_dir/app_strings_$locale.pak" ] | |
437 if (enable_chromecast_webui) { | |
438 sources += [ "$grit_out_dir/webui_localized_$locale.pak" ] | |
439 } | 435 } |
440 } | 436 } |
441 deps += [ "//chromecast/internal/webui:chromecast_app_strings" ] | |
442 if (enable_chromecast_webui) { | |
443 deps += [ "//chromecast/internal/webui:chromecast_webui_localized" ] | |
444 } | |
445 } | 437 } |
446 | 438 |
447 # This script only accepts the following values for branding: | 439 group(target_name) { |
448 assert(chromecast_branding == "public" || chromecast_branding == "internal" || | 440 deps = [] |
449 chromecast_branding == "google") | 441 foreach(locale, locales) { |
450 args = [ | 442 deps += [ ":_cast_repack_${locale}" ] |
451 "-b", | 443 } |
452 "$chromecast_branding", | |
453 "-g", | |
454 rebase_path("$root_gen_dir/chromecast_strings"), | |
455 "-x", | |
456 rebase_path("$root_out_dir/chromecast_locales"), | |
457 ] | |
458 if (enable_chromecast_webui) { | |
459 args += [ "-u" ] | |
460 } | 444 } |
461 args += locales | 445 } |
446 | |
447 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!
| |
448 output_dir = "$root_out_dir/chromecast_locales" | |
462 } | 449 } |
463 | 450 |
464 buildflag_header("chromecast_features") { | 451 buildflag_header("chromecast_features") { |
465 header = "chromecast_features.h" | 452 header = "chromecast_features.h" |
466 flags = [ | 453 flags = [ |
467 "IS_CAST_AUDIO_ONLY=$is_cast_audio_only", | 454 "IS_CAST_AUDIO_ONLY=$is_cast_audio_only", |
468 "IS_CAST_USING_CMA_BACKEND=$is_cast_using_cma_backend", | 455 "IS_CAST_USING_CMA_BACKEND=$is_cast_using_cma_backend", |
469 ] | 456 ] |
470 } | 457 } |
471 | 458 |
(...skipping 21 matching lines...) Expand all Loading... | |
493 shared_libraries = [ "//chromecast/android:libcast_shell_android" ] | 480 shared_libraries = [ "//chromecast/android:libcast_shell_android" ] |
494 | 481 |
495 deps = [ | 482 deps = [ |
496 ":cast_shell_apk_assets", | 483 ":cast_shell_apk_assets", |
497 "//base:base_java", | 484 "//base:base_java", |
498 "//chromecast/android:libcast_shell_android", | 485 "//chromecast/android:libcast_shell_android", |
499 "//chromecast/browser/android:cast_shell_java", | 486 "//chromecast/browser/android:cast_shell_java", |
500 ] | 487 ] |
501 } | 488 } |
502 } | 489 } |
OLD | NEW |