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 # Intermediate targets that repack grit resources by locale. For each locale |
413 script = "//chromecast/tools/build/chromecast_repack_locales.py" | 413 # in |locales_with_fake_bidi| (see //build/config/locales.gni), all resources |
| 414 # are packed into a single .pak file in an output directory. These targets |
| 415 # should not be depended on directly; depend on ":chromecast_locales_pak" |
| 416 # instead. |
| 417 foreach(locale, locales_with_fake_bidi) { |
| 418 repack("_cast_repack_${locale}") { |
| 419 visibility = [ ":chromecast_locales_pak" ] |
| 420 output = "$root_out_dir/chromecast_locales/${locale}.pak" |
| 421 sources = [ |
| 422 "$root_gen_dir/chromecast/app/chromecast_settings_${locale}.pak", |
| 423 ] |
| 424 deps = [ |
| 425 "//chromecast/app:chromecast_settings", |
| 426 ] |
414 | 427 |
415 # .pak resources in |grit_out_dir| with the same suffix are packed into a | 428 if (chromecast_branding != "public") { |
416 # single resource and placed in |locales_dir|. The original .pak resources | 429 sources += [ "$root_gen_dir/chromecast/internal/webui/app_strings_${locale
}.pak" ] |
417 # are generated by this target's dependencies. | 430 deps += [ "//chromecast/internal/webui:chromecast_app_strings" ] |
418 grit_out_dir = "$root_gen_dir/chromecast_strings" | |
419 locales_dir = "$root_out_dir/chromecast_locales" | |
420 | 431 |
421 sources = [] | |
422 outputs = [] | |
423 | |
424 # |locales| is an array of suffixes declared in //build/config/locals.gni. | |
425 foreach(locale, locales) { | |
426 sources += [ "$grit_out_dir/chromecast_settings_$locale.pak" ] | |
427 outputs += [ "$locales_dir/$locale.pak" ] | |
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) { | 432 if (enable_chromecast_webui) { |
438 sources += [ "$grit_out_dir/webui_localized_$locale.pak" ] | 433 sources += [ "$root_gen_dir/chromecast/internal/webui/webui_localized_${
locale}.pak" ] |
| 434 deps += [ "//chromecast/internal/webui:chromecast_webui_localized" ] |
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 } |
| 438 } |
446 | 439 |
447 # This script only accepts the following values for branding: | 440 # A meta-target which repacks resources by locale. |
448 assert(chromecast_branding == "public" || chromecast_branding == "internal" || | 441 group("chromecast_locales_pak") { |
449 chromecast_branding == "google") | 442 deps = [] |
450 args = [ | 443 foreach(locale, locales_with_fake_bidi) { |
451 "-b", | 444 deps += [ ":_cast_repack_${locale}" ] |
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 } | 445 } |
461 args += locales | |
462 } | 446 } |
463 | 447 |
464 buildflag_header("chromecast_features") { | 448 buildflag_header("chromecast_features") { |
465 header = "chromecast_features.h" | 449 header = "chromecast_features.h" |
466 flags = [ | 450 flags = [ |
467 "IS_CAST_AUDIO_ONLY=$is_cast_audio_only", | 451 "IS_CAST_AUDIO_ONLY=$is_cast_audio_only", |
468 "IS_CAST_USING_CMA_BACKEND=$is_cast_using_cma_backend", | 452 "IS_CAST_USING_CMA_BACKEND=$is_cast_using_cma_backend", |
469 ] | 453 ] |
470 } | 454 } |
471 | 455 |
(...skipping 21 matching lines...) Expand all Loading... |
493 shared_libraries = [ "//chromecast/android:libcast_shell_android" ] | 477 shared_libraries = [ "//chromecast/android:libcast_shell_android" ] |
494 | 478 |
495 deps = [ | 479 deps = [ |
496 ":cast_shell_apk_assets", | 480 ":cast_shell_apk_assets", |
497 "//base:base_java", | 481 "//base:base_java", |
498 "//chromecast/android:libcast_shell_android", | 482 "//chromecast/android:libcast_shell_android", |
499 "//chromecast/browser/android:cast_shell_java", | 483 "//chromecast/browser/android:cast_shell_java", |
500 ] | 484 ] |
501 } | 485 } |
502 } | 486 } |
OLD | NEW |