OLD | NEW |
| (Empty) |
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 | |
5 import("//tools/grit/grit_rule.gni") | |
6 import("//tools/grit/repack.gni") | |
7 | |
8 # GYP version: ui/resources/ui_resources.gyp:ui_resources | |
9 group("resources") { | |
10 deps = [ | |
11 ":ui_resources_grd", | |
12 ":ui_unscaled_resources_grd", | |
13 ] | |
14 } | |
15 | |
16 grit("ui_resources_grd") { | |
17 source = "ui_resources.grd" | |
18 outputs = [ | |
19 "grit/ui_resources.h", | |
20 "grit/ui_resources_map.cc", | |
21 "grit/ui_resources_map.h", | |
22 "ui_resources_100_percent.pak", | |
23 "ui_resources_200_percent.pak", | |
24 ] | |
25 } | |
26 | |
27 grit("ui_unscaled_resources_grd") { | |
28 source = "ui_unscaled_resources.grd" | |
29 use_qualified_include = true | |
30 outputs = [ | |
31 "grit/ui_unscaled_resources.h", | |
32 "ui_unscaled_resources.rc", | |
33 ] | |
34 } | |
35 | |
36 if (!is_mac) { | |
37 copy("copy_ui_resources_100_percent") { | |
38 sources = [ | |
39 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", | |
40 ] | |
41 outputs = [ | |
42 "$root_out_dir/ui_resources_100_percent.pak", | |
43 ] | |
44 deps = [ | |
45 "//ui/resources", | |
46 ] | |
47 } | |
48 } | |
49 | |
50 # On iOS and Mac the string resources need to go into a locale subfolder, which | |
51 # introduces an extra dependency. | |
52 # | |
53 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak | |
54 # (copy_ui_test_pak action) | |
55 if (is_ios || is_mac) { | |
56 group("ui_test_pak") { | |
57 deps = [ | |
58 ":repack_ui_test_pak", | |
59 ":repack_ui_test_mac_locale_pack", | |
60 ] | |
61 } | |
62 } else { | |
63 group("ui_test_pak") { | |
64 deps = [ | |
65 ":repack_ui_test_pak", | |
66 ] | |
67 } | |
68 } | |
69 | |
70 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak | |
71 repack("repack_ui_test_pak") { | |
72 # Depend on ui_test_pak instead of this one. | |
73 visibility = [ ":ui_test_pak" ] | |
74 | |
75 sources = [ | |
76 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", | |
77 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", | |
78 "$root_gen_dir/ui/strings/ui_strings_en-US.pak", | |
79 ] | |
80 | |
81 output = "$root_out_dir/ui_test.pak" | |
82 | |
83 deps = [ | |
84 "//ui/resources", | |
85 "//ui/strings", | |
86 ] | |
87 | |
88 if (!is_mac) { | |
89 deps += [ ":copy_ui_resources_100_percent" ] | |
90 } | |
91 } | |
92 | |
93 # Repack just the strings for the framework locales on Mac and iOS. This | |
94 # emulates repack_locales.py, but just for en-US. Note ui_test.pak is not simply | |
95 # copied, because it causes leaks from allocations within system libraries when | |
96 # trying to load non-string resources. http://crbug.com/413034. | |
97 repack("repack_ui_test_mac_locale_pack") { | |
98 visibility = [ ":ui_test_pak" ] | |
99 | |
100 sources = [ | |
101 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", | |
102 "$root_gen_dir/ui/strings/ui_strings_en-US.pak", | |
103 ] | |
104 | |
105 output = "$root_out_dir/ui/en.lproj/locale.pak" | |
106 | |
107 deps = [ | |
108 "//ui/strings", | |
109 ] | |
110 } | |
OLD | NEW |