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("//tools/grit/grit_rule.gni") | 5 import("//tools/grit/grit_rule.gni") |
6 import("//third_party/brotli/brotli.gni") | |
7 | 6 |
8 about_credits_file = "$target_gen_dir/about_credits.html" | 7 about_credits_file = "$target_gen_dir/about_credits.html" |
9 about_credits_file_bro = "$target_gen_dir/about_credits.bro" | |
10 | 8 |
11 # GYP version: components/components_resources.gyp:components_resources | 9 # GYP version: components/components_resources.gyp:components_resources |
12 group("resources") { | 10 group("resources") { |
13 public_deps = [ | 11 public_deps = [ |
14 ":components_resources", | 12 ":components_resources", |
15 ":components_scaled_resources", | 13 ":components_scaled_resources", |
16 ] | 14 ] |
17 } | 15 } |
18 | 16 |
19 # GYP version: components/components_resources.gyp | 17 # GYP version: components/components_resources.gyp |
20 # (generate_components_resources action) | 18 # (generate_components_resources action) |
21 grit("components_resources") { | 19 grit("components_resources") { |
22 source = "components_resources.grd" | 20 source = "components_resources.grd" |
23 | 21 |
24 # TODO(hashimoto): Remove this line. | 22 # TODO(hashimoto): Remove this line. |
25 output_name = "components_resources_new" | 23 output_name = "components_resources_new" |
26 outputs = [ | 24 outputs = [ |
27 "grit/components_resources.h", | 25 "grit/components_resources.h", |
28 "components_resources.pak", | 26 "components_resources.pak", |
29 ] | 27 ] |
30 output_dir = "$root_gen_dir/components" | 28 output_dir = "$root_gen_dir/components" |
31 | 29 |
32 grit_flags = [ | 30 grit_flags = [ |
33 "-E", | 31 "-E", |
34 "about_credits_file=" + rebase_path(about_credits_file_bro, root_build_dir), | 32 "about_credits_file=" + rebase_path(about_credits_file, root_build_dir), |
35 ] | 33 ] |
36 | 34 |
37 deps = [ | 35 deps = [ |
38 ":compressed_about_credits", | 36 ":about_credits", |
39 ] | 37 ] |
40 } | 38 } |
41 | 39 |
42 # GYP version: components/components_resources.gyp | 40 # GYP version: components/components_resources.gyp |
43 # (generate_scaled_components_resources action) | 41 # (generate_scaled_components_resources action) |
44 grit("components_scaled_resources") { | 42 grit("components_scaled_resources") { |
45 source = "components_scaled_resources.grd" | 43 source = "components_scaled_resources.grd" |
46 | 44 |
47 # TODO(hashimoto): Remove this line. | 45 # TODO(hashimoto): Remove this line. |
48 output_name = "components_scaled_resources_new" | 46 output_name = "components_scaled_resources_new" |
49 outputs = [ | 47 outputs = [ |
50 "grit/components_scaled_resources.h", | 48 "grit/components_scaled_resources.h", |
51 "grit/components_scaled_resources_map.cc", | 49 "grit/components_scaled_resources_map.cc", |
52 "grit/components_scaled_resources_map.h", | 50 "grit/components_scaled_resources_map.h", |
53 "components_resources_100_percent.pak", | 51 "components_resources_100_percent.pak", |
54 "components_resources_200_percent.pak", | 52 "components_resources_200_percent.pak", |
55 "components_resources_300_percent.pak", | 53 "components_resources_300_percent.pak", |
56 "components_resources_material_100_percent.pak", | 54 "components_resources_material_100_percent.pak", |
57 "components_resources_material_200_percent.pak", | 55 "components_resources_material_200_percent.pak", |
58 ] | 56 ] |
59 output_dir = "$root_gen_dir/components" | 57 output_dir = "$root_gen_dir/components" |
60 } | 58 } |
61 | 59 |
62 compress_file_brotli("compressed_about_credits") { | |
63 input_file = about_credits_file | |
64 output_file = about_credits_file_bro | |
65 deps = [ | |
66 ":about_credits", | |
67 ] | |
68 } | |
69 | |
70 # GYP version: components/components_resources.gyp:about_credits | 60 # GYP version: components/components_resources.gyp:about_credits |
71 action("about_credits") { | 61 action("about_credits") { |
72 script = "//tools/licenses.py" | 62 script = "//tools/licenses.py" |
73 | 63 |
74 inputs = [ | 64 inputs = [ |
75 # This is not a complete list. TODO(phajdan.jr, dbeam): licenses.py needs to | 65 # This is not a complete list. TODO(phajdan.jr, dbeam): licenses.py needs to |
76 # generate a .d file with all the licenses/credits that about:credits uses. | 66 # generate a .d file with all the licenses/credits that about:credits uses. |
77 # Then about:credits will automatically rebuild when one of them changes. | 67 # Then about:credits will automatically rebuild when one of them changes. |
78 # See: depfile in gn's documentation (gn help depfile). | 68 # See: depfile in gn's documentation (gn help depfile). |
79 "../about_ui/resources/about_credits.tmpl", | 69 "../about_ui/resources/about_credits.tmpl", |
80 "../about_ui/resources/about_credits_entry.tmpl", | 70 "../about_ui/resources/about_credits_entry.tmpl", |
81 ] | 71 ] |
82 | 72 |
83 outputs = [ | 73 outputs = [ |
84 about_credits_file, | 74 about_credits_file, |
85 ] | 75 ] |
86 | 76 |
87 args = [ | 77 args = [ |
88 "--target-os=$target_os", | 78 "--target-os=$target_os", |
89 "credits", | 79 "credits", |
90 rebase_path(about_credits_file, root_build_dir), | 80 rebase_path(about_credits_file, root_build_dir), |
91 ] | 81 ] |
92 } | 82 } |
OLD | NEW |