OLD | NEW |
| (Empty) |
1 # Copyright 2016 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("//blimp/client/core/config.gni") | |
6 import("//build/config/locales.gni") | |
7 import("//tools/grit/grit_rule.gni") | |
8 import("//tools/grit/repack.gni") | |
9 | |
10 if (is_android) { | |
11 import("//build/config/android/config.gni") | |
12 import("//build/config/android/rules.gni") | |
13 } | |
14 | |
15 # String resources for the embedder. Build different internal resource sets base
d on | |
16 # |enable_blimp_client| flag. | |
17 group("strings") { | |
18 visibility = [ "//blimp/client/public/resources" ] | |
19 public_deps = [ | |
20 ":locales", | |
21 ] | |
22 } | |
23 | |
24 # Build string locale files based on |enable_blimp_client| flag. | |
25 # The embedder will take the output files to continue its build chain without kn
owing the | |
26 # |enable_blimp_client| build flag. | |
27 repack_locales("locales") { | |
28 visibility = [ ":strings" ] | |
29 | |
30 input_locales = locales_with_fake_bidi | |
31 output_locales = [] | |
32 foreach(locale, locales_with_fake_bidi) { | |
33 output_locales += [ "blimp_strings_$locale" ] | |
34 } | |
35 | |
36 if (enable_blimp_client) { | |
37 source_patterns = | |
38 [ "${root_gen_dir}/blimp/client/core/resources/blimp_strings_" ] | |
39 deps = [ | |
40 ":string_data", | |
41 ] | |
42 } else { | |
43 source_patterns = | |
44 [ "${root_gen_dir}/blimp/client/core/resources/dummy/blimp_strings_" ] | |
45 deps = [ | |
46 ":dummy_string_data", | |
47 ] | |
48 } | |
49 | |
50 output_dir = "$root_gen_dir/blimp/client/public/resources" | |
51 } | |
52 | |
53 # Blimp internal resource. Blimp internal build targets may directly depends on
this. | |
54 # //blimp/client/public shouldn't directly depend on this since we want to | |
55 # build different things based on |enable_blimp_client| build flag. | |
56 source_set("resources") { | |
57 visibility = [ "//blimp/client/core/*" ] | |
58 | |
59 sources = [ | |
60 "blimp_strings.cc", | |
61 ] | |
62 | |
63 public_deps = [ | |
64 ":string_data", | |
65 ] | |
66 | |
67 deps = [ | |
68 "//blimp/client/public:public_headers", | |
69 "//blimp/common/proto", | |
70 "//ui/base:base", | |
71 ] | |
72 } | |
73 | |
74 # Dummy Blimp internal resource. It doesn't build any string data, and string he
lper functions | |
75 # return empty values to the embedder. | |
76 # Blimp internal targets shouldn't depend on this. | |
77 source_set("dummy") { | |
78 visibility = [ "//blimp/client/core/*" ] | |
79 | |
80 sources = [ | |
81 "dummy_blimp_strings.cc", | |
82 ] | |
83 | |
84 public_deps = [ | |
85 ":dummy_string_data", | |
86 ] | |
87 | |
88 deps = [ | |
89 "//blimp/client/public:public_headers", | |
90 ] | |
91 } | |
92 | |
93 if (is_android) { | |
94 android_blimp_java_resources = [ | |
95 "java/res/values-am/blimp_strings.xml", | |
96 "java/res/values-ar/blimp_strings.xml", | |
97 "java/res/values-bg/blimp_strings.xml", | |
98 "java/res/values-ca/blimp_strings.xml", | |
99 "java/res/values-cs/blimp_strings.xml", | |
100 "java/res/values-da/blimp_strings.xml", | |
101 "java/res/values-de/blimp_strings.xml", | |
102 "java/res/values-el/blimp_strings.xml", | |
103 "java/res/values/blimp_strings.xml", | |
104 "java/res/values-en-rGB/blimp_strings.xml", | |
105 "java/res/values-es/blimp_strings.xml", | |
106 "java/res/values-es-rUS/blimp_strings.xml", | |
107 "java/res/values-fa/blimp_strings.xml", | |
108 "java/res/values-fi/blimp_strings.xml", | |
109 "java/res/values-tl/blimp_strings.xml", | |
110 "java/res/values-fr/blimp_strings.xml", | |
111 "java/res/values-hi/blimp_strings.xml", | |
112 "java/res/values-hr/blimp_strings.xml", | |
113 "java/res/values-hu/blimp_strings.xml", | |
114 "java/res/values-in/blimp_strings.xml", | |
115 "java/res/values-it/blimp_strings.xml", | |
116 "java/res/values-iw/blimp_strings.xml", | |
117 "java/res/values-ja/blimp_strings.xml", | |
118 "java/res/values-ko/blimp_strings.xml", | |
119 "java/res/values-lt/blimp_strings.xml", | |
120 "java/res/values-lv/blimp_strings.xml", | |
121 "java/res/values-nl/blimp_strings.xml", | |
122 "java/res/values-nb/blimp_strings.xml", | |
123 "java/res/values-pl/blimp_strings.xml", | |
124 "java/res/values-pt-rBR/blimp_strings.xml", | |
125 "java/res/values-pt-rPT/blimp_strings.xml", | |
126 "java/res/values-ro/blimp_strings.xml", | |
127 "java/res/values-ru/blimp_strings.xml", | |
128 "java/res/values-sk/blimp_strings.xml", | |
129 "java/res/values-sl/blimp_strings.xml", | |
130 "java/res/values-sr/blimp_strings.xml", | |
131 "java/res/values-sv/blimp_strings.xml", | |
132 "java/res/values-sw/blimp_strings.xml", | |
133 "java/res/values-th/blimp_strings.xml", | |
134 "java/res/values-tr/blimp_strings.xml", | |
135 "java/res/values-uk/blimp_strings.xml", | |
136 "java/res/values-vi/blimp_strings.xml", | |
137 "java/res/values-zh-rCN/blimp_strings.xml", | |
138 "java/res/values-zh-rTW/blimp_strings.xml", | |
139 ] | |
140 } | |
141 | |
142 # String data. | |
143 grit("string_data") { | |
144 source = "blimp_strings.grd" | |
145 use_qualified_include = true | |
146 outputs = [ | |
147 "grit/blimp_strings.h", | |
148 ] | |
149 | |
150 foreach(locale, locales_with_fake_bidi) { | |
151 outputs += [ "blimp_strings_$locale.pak" ] | |
152 } | |
153 | |
154 if (is_android) { | |
155 outputs += android_blimp_java_resources | |
156 } | |
157 } | |
158 | |
159 # Dummy string data. | |
160 grit("dummy_string_data") { | |
161 source = "dummy_blimp_strings.grd" | |
162 use_qualified_include = true | |
163 | |
164 outputs = [ | |
165 "grit/dummy_blimp_strings.h", | |
166 ] | |
167 | |
168 foreach(locale, locales_with_fake_bidi) { | |
169 outputs += [ "dummy/blimp_strings_$locale.pak" ] | |
170 } | |
171 } | |
172 | |
173 if (is_android) { | |
174 # Android resources needed to wrap the apk. This includes xml resources files
and string xml | |
175 # files that are generated from the grd file. | |
176 android_resources("java_resources") { | |
177 visibility = [ "//blimp/client/core/*" ] | |
178 | |
179 resource_dirs = [ "android/java/res" ] | |
180 deps = [ | |
181 ":strings_grd", | |
182 ] | |
183 | |
184 # TODO(xingliu): Consider changing the package name to |org.chromium.blimp|
if we remove the | |
185 # grd file in //blimp/client/app. | |
186 custom_package = "org.chromium.blimp.core" | |
187 } | |
188 | |
189 # Generate Java string resources from blimp_strings grd file. Mark formatter_d
ata to | |
190 # "android_java" for strings needed in the apk. | |
191 # To access Java strings, use |org.chromium.blimp.core.R|. | |
192 java_strings_grd_prebuilt("strings_grd") { | |
193 visibility = [ "//blimp/client/core/*" ] | |
194 | |
195 grit_output_dir = "$root_gen_dir/blimp/client/core/resources/java/res" | |
196 generated_files = | |
197 rebase_path(android_blimp_java_resources, "../android/java/res", ".") | |
198 deps = [ | |
199 ":string_data", | |
200 ] | |
201 } | |
202 } | |
OLD | NEW |