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