| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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("//base/android/linker/config.gni") | 5 import("//base/android/linker/config.gni") |
| 6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
| 7 import("//build/config/android/internal_rules.gni") | 7 import("//build/config/android/internal_rules.gni") |
| 8 import("//third_party/android_platform/config.gni") | 8 import("//third_party/android_platform/config.gni") |
| 9 import("//tools/grit/grit_rule.gni") | 9 import("//tools/grit/grit_rule.gni") |
| 10 | 10 |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 } | 537 } |
| 538 | 538 |
| 539 group(target_name) { | 539 group(target_name) { |
| 540 deps = [ | 540 deps = [ |
| 541 ":${target_name}__build_config", | 541 ":${target_name}__build_config", |
| 542 ":${target_name}__template", | 542 ":${target_name}__template", |
| 543 ] | 543 ] |
| 544 } | 544 } |
| 545 } | 545 } |
| 546 | 546 |
| 547 # Creates a resources.zip with locale.pak files placed into appropriate | |
| 548 # resource configs (e.g. en-GB.pak -> res/raw-en/en_gb.pak). Also generates | |
| 549 # a locale_paks TypedArray so that resource files can be enumerated at runtime. | |
| 550 # | |
| 551 # If this target is included in the deps of an android resources/library/apk, | |
| 552 # the resources will be included with that target. | |
| 553 # | |
| 554 # Variables: | |
| 555 # sources: List of .pak files. Names must be of the form "en.pak" or | |
| 556 # "en-US.pak". | |
| 557 # deps: (optional) List of dependencies that might be needed to generate | |
| 558 # the .pak files. | |
| 559 # | |
| 560 # Example | |
| 561 # locale_pak_resources("locale_paks") { | |
| 562 # sources = [ "path/en-US.pak", "path/fr.pak", ... ] | |
| 563 # } | |
| 564 template("locale_pak_resources") { | |
| 565 set_sources_assignment_filter([]) | |
| 566 assert(defined(invoker.sources)) | |
| 567 | |
| 568 _base_path = "$target_gen_dir/$target_name" | |
| 569 _resources_zip = _base_path + ".resources.zip" | |
| 570 _build_config = _base_path + ".build_config" | |
| 571 | |
| 572 write_build_config("${target_name}__build_config") { | |
| 573 build_config = _build_config | |
| 574 resources_zip = _resources_zip | |
| 575 type = "android_resources" | |
| 576 } | |
| 577 | |
| 578 action("${target_name}__create_resources_zip") { | |
| 579 sources = invoker.sources | |
| 580 script = "//build/android/gyp/locale_pak_resources.py" | |
| 581 depfile = "$target_gen_dir/$target_name.d" | |
| 582 | |
| 583 outputs = [ | |
| 584 depfile, | |
| 585 _resources_zip, | |
| 586 ] | |
| 587 | |
| 588 _rebased_sources = rebase_path(invoker.sources, root_build_dir) | |
| 589 args = [ | |
| 590 "--locale-paks=${_rebased_sources}", | |
| 591 "--resources-zip", | |
| 592 rebase_path(_resources_zip, root_build_dir), | |
| 593 "--depfile", | |
| 594 rebase_path(depfile, root_build_dir), | |
| 595 ] | |
| 596 | |
| 597 if (defined(invoker.deps)) { | |
| 598 deps = invoker.deps | |
| 599 } | |
| 600 } | |
| 601 | |
| 602 group(target_name) { | |
| 603 deps = [ | |
| 604 ":${target_name}__build_config", | |
| 605 ":${target_name}__create_resources_zip", | |
| 606 ] | |
| 607 } | |
| 608 } | |
| 609 | |
| 610 # Declare an Android resources target | 547 # Declare an Android resources target |
| 611 # | 548 # |
| 612 # This creates a resources zip file that will be used when building an Android | 549 # This creates a resources zip file that will be used when building an Android |
| 613 # library or apk and included into a final apk. | 550 # library or apk and included into a final apk. |
| 614 # | 551 # |
| 615 # To include these resources in a library/apk, this target should be listed in | 552 # To include these resources in a library/apk, this target should be listed in |
| 616 # the library's deps. A library/apk will also include any resources used by its | 553 # the library's deps. A library/apk will also include any resources used by its |
| 617 # own dependencies. | 554 # own dependencies. |
| 618 # | 555 # |
| 619 # Variables | 556 # Variables |
| (...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2182 template("uiautomator_test") { | 2119 template("uiautomator_test") { |
| 2183 set_sources_assignment_filter([]) | 2120 set_sources_assignment_filter([]) |
| 2184 if (defined(invoker.testonly)) { | 2121 if (defined(invoker.testonly)) { |
| 2185 testonly = invoker.testonly | 2122 testonly = invoker.testonly |
| 2186 } | 2123 } |
| 2187 assert(target_name != "") | 2124 assert(target_name != "") |
| 2188 assert(invoker.deps != [] || true) | 2125 assert(invoker.deps != [] || true) |
| 2189 group(target_name) { | 2126 group(target_name) { |
| 2190 } | 2127 } |
| 2191 } | 2128 } |
| OLD | NEW |