summaryrefslogtreecommitdiff
path: root/chromium/components/resources/BUILD.gn
blob: 388751cf0ba3157c0554cee1f4b2cbdb7e882400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//tools/grit/grit_rule.gni")

about_credits_file = "$target_gen_dir/about_credits.html"

# GYP version: components/components_resources.gyp:components_resources
group("resources") {
  public_deps = [
    ":components_resources",
    ":components_scaled_resources",
  ]
}

# GYP version: components/components_resources.gyp
#              (generate_components_resources action)
grit("components_resources") {
  source = "components_resources.grd"

  # TODO(hashimoto): Remove this line.
  output_name = "components_resources_new"
  outputs = [
    "grit/components_resources.h",
    "components_resources.pak",
  ]
  output_dir = "$root_gen_dir/components"

  grit_flags = [
    "-E",
    "about_credits_file=" + rebase_path(about_credits_file, root_build_dir),
  ]

  deps = [
    ":about_credits",
  ]
}

# GYP version: components/components_resources.gyp
#              (generate_scaled_components_resources action)
grit("components_scaled_resources") {
  source = "components_scaled_resources.grd"

  # TODO(hashimoto): Remove this line.
  output_name = "components_scaled_resources_new"
  outputs = [
    "grit/components_scaled_resources.h",
    "components_resources_100_percent.pak",
    "components_resources_200_percent.pak",
    "components_resources_300_percent.pak",
    "components_resources_material_100_percent.pak",
    "components_resources_material_200_percent.pak",
  ]
  output_dir = "$root_gen_dir/components"
}

# GYP version: components/components_resources.gyp:about_credits
action("about_credits") {
  script = "//tools/licenses.py"

  inputs = [
    # This is not a complete list. TODO(phajdan.jr, dbeam): licenses.py needs to
    # generate a .d file with all the licenses/credits that about:credits uses.
    # Then about:credits will automatically rebuild when one of them changes.
    # See: depfile in gn's documentation (gn help depfile).
    "../about_ui/resources/about_credits.tmpl",
    "../about_ui/resources/about_credits_entry.tmpl",
  ]

  outputs = [
    about_credits_file,
  ]

  args = [
    "credits",
    rebase_path(about_credits_file, root_build_dir),
  ]
}