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("//tools/grit/repack.gni") | 6 import("//tools/grit/repack.gni") |
7 | 7 |
8 # GYP version: ui/resources/ui_resources.gyp:ui_resources | 8 # GYP version: ui/resources/ui_resources.gyp:ui_resources |
9 group("resources") { | 9 group("resources") { |
10 deps = [ | 10 deps = [ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 if (!is_mac) { | 47 if (!is_mac) { |
48 copy("copy_ui_resources_100_percent") { | 48 copy("copy_ui_resources_100_percent") { |
49 sources = [ "$root_gen_dir/ui/resources/ui_resources_100_percent.pak" ] | 49 sources = [ "$root_gen_dir/ui/resources/ui_resources_100_percent.pak" ] |
50 outputs = [ "$root_out_dir/ui_resources_100_percent.pak" ] | 50 outputs = [ "$root_out_dir/ui_resources_100_percent.pak" ] |
51 deps = [ "//ui/resources" ] | 51 deps = [ "//ui/resources" ] |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 # On iOS the output needs to additionally be copied to another location, so | 55 # On iOS and Mac the string resources need to go into a locale subfolder, which |
56 # we have this intermediate step. | 56 # introduces an extra dependency. |
57 # | 57 # |
58 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak | 58 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak |
59 # (copy_ui_test_pak action) | 59 # (copy_ui_test_pak action) |
60 if (is_ios) { | 60 if (is_ios || is_mac) { |
61 copy("ui_test_pak") { | 61 group("ui_test_pak") { |
62 sources = [ "$root_out_dir/ui_test.pak" ] | 62 deps = [ ":repack_ui_test_pak", ":repack_ui_test_mac_locale_pack" ] |
63 outputs = [ "$root_out_dir/ui/en.lproj/locale.pak" ] | |
64 deps = [ ":repack_ui_test_pak" ] | |
65 } | 63 } |
66 } else { | 64 } else { |
67 group("ui_test_pak") { | 65 group("ui_test_pak") { |
68 deps = [ ":repack_ui_test_pak" ] | 66 deps = [ ":repack_ui_test_pak" ] |
69 } | 67 } |
70 } | 68 } |
71 | 69 |
72 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak | 70 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak |
73 repack("repack_ui_test_pak") { | 71 repack("repack_ui_test_pak") { |
74 # Depend on ui_test_pak instead of this one. | 72 # Depend on ui_test_pak instead of this one. |
75 visibility = [ ":ui_test_pak" ] | 73 visibility = [ ":ui_test_pak" ] |
76 | 74 |
77 sources = [ | 75 sources = [ |
78 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", | 76 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", |
79 "$root_gen_dir/ui/resources/webui_resources.pak", | 77 "$root_gen_dir/ui/resources/webui_resources.pak", |
80 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", | 78 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", |
81 "$root_gen_dir/ui/strings/ui_strings_en-US.pak", | 79 "$root_gen_dir/ui/strings/ui_strings_en-US.pak", |
82 ] | 80 ] |
83 | 81 |
84 output = "$root_out_dir/ui_test.pak" | 82 output = "$root_out_dir/ui_test.pak" |
85 | 83 |
86 deps = [ | 84 deps = [ |
87 "//ui/resources", | 85 "//ui/resources", |
88 "//ui/strings", | 86 "//ui/strings", |
89 ] | 87 ] |
90 | 88 |
91 if (!is_mac) { | 89 if (!is_mac) { |
92 deps += [ ":copy_ui_resources_100_percent" ] | 90 deps += [ ":copy_ui_resources_100_percent" ] |
93 } | 91 } |
94 } | 92 } |
| 93 |
| 94 # Repack just the strings for the framework locales on Mac and iOS. This |
| 95 # emulates repack_locales.py, but just for en-US. Note ui_test.pak is not simply |
| 96 # copied, because it causes leaks from allocations within system libraries when |
| 97 # trying to load non-string resources. http://crbug.com/413034. |
| 98 repack("repack_ui_test_mac_locale_pack") { |
| 99 visibility = [ ":ui_test_pak" ] |
| 100 |
| 101 sources = [ |
| 102 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", |
| 103 "$root_gen_dir/ui/strings/ui_strings_en-US.pak", |
| 104 ] |
| 105 |
| 106 output = "$root_out_dir/ui/en.lproj/locale.pak" |
| 107 |
| 108 deps = [ |
| 109 "//ui/strings", |
| 110 ] |
| 111 } |
OLD | NEW |