Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: build/config/android/rules.gni

Issue 1338393003: GN: Fix ChromePublic crash on launch from misconfigured resource overrides (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: line length Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/gyp/process_resources.py ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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("//build/toolchain/toolchain.gni") 8 import("//build/toolchain/toolchain.gni")
9 import("//third_party/android_platform/config.gni") 9 import("//third_party/android_platform/config.gni")
10 import("//tools/grit/grit_rule.gni") 10 import("//tools/grit/grit_rule.gni")
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 # android_manifest: AndroidManifest.xml for this target. Defaults to 598 # android_manifest: AndroidManifest.xml for this target. Defaults to
599 # //build/android/AndroidManifest.xml. 599 # //build/android/AndroidManifest.xml.
600 # custom_package: java package for generated .java files. 600 # custom_package: java package for generated .java files.
601 # v14_skip: If true, don't run v14 resource generator on this. Defaults to 601 # v14_skip: If true, don't run v14 resource generator on this. Defaults to
602 # false. (see build/android/gyp/generate_v14_compatible_resources.py) 602 # false. (see build/android/gyp/generate_v14_compatible_resources.py)
603 # 603 #
604 # shared_resources: If true make a resource package that can be loaded by a 604 # shared_resources: If true make a resource package that can be loaded by a
605 # different application at runtime to access the package's resources. 605 # different application at runtime to access the package's resources.
606 # 606 #
607 607
608 # Example 608 # Example:
609 # android_resources("foo_resources") { 609 # android_resources("foo_resources") {
610 # deps = [":foo_strings_grd"] 610 # deps = [":foo_strings_grd"]
611 # resource_dirs = ["res"] 611 # resource_dirs = ["res"]
612 # custom_package = "org.chromium.foo" 612 # custom_package = "org.chromium.foo"
613 # } 613 # }
614 #
615 # android_resources("foo_resources_overrides") {
616 # deps = [":foo_resources"]
617 # resource_dirs = ["res_overrides"]
618 # }
614 template("android_resources") { 619 template("android_resources") {
615 set_sources_assignment_filter([]) 620 set_sources_assignment_filter([])
616 forward_variables_from(invoker, [ "testonly" ]) 621 forward_variables_from(invoker, [ "testonly" ])
617 622
618 assert(defined(invoker.resource_dirs)) 623 assert(defined(invoker.resource_dirs))
619 assert(defined(invoker.android_manifest) || defined(invoker.custom_package))
620 624
621 base_path = "$target_gen_dir/$target_name" 625 base_path = "$target_gen_dir/$target_name"
622 zip_path = base_path + ".resources.zip" 626 zip_path = base_path + ".resources.zip"
623 srcjar_path = base_path + ".srcjar" 627 srcjar_path = base_path + ".srcjar"
624 r_text_path = base_path + "_R.txt" 628 r_text_path = base_path + "_R.txt"
625 build_config = base_path + ".build_config" 629 build_config = base_path + ".build_config"
626 630
627 build_config_target_name = "${target_name}__build_config" 631 build_config_target_name = "${target_name}__build_config"
628 process_resources_target_name = "${target_name}__process_resources" 632 process_resources_target_name = "${target_name}__process_resources"
629 final_target_name = target_name 633 final_target_name = target_name
630 634
631 write_build_config(build_config_target_name) { 635 write_build_config(build_config_target_name) {
632 forward_variables_from(invoker, 636 forward_variables_from(invoker,
633 [ 637 [
634 "android_manifest", 638 "android_manifest",
635 "custom_package", 639 "custom_package",
636 "deps", 640 "deps",
637 ]) 641 ])
642
643 # No package means resources override their deps.
644 if (defined(custom_package) || defined(android_manifest)) {
645 r_text = r_text_path
646 } else {
647 assert(defined(invoker.deps),
648 "Must specify deps when custom_package is omitted.")
649 }
638 visibility = [ ":$process_resources_target_name" ] 650 visibility = [ ":$process_resources_target_name" ]
639 651
640 type = "android_resources" 652 type = "android_resources"
641 resources_zip = zip_path 653 resources_zip = zip_path
642 srcjar = srcjar_path 654 srcjar = srcjar_path
643 r_text = r_text_path
644 } 655 }
645 656
646 process_resources(process_resources_target_name) { 657 process_resources(process_resources_target_name) {
647 visibility = [ ":$final_target_name" ] 658 visibility = [ ":$final_target_name" ]
648 deps = [] 659 deps = []
649 forward_variables_from(invoker, 660 forward_variables_from(invoker,
650 [ 661 [
651 "android_manifest", 662 "android_manifest",
652 "custom_package", 663 "custom_package",
653 "deps", 664 "deps",
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
2010 2021
2011 # TODO(GYP): implement this. 2022 # TODO(GYP): implement this.
2012 template("uiautomator_test") { 2023 template("uiautomator_test") {
2013 set_sources_assignment_filter([]) 2024 set_sources_assignment_filter([])
2014 forward_variables_from(invoker, [ "testonly" ]) 2025 forward_variables_from(invoker, [ "testonly" ])
2015 assert(target_name != "") 2026 assert(target_name != "")
2016 assert(invoker.deps != [] || true) 2027 assert(invoker.deps != [] || true)
2017 group(target_name) { 2028 group(target_name) {
2018 } 2029 }
2019 } 2030 }
OLDNEW
« no previous file with comments | « build/android/gyp/process_resources.py ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698