[email protected] | 63b99ff | 2014-04-24 00:37:30 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
Yaron Friedman | 27c732b | 2019-04-02 23:31:06 | [diff] [blame] | 5 | import("//build/config/android/config.gni") |
Daniel Rubery | af17ad3 | 2020-03-02 20:06:49 | [diff] [blame] | 6 | import("//components/safe_browsing/buildflags.gni") |
Scott Violet | 318a55f | 2018-03-30 19:08:19 | [diff] [blame] | 7 | import("//printing/buildflags/buildflags.gni") |
Yaron Friedman | 27c732b | 2019-04-02 23:31:06 | [diff] [blame] | 8 | import("//tools/grit/grit_rule.gni") |
[email protected] | 63b99ff | 2014-04-24 00:37:30 | [diff] [blame] | 9 | |
Mugdha Lakhani | b676216 | 2020-03-30 10:23:25 | [diff] [blame] | 10 | if (is_android) { |
| 11 | import("//build/config/android/rules.gni") |
| 12 | } |
| 13 | |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 14 | about_credits_file = "$target_gen_dir/about_credits.html" |
| 15 | |
[email protected] | 797b2504 | 2014-07-01 23:54:17 | [diff] [blame] | 16 | group("resources") { |
brettw | 717185d | 2015-09-18 19:58:57 | [diff] [blame] | 17 | public_deps = [ |
[email protected] | 797b2504 | 2014-07-01 23:54:17 | [diff] [blame] | 18 | ":components_resources", |
| 19 | ":components_scaled_resources", |
Samuel Huang | 1b99a06 | 2020-01-08 22:20:34 | [diff] [blame] | 20 | ":dev_ui_components_resources", |
[email protected] | 797b2504 | 2014-07-01 23:54:17 | [diff] [blame] | 21 | ] |
| 22 | } |
| 23 | |
[email protected] | 63b99ff | 2014-04-24 00:37:30 | [diff] [blame] | 24 | grit("components_resources") { |
| 25 | source = "components_resources.grd" |
scottmg | ac0ea031 | 2014-12-03 19:21:05 | [diff] [blame] | 26 | |
Nico Weber | d77e027c | 2020-01-16 18:40:48 | [diff] [blame] | 27 | inputs = [ about_credits_file ] |
Jacques Chen | 818312d | 2019-07-22 18:12:09 | [diff] [blame] | 28 | |
[email protected] | b89c5384 | 2014-07-23 16:32:32 | [diff] [blame] | 29 | outputs = [ |
hashimoto | cfb460f | 2014-09-25 06:59:00 | [diff] [blame] | 30 | "grit/components_resources.h", |
| 31 | "components_resources.pak", |
[email protected] | b89c5384 | 2014-07-23 16:32:32 | [diff] [blame] | 32 | ] |
mukai | fc01b28 | 2014-10-10 06:27:11 | [diff] [blame] | 33 | output_dir = "$root_gen_dir/components" |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 34 | |
Jacques Chen | 6cd9b53 | 2019-08-08 02:53:19 | [diff] [blame] | 35 | use_brotli = true |
| 36 | |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 37 | grit_flags = [ |
| 38 | "-E", |
Jacques Chen | 818312d | 2019-07-22 18:12:09 | [diff] [blame] | 39 | "about_credits_file=" + rebase_path(about_credits_file, root_build_dir), |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 40 | ] |
Colin Blundell | 5c8efdd | 2020-01-24 11:04:03 | [diff] [blame] | 41 | |
jzfeng | 3d83dad | 2017-05-09 03:44:18 | [diff] [blame] | 42 | defines = [ |
| 43 | "enable_basic_printing=$enable_basic_printing", |
| 44 | "enable_print_preview=$enable_print_preview", |
Daniel Rubery | af17ad3 | 2020-03-02 20:06:49 | [diff] [blame] | 45 | "safe_browsing_mode=$safe_browsing_mode", |
| 46 | "is_fuchsia=$is_fuchsia", |
jzfeng | 3d83dad | 2017-05-09 03:44:18 | [diff] [blame] | 47 | ] |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 48 | |
Nico Weber | d77e027c | 2020-01-16 18:40:48 | [diff] [blame] | 49 | deps = [ ":about_credits" ] |
Colin Blundell | 5c8efdd | 2020-01-24 11:04:03 | [diff] [blame] | 50 | |
| 51 | if (!is_ios) { |
| 52 | deps += [ "//components/resources/ssl/ssl_error_assistant:make_ssl_error_assistant_protobuf" ] |
| 53 | } |
Daniel Rubery | af17ad3 | 2020-03-02 20:06:49 | [diff] [blame] | 54 | |
Daniel Rubery | 4fac1e8 | 2021-07-12 19:06:06 | [diff] [blame] | 55 | if (safe_browsing_mode > 0) { |
Colin Blundell | c8669e3 | 2021-07-05 10:48:04 | [diff] [blame] | 56 | deps += [ |
| 57 | "//components/safe_browsing/content/resources:make_file_types_protobuf", |
| 58 | ] |
Daniel Rubery | af17ad3 | 2020-03-02 20:06:49 | [diff] [blame] | 59 | } |
[email protected] | 63b99ff | 2014-04-24 00:37:30 | [diff] [blame] | 60 | } |
[email protected] | 797b2504 | 2014-07-01 23:54:17 | [diff] [blame] | 61 | |
Samuel Huang | 1b99a06 | 2020-01-08 22:20:34 | [diff] [blame] | 62 | grit("dev_ui_components_resources") { |
| 63 | source = "dev_ui_components_resources.grd" |
| 64 | |
| 65 | outputs = [ |
| 66 | "grit/dev_ui_components_resources.h", |
| 67 | "dev_ui_components_resources.pak", |
| 68 | ] |
| 69 | output_dir = "$root_gen_dir/components" |
| 70 | } |
| 71 | |
[email protected] | 797b2504 | 2014-07-01 23:54:17 | [diff] [blame] | 72 | grit("components_scaled_resources") { |
| 73 | source = "components_scaled_resources.grd" |
scottmg | ac0ea031 | 2014-12-03 19:21:05 | [diff] [blame] | 74 | |
[email protected] | b89c5384 | 2014-07-23 16:32:32 | [diff] [blame] | 75 | outputs = [ |
hashimoto | cfb460f | 2014-09-25 06:59:00 | [diff] [blame] | 76 | "grit/components_scaled_resources.h", |
droger | 2a6ab54 | 2015-10-09 16:10:28 | [diff] [blame] | 77 | "grit/components_scaled_resources_map.cc", |
| 78 | "grit/components_scaled_resources_map.h", |
hashimoto | cfb460f | 2014-09-25 06:59:00 | [diff] [blame] | 79 | "components_resources_100_percent.pak", |
| 80 | "components_resources_200_percent.pak", |
lliabraa | ea7d740 | 2014-10-31 22:09:38 | [diff] [blame] | 81 | "components_resources_300_percent.pak", |
[email protected] | b89c5384 | 2014-07-23 16:32:32 | [diff] [blame] | 82 | ] |
mukai | fc01b28 | 2014-10-10 06:27:11 | [diff] [blame] | 83 | output_dir = "$root_gen_dir/components" |
[email protected] | 797b2504 | 2014-07-01 23:54:17 | [diff] [blame] | 84 | } |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 85 | |
Takuto Ikuta | 67486595 | 2021-05-28 04:02:24 | [diff] [blame] | 86 | action("about_credits") { |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 87 | script = "//tools/licenses.py" |
agrieve | be96180 | 2017-02-15 18:48:20 | [diff] [blame] | 88 | depfile = "$target_gen_dir/$target_name.d" |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 89 | |
| 90 | inputs = [ |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 91 | "../about_ui/resources/about_credits.tmpl", |
| 92 | "../about_ui/resources/about_credits_entry.tmpl", |
| 93 | ] |
| 94 | |
Nico Weber | d77e027c | 2020-01-16 18:40:48 | [diff] [blame] | 95 | outputs = [ about_credits_file ] |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 96 | |
| 97 | args = [ |
sdefresne | d13d15b | 2016-02-17 18:06:54 | [diff] [blame] | 98 | "--target-os=$target_os", |
agrieve | be96180 | 2017-02-15 18:48:20 | [diff] [blame] | 99 | "--depfile", |
| 100 | rebase_path(depfile, root_build_dir), |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 101 | "credits", |
| 102 | rebase_path(about_credits_file, root_build_dir), |
| 103 | ] |
Mohamed Heikal | 717315e | 2021-03-17 19:46:36 | [diff] [blame] | 104 | |
| 105 | # Defined by downstream projects. |
| 106 | if (defined(extra_third_party_notice_dirs)) { |
| 107 | args += [ "--extra-third-party-dirs=$extra_third_party_notice_dirs" ] |
| 108 | } |
droger | 1f86ef6 | 2015-10-01 13:05:22 | [diff] [blame] | 109 | } |
Mugdha Lakhani | b676216 | 2020-03-30 10:23:25 | [diff] [blame] | 110 | |
| 111 | if (is_android) { |
| 112 | source_set("android_resources") { |
| 113 | sources = [ |
Clark DuVall | 911f84fc | 2020-06-17 03:47:03 | [diff] [blame] | 114 | "android/blocked_content_resource_id.h", |
Mugdha Lakhani | b676216 | 2020-03-30 10:23:25 | [diff] [blame] | 115 | "android/page_info_resource_id.h", |
| 116 | "android/permissions_resource_id.h", |
Evan Stade | 8fd3c8e4 | 2020-08-08 02:43:29 | [diff] [blame] | 117 | "android/sms_resource_id.h", |
Mugdha Lakhani | b676216 | 2020-03-30 10:23:25 | [diff] [blame] | 118 | "android/theme_resources.h", |
Alexander Cooper | fc608d5 | 2020-10-12 20:03:34 | [diff] [blame] | 119 | "android/webxr_resource_id.h", |
Mugdha Lakhani | b676216 | 2020-03-30 10:23:25 | [diff] [blame] | 120 | ] |
Alexander Cooper | fc608d5 | 2020-10-12 20:03:34 | [diff] [blame] | 121 | |
| 122 | public_deps = [ "//device/vr/buildflags" ] |
Mugdha Lakhani | b676216 | 2020-03-30 10:23:25 | [diff] [blame] | 123 | } |
| 124 | } |