summaryrefslogtreecommitdiffstats
path: root/ui/resources/BUILD.gn
blob: e4dbd9386e0d6e5f0e5308a65388cfe2fab04290 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# 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")
import("//tools/grit/repack.gni")

# GYP version: ui/resources/ui_resources.gyp:ui_resources
group("resources") {
  deps = [
    ":ui_resources_grd",
    ":ui_unscaled_resources_grd",
    ":webui_resources_grd",
  ]
}

grit("ui_resources_grd") {
  visibility = ":resources"
  source = "ui_resources.grd"
  outputs = [
    "grit/ui_resources.h",
    "grit/ui_resources_map.cc",
    "grit/ui_resources_map.h",
    "ui_resources_100_percent.pak",
    "ui_resources_200_percent.pak",
  ]
}

grit("ui_unscaled_resources_grd") {
  visibility = ":resources"
  source = "ui_unscaled_resources.grd"
  outputs = [
    "grit/ui_unscaled_resources.h",
    "ui_unscaled_resources.rc",
  ]
}

grit("webui_resources_grd") {
  visibility = ":resources"
  source = "../webui/resources/webui_resources.grd"
  outputs = [
    "grit/webui_resources.h",
    "grit/webui_resources_map.cc",
    "grit/webui_resources_map.h",
    "webui_resources.pak",
  ]
}

if (!is_mac) {
  copy("copy_ui_resources_100_percent") {
    sources = [ "$root_gen_dir/ui/resources/ui_resources_100_percent.pak" ]
    outputs = [ "$root_out_dir/ui_resources_100_percent.pak" ]
    deps = [ "//ui/resources" ]
  }
}

# On iOS the output needs to additionally be copied to another location, so
# we have this intermediate step.
#
# GYP version: ui/resources/ui_resources.gyp:ui_test_pak
#              (copy_ui_test_pak action)
if (is_ios) {
  copy("ui_test_pak") {
    sources = [ "$root_out_dir/ui_test.pak" ]
    outputs = [ "$root_out_dir/ui/en.lproj/locale.pak" ]
    deps = [ ":repack_ui_test_pak" ]
  }
} else {
  group("ui_test_pak") {
    deps = [ ":repack_ui_test_pak" ]
  }
}

# GYP version: ui/resources/ui_resources.gyp:ui_test_pak
repack("repack_ui_test_pak") {
  # Depend on ui_test_pak instead of this one.
  visibility = ":ui_test_pak"

  sources = [ 
    "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
    "$root_gen_dir/ui/resources/webui_resources.pak",
    "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
    "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
  ]

  output = "$root_out_dir/ui_test.pak"

  deps = [
    "//ui/resources",
    "//ui/strings",
  ]

  if (!is_mac) {
    deps += [ ":copy_ui_resources_100_percent" ]
  }
}