Add files for Bazel build.
Hiroyuki Komatsu
3 years ago
0 | # Common options | |
1 | build --cxxopt "-std=c++17" | |
2 | build --copt "-funsigned-char" | |
3 | build --objccopt "-fsigned-char" | |
4 | ||
5 | # Linux | |
6 | build:linux --define TARGET=oss_linux | |
7 | build:oss_linux --define TARGET=oss_linux | |
8 | ||
9 | # Android | |
10 | build:android --define TARGET=oss_android \ | |
11 | --copt "-DOS_ANDROID" \ | |
12 | --crosstool_top=//external:android/crosstool --cpu=armeabi-v7a \ | |
13 | --host_crosstool_top=@bazel_tools//tools/cpp:toolchain | |
14 | build:oss_android --define TARGET=oss_android \ | |
15 | --copt "-DOS_ANDROID" \ | |
16 | --crosstool_top=//external:android/crosstool --cpu=armeabi-v7a \ | |
17 | --host_crosstool_top=@bazel_tools//tools/cpp:toolchain |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # Description: | |
31 | # Declaration of package_group for visibility managing. | |
32 | ||
33 | package_group( | |
34 | name = "mozc", | |
35 | packages = ["//..."], | |
36 | ) | |
37 | ||
38 | # White listed tests which are enabled on NaCl. | |
39 | # data_manager tests are excluded since they require files on real file system. | |
40 | # TODO(hsumita): Add chrome/nacl:nacl_test. | |
41 | NACL_COMMON_TESTS = [ | |
42 | "//base:nacl_test", | |
43 | "//composer:nacl_test", | |
44 | "//composer/internal:nacl_test", | |
45 | "//config:nacl_test", | |
46 | "//dictionary:nacl_test", | |
47 | "//engine:nacl_test", | |
48 | "//net:nacl_test", | |
49 | "//prediction:nacl_test", | |
50 | "//rewriter:nacl_test", | |
51 | "//session:nacl_test", | |
52 | "//session/internal:nacl_test", | |
53 | "//storage:nacl_test", | |
54 | "//storage/louds:nacl_test", | |
55 | "//transliteration:nacl_test", | |
56 | "//usage_stats:nacl_test", | |
57 | ] | |
58 | ||
59 | test_suite( | |
60 | name = "nacl_test", | |
61 | tests = NACL_COMMON_TESTS + [ | |
62 | "//converter:nacl_test", | |
63 | ], | |
64 | ) | |
65 | ||
66 | test_suite( | |
67 | name = "nacl_tap_test", | |
68 | tests = NACL_COMMON_TESTS + [ | |
69 | "//converter:nacl_tap_test", | |
70 | ], | |
71 | ) | |
72 | ||
73 | test_suite( | |
74 | name = "android_test", | |
75 | tests = [ | |
76 | "//base:android_test", | |
77 | "//session:android_test", | |
78 | ], | |
79 | ) | |
80 | ||
81 | config_setting( | |
82 | name = "opt", | |
83 | values = { | |
84 | "compilation_mode": "opt", | |
85 | }, | |
86 | visibility = ["//:__subpackages__"], | |
87 | ) | |
88 | ||
89 | # Special target so as to define special macros for Android and CrOS (NaCl). | |
90 | # Don't depend on this directly. Use cc_(library|binary|test)_mozc rule instead. | |
91 | cc_library( | |
92 | name = "macro", | |
93 | defines = select({ | |
94 | "//tools/cc_target_os:android": [ | |
95 | "MOZC_DISABLE_SESSION_WATCHDOG", | |
96 | "NO_USAGE_REWRITER", | |
97 | ], | |
98 | "//tools/cc_target_os:oss_android": [ | |
99 | "MOZC_DISABLE_SESSION_WATCHDOG", | |
100 | "NO_USAGE_REWRITER", | |
101 | ], | |
102 | "//tools/cc_target_os:linux": [ | |
103 | "GOOGLE_JAPANESE_INPUT_BUILD", | |
104 | "OS_LINUX", | |
105 | ], | |
106 | "//tools/cc_target_os:oss_linux": [ | |
107 | "MOZC_BUILD", | |
108 | "OS_LINUX", | |
109 | ], | |
110 | "//tools/cc_target_os:wasm": [ | |
111 | "GOOGLE_JAPANESE_INPUT_BUILD", | |
112 | "MOZC_DISABLE_SESSION_WATCHDOG", | |
113 | "NO_USAGE_REWRITER", | |
114 | "OS_WASM", | |
115 | ], | |
116 | "//conditions:default": [ | |
117 | ], | |
118 | }), | |
119 | visibility = ["//:__subpackages__"], | |
120 | ) |
0 | package( | |
1 | default_visibility = ["//visibility:public"], | |
2 | ) | |
3 | ||
4 | cc_library( | |
5 | name = "qt", | |
6 | hdrs = glob([ | |
7 | "QtCore/**", | |
8 | "QtGui/**", | |
9 | "QtWidgets/**", | |
10 | ]), | |
11 | includes = ["."], | |
12 | linkopts = [ | |
13 | "-lQt5Core", | |
14 | "-lQt5Gui", | |
15 | "-lQt5Widgets", | |
16 | ], | |
17 | ) |
0 | # An identifier for this repository. | |
1 | workspace(name = "mozc") | |
2 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | |
3 | ||
4 | # This rule reffers $ANDROID_SDK_HOME | |
5 | android_sdk_repository(name = "androidsdk") | |
6 | ||
7 | # Android NDK version should be r11c+ for Abseil. | |
8 | # This rule reffers $ANDROID_NDK_HOME | |
9 | android_ndk_repository(name = "androidndk") | |
10 | ||
11 | local_repository( | |
12 | name = "com_google_absl", | |
13 | path = "third_party/abseil-cpp", | |
14 | ) | |
15 | ||
16 | # This git_repository rule is an alternative for the above rule. | |
17 | # git_repository( | |
18 | # name = "com_google_absl", | |
19 | # remote = "https://github.com/abseil/abseil-cpp.git", | |
20 | # # Abseil does not have tags. | |
21 | # commit = "7aa411ceafc1272a28579cca739a97a2fb79055a", # 2018-07-20 | |
22 | # ) | |
23 | ||
24 | local_repository( | |
25 | name = "com_google_protobuf", | |
26 | path = "third_party/protobuf", | |
27 | ) | |
28 | load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") | |
29 | protobuf_deps() | |
30 | ||
31 | # This git_repository rule is an alternative for the above rule. | |
32 | # git_repository( | |
33 | # name = "com_google_protobuf", | |
34 | # remote = "https://github.com/google/protobuf.git", | |
35 | # tag = "v3.6.0.1", # 2018-06-09 | |
36 | # ) | |
37 | ||
38 | new_local_repository( | |
39 | name = "io_qt", | |
40 | # This path should be updated per the environment. | |
41 | path = "/usr/include/x86_64-linux-gnu/qt5", # For Debian | |
42 | build_file = "BUILD.qt" | |
43 | ) | |
44 | ||
45 | # Python | |
46 | http_archive( | |
47 | name = "rules_python", | |
48 | url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.1/rules_python-0.0.1.tar.gz", | |
49 | sha256 = "aa96a691d3a8177f3215b14b0edc9641787abaaa30363a080165d06ab65e1161", | |
50 | ) | |
51 | load("@rules_python//python:repositories.bzl", "py_repositories") | |
52 | py_repositories() | |
53 | ||
54 | # Only needed if using the packaging rules. | |
55 | # load("@rules_python//python:pip.bzl", "pip_repositories") | |
56 | # pip_repositories() | |
57 | ||
58 | # Bazel Skylib | |
59 | http_archive( | |
60 | name = "bazel_skylib", | |
61 | urls = [ | |
62 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", | |
63 | "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", | |
64 | ], | |
65 | sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", | |
66 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # TODO(matsuzakit): Move JNI unrelated targets to inputtools directory. It might | |
31 | # be better to move this BUILD file to mozc/android directory as these targets | |
32 | # are not limited to jni. | |
33 | # | |
34 | # Usage: | |
35 | # % blaze --blazerc android/blazerc build --config=android_arm android/jni:libmozc.so | |
36 | ||
37 | load( | |
38 | "//:build_defs.bzl", | |
39 | "cc_library_mozc", | |
40 | ) | |
41 | ||
42 | cc_library_mozc( | |
43 | name = "mozc_lib", | |
44 | srcs = ["mozcjni.cc"], | |
45 | deps = [ | |
46 | "//base:logging", | |
47 | "//base:singleton", | |
48 | "//base:status", | |
49 | "//base:system_util", | |
50 | "//base:util", | |
51 | "//data_manager", | |
52 | "//engine", | |
53 | "//engine:engine_builder", | |
54 | "//engine:minimal_engine", | |
55 | "//protocol:commands_proto", | |
56 | "//session", | |
57 | "//session:session_handler", | |
58 | "//session:session_usage_observer", | |
59 | "@com_google_absl//absl/memory", | |
60 | "@com_google_absl//absl/strings", | |
61 | ], | |
62 | alwayslink = 1, | |
63 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | "objc_library_mozc", | |
36 | "py_binary_mozc", | |
37 | "py_library_mozc", | |
38 | "select_mozc", | |
39 | ) | |
40 | ||
41 | package(default_visibility = [ | |
42 | "//:__subpackages__", | |
43 | ]) | |
44 | ||
45 | exports_files([ | |
46 | "client.h", | |
47 | "util.h", | |
48 | ]) | |
49 | ||
50 | test_suite( | |
51 | name = "nacl_test", | |
52 | tests = [ | |
53 | ":bitarray_test", | |
54 | ":clock_mock_test", | |
55 | ":clock_test", | |
56 | ":cpu_stats_test", | |
57 | ":embedded_file_test", | |
58 | ":flags_test", | |
59 | ":hash_test", | |
60 | ":iterator_adapter_test", | |
61 | ":logging_test", | |
62 | ":mutex_test", | |
63 | ":number_util_test", | |
64 | ":obfuscator_support_test", | |
65 | ":scheduler_stub_test", | |
66 | ":scheduler_test", | |
67 | ":serialized_string_array_test", | |
68 | ":singleton_test", | |
69 | ":stl_util_test", | |
70 | ":stopwatch_test", | |
71 | ":system_util_test", | |
72 | ":text_normalizer_test", | |
73 | ":thread_test", | |
74 | ":trie_test", | |
75 | ":unnamed_event_test", | |
76 | ":url_test", | |
77 | ":util_test", | |
78 | ":version_test", | |
79 | # Disabled tests due to file IO error. | |
80 | # ":config_file_stream_test", | |
81 | # ":encryptor_test", | |
82 | # ":file_util_test", | |
83 | # ":mmap_test", | |
84 | # ":multifile_test", | |
85 | # ":process_mutex_test", | |
86 | ], | |
87 | ) | |
88 | ||
89 | # Test suite needs to have exact test names, | |
90 | # because android tests are tagged "manual". | |
91 | test_suite( | |
92 | name = "android_test", | |
93 | tests = [ | |
94 | ":bitarray_test_android", | |
95 | ":clock_mock_test_android", | |
96 | ":clock_test_android", | |
97 | ":config_file_stream_test_android", | |
98 | ":cpu_stats_test_android", | |
99 | ":encryptor_test_android", | |
100 | ":flags_test_android", | |
101 | ":hash_test_android", | |
102 | ":iterator_adapter_test_android", | |
103 | ":logging_test_android", | |
104 | ":mmap_test_android", | |
105 | ":mutex_test_android", | |
106 | ":number_util_test_android", | |
107 | ":obfuscator_support_test_android", | |
108 | ":process_mutex_test_android", | |
109 | ":scheduler_stub_test_android", | |
110 | ":scheduler_test_android", | |
111 | ":serialized_string_array_test_android", | |
112 | ":singleton_test_android", | |
113 | ":stl_util_test_android", | |
114 | ":stopwatch_test_android", | |
115 | ":system_util_test_android", | |
116 | ":text_normalizer_test_android", | |
117 | ":thread_test_android", | |
118 | ":trie_test_android", | |
119 | ":unnamed_event_test_android", | |
120 | ":url_test_android", | |
121 | ":version_test_android", | |
122 | # Disabled tests due to errors. | |
123 | # ":embedded_file_test_android", | |
124 | # ":file_util_test_android", | |
125 | # ":multifile_test_android", | |
126 | # ":util_test_android", | |
127 | ], | |
128 | ) | |
129 | ||
130 | cc_library_mozc( | |
131 | name = "base", | |
132 | hdrs = [ | |
133 | "compiler_specific.h", | |
134 | "const.h", | |
135 | ], | |
136 | deps = [ | |
137 | ":compiler_specific", | |
138 | ":const", | |
139 | ":file_stream", | |
140 | ":file_util", | |
141 | ":flags", | |
142 | ":mmap", | |
143 | ":mutex", | |
144 | ":number_util", | |
145 | ":port", | |
146 | ":process_mutex", | |
147 | ":singleton", | |
148 | ":system_util", | |
149 | ":thread", | |
150 | ":util", | |
151 | ], | |
152 | ) | |
153 | ||
154 | cc_library_mozc( | |
155 | name = "compiler_specific", | |
156 | hdrs = ["compiler_specific.h"], | |
157 | visibility = ["//visibility:private"], | |
158 | ) | |
159 | ||
160 | cc_library_mozc( | |
161 | name = "flags", | |
162 | srcs = ["flags.cc"], | |
163 | hdrs = ["flags.h"], | |
164 | deps = [ | |
165 | ":port", | |
166 | "@com_google_absl//absl/flags:flag", | |
167 | ] + select_mozc( | |
168 | client = [":singleton"], | |
169 | default = ["//base"], | |
170 | ), | |
171 | ) | |
172 | ||
173 | cc_test_mozc( | |
174 | name = "flags_test", | |
175 | size = "small", | |
176 | srcs = ["flags_test.cc"], | |
177 | deps = [ | |
178 | ":flags", | |
179 | "//testing:gunit_main", | |
180 | ], | |
181 | ) | |
182 | ||
183 | INIT_MOZC_BUILDTOOL_DEPS = [ | |
184 | ":file_util", | |
185 | ":flags", | |
186 | ":logging", | |
187 | ] | |
188 | ||
189 | INIT_MOZC_APP_BUILD_DEPS = INIT_MOZC_BUILDTOOL_DEPS + [ | |
190 | ":system_util", | |
191 | ] | |
192 | ||
193 | cc_library_mozc( | |
194 | name = "init_mozc_buildtool", | |
195 | srcs = ["init_mozc.cc"], | |
196 | hdrs = ["init_mozc.h"], | |
197 | copts = ["-DMOZC_BUILDTOOL_BUILD"], | |
198 | visibility = [ | |
199 | "//:__subpackages__", | |
200 | ], | |
201 | deps = select_mozc( | |
202 | client = INIT_MOZC_BUILDTOOL_DEPS, | |
203 | default = ["//base"], | |
204 | ) + [":system_util"], | |
205 | ) | |
206 | ||
207 | cc_library_mozc( | |
208 | name = "init_mozc", | |
209 | srcs = ["init_mozc.cc"], | |
210 | hdrs = ["init_mozc.h"], | |
211 | visibility = [ | |
212 | "//:__subpackages__", | |
213 | ], | |
214 | deps = select_mozc( | |
215 | client = INIT_MOZC_APP_BUILD_DEPS, | |
216 | default = ["//base"], | |
217 | ), | |
218 | ) | |
219 | ||
220 | cc_library_mozc( | |
221 | name = "nacl_linkopts", | |
222 | linkopts = select({ | |
223 | "//tools/cc_target_os:nacl": [ | |
224 | "-lppapi", | |
225 | "-lppapi_cpp", | |
226 | ], | |
227 | "//conditions:default": [], | |
228 | }), | |
229 | visibility = ["//:__subpackages__"], | |
230 | ) | |
231 | ||
232 | cc_library_mozc( | |
233 | name = "port", | |
234 | hdrs = ["port.h"], | |
235 | deps = select_mozc( | |
236 | default = ["//base:base"], | |
237 | linux = ["@com_google_absl//absl/base:core_headers"], | |
238 | nacl = [ | |
239 | # TODO(hsumita): Move :nacl_linkopts to more suitable position. | |
240 | ":nacl_linkopts", | |
241 | "//base:base", | |
242 | ], | |
243 | oss = ["@com_google_absl//absl/base:core_headers"], | |
244 | ), | |
245 | ) | |
246 | ||
247 | cc_library_mozc( | |
248 | name = "const", | |
249 | hdrs = ["const.h"], | |
250 | visibility = ["//visibility:private"], | |
251 | ) | |
252 | ||
253 | cc_library_mozc( | |
254 | name = "scoped_handle", | |
255 | srcs = ["scoped_handle.cc"], | |
256 | hdrs = ["scoped_handle.h"], | |
257 | visibility = ["//:__subpackages__"], | |
258 | ) | |
259 | ||
260 | cc_library_mozc( | |
261 | name = "freelist", | |
262 | hdrs = ["freelist.h"], | |
263 | visibility = ["//:__subpackages__"], | |
264 | deps = [":port"], | |
265 | ) | |
266 | ||
267 | LOGGING_APP_BUILD_DEPS = [ | |
268 | ":const", | |
269 | ":clock", | |
270 | ":flags", | |
271 | ":mutex", | |
272 | ":singleton", | |
273 | ] | |
274 | ||
275 | cc_library_mozc( | |
276 | name = "logging", | |
277 | srcs = ["logging.cc"], | |
278 | hdrs = ["logging.h"], | |
279 | linkopts = select_mozc( | |
280 | # Android requires linking logging library. | |
281 | android = ["-llog"], | |
282 | ), | |
283 | deps = select_mozc( | |
284 | client = LOGGING_APP_BUILD_DEPS, | |
285 | default = ["//base"], | |
286 | ) + [":port"], | |
287 | ) | |
288 | ||
289 | cc_test_mozc( | |
290 | name = "logging_test", | |
291 | size = "small", | |
292 | srcs = ["logging_test.cc"], | |
293 | deps = [ | |
294 | ":logging", | |
295 | "//testing:gunit_main", | |
296 | ], | |
297 | ) | |
298 | ||
299 | cc_library_mozc( | |
300 | name = "codegen_bytearray_stream", | |
301 | hdrs = ["codegen_bytearray_stream.h"], | |
302 | visibility = [ | |
303 | "//:__subpackages__", | |
304 | ], | |
305 | deps = [ | |
306 | ":port", | |
307 | ], | |
308 | ) | |
309 | ||
310 | cc_test_mozc( | |
311 | name = "codegen_bytearray_stream_test", | |
312 | size = "small", | |
313 | srcs = ["codegen_bytearray_stream_test.cc"], | |
314 | tags = ["no_android"], | |
315 | visibility = ["//visibility:private"], | |
316 | deps = [ | |
317 | ":codegen_bytearray_stream", | |
318 | ":port", | |
319 | "//testing:gunit_main", | |
320 | ], | |
321 | ) | |
322 | ||
323 | cc_library_mozc( | |
324 | name = "unnamed_event", | |
325 | srcs = ["unnamed_event.cc"], | |
326 | hdrs = ["unnamed_event.h"], | |
327 | visibility = ["//:__subpackages__"], | |
328 | deps = [ | |
329 | ":logging", | |
330 | ":port", | |
331 | ":scoped_handle", | |
332 | ], | |
333 | ) | |
334 | ||
335 | cc_test_mozc( | |
336 | name = "unnamed_event_test", | |
337 | size = "small", | |
338 | srcs = ["unnamed_event_test.cc"], | |
339 | deps = [ | |
340 | ":logging", | |
341 | ":port", | |
342 | ":thread", | |
343 | ":unnamed_event", | |
344 | ":util", | |
345 | "//testing:gunit_main", | |
346 | ], | |
347 | ) | |
348 | ||
349 | cc_library_mozc( | |
350 | name = "thread", | |
351 | srcs = ["thread.cc"], | |
352 | hdrs = ["thread.h"], | |
353 | visibility = [ | |
354 | "//:__subpackages__", | |
355 | ], | |
356 | deps = [ | |
357 | ":logging", | |
358 | ":port", | |
359 | ], | |
360 | ) | |
361 | ||
362 | cc_test_mozc( | |
363 | name = "thread_test", | |
364 | size = "small", | |
365 | srcs = [ | |
366 | "thread_test.cc", | |
367 | ], | |
368 | deps = [ | |
369 | ":thread", | |
370 | ":util", | |
371 | "//testing:gunit_main", | |
372 | ], | |
373 | ) | |
374 | ||
375 | cc_library_mozc( | |
376 | name = "win_util", | |
377 | hdrs = ["win_util.h"], | |
378 | visibility = ["//:__subpackages__"], | |
379 | deps = [ | |
380 | ":port", | |
381 | "//testing:gunit_prod", | |
382 | ], | |
383 | ) | |
384 | ||
385 | cc_library_mozc( | |
386 | name = "stl_util", | |
387 | hdrs = ["stl_util.h"], | |
388 | visibility = ["//:__subpackages__"], | |
389 | deps = [":port"], | |
390 | ) | |
391 | ||
392 | cc_test_mozc( | |
393 | name = "stl_util_test", | |
394 | size = "small", | |
395 | srcs = ["stl_util_test.cc"], | |
396 | deps = [ | |
397 | ":stl_util", | |
398 | "//testing:gunit_main", | |
399 | ], | |
400 | ) | |
401 | ||
402 | cc_library_mozc( | |
403 | name = "iterator_adapter", | |
404 | hdrs = ["iterator_adapter.h"], | |
405 | visibility = [ | |
406 | "//:__subpackages__", | |
407 | ], | |
408 | ) | |
409 | ||
410 | cc_test_mozc( | |
411 | name = "iterator_adapter_test", | |
412 | size = "small", | |
413 | srcs = ["iterator_adapter_test.cc"], | |
414 | deps = [ | |
415 | ":iterator_adapter", | |
416 | ":port", | |
417 | "//testing:gunit_main", | |
418 | ], | |
419 | ) | |
420 | ||
421 | cc_library_mozc( | |
422 | name = "singleton", | |
423 | srcs = ["singleton.cc"], | |
424 | hdrs = ["singleton.h"], | |
425 | visibility = ["//:__subpackages__"], | |
426 | deps = [":mutex"], | |
427 | ) | |
428 | ||
429 | cc_test_mozc( | |
430 | name = "singleton_test", | |
431 | size = "small", | |
432 | srcs = ["singleton_test.cc"], | |
433 | deps = [ | |
434 | ":singleton", | |
435 | ":thread", | |
436 | ":util", | |
437 | "//testing:gunit_main", | |
438 | ], | |
439 | ) | |
440 | ||
441 | cc_library_mozc( | |
442 | name = "mozc_hash_map", | |
443 | hdrs = ["mozc_hash_map.h"], | |
444 | visibility = [ | |
445 | "//:__subpackages__", | |
446 | ], | |
447 | deps = select_mozc( | |
448 | default = ["@com_google_absl//absl/container:flat_hash_map"], | |
449 | linux = [], | |
450 | oss = [], | |
451 | ), | |
452 | ) | |
453 | ||
454 | cc_library_mozc( | |
455 | name = "mozc_hash_set", | |
456 | hdrs = ["mozc_hash_set.h"], | |
457 | visibility = ["//:__subpackages__"], | |
458 | deps = select_mozc( | |
459 | default = ["@com_google_absl//absl/container:flat_hash_set"], | |
460 | linux = [], | |
461 | oss = [], | |
462 | ), | |
463 | ) | |
464 | ||
465 | genrule( | |
466 | name = "character_set_data", | |
467 | srcs = [ | |
468 | "gen_character_set.py", | |
469 | "//data/unicode:CP932.TXT", | |
470 | "//data/unicode:JIS0201.TXT", | |
471 | "//data/unicode:JIS0208.TXT", | |
472 | "//data/unicode:JIS0212.TXT", | |
473 | "//data/unicode:jisx0213-2004-std.txt", | |
474 | ], | |
475 | outs = ["character_set.inc"], | |
476 | cmd = "python2.7 $(location :gen_character_set.py) --cp932file=$(location //data/unicode:CP932.TXT) --jisx0201file=$(location //data/unicode:JIS0201.TXT) --jisx0208file=$(location //data/unicode:JIS0208.TXT) --jisx0212file=$(location //data/unicode:JIS0212.TXT) --jisx0213file=$(location //data/unicode:jisx0213-2004-std.txt) --output=$@", | |
477 | local = 0, | |
478 | visibility = ["//visibility:private"], | |
479 | ) | |
480 | ||
481 | cc_library_mozc( | |
482 | name = "double_array_def", | |
483 | hdrs = ["double_array.h"], | |
484 | deps = [ | |
485 | ":port", | |
486 | ], | |
487 | ) | |
488 | ||
489 | cc_library_mozc( | |
490 | name = "japanese_util_rule", | |
491 | srcs = ["japanese_util_rule.cc"], | |
492 | hdrs = ["japanese_util_rule.h"], | |
493 | visibility = ["//visibility:private"], | |
494 | deps = [":double_array_def"], | |
495 | ) | |
496 | ||
497 | cc_library_mozc( | |
498 | name = "hash", | |
499 | srcs = ["hash.cc"], | |
500 | hdrs = ["hash.h"], | |
501 | deps = [ | |
502 | ":port", | |
503 | "@com_google_absl//absl/strings", | |
504 | ], | |
505 | ) | |
506 | ||
507 | cc_test_mozc( | |
508 | name = "hash_test", | |
509 | srcs = ["hash_test.cc"], | |
510 | deps = [ | |
511 | ":hash", | |
512 | ":port", | |
513 | "//testing:gunit_main", | |
514 | ], | |
515 | ) | |
516 | ||
517 | cc_library_mozc( | |
518 | name = "clock", | |
519 | srcs = ["clock.cc"], | |
520 | hdrs = ["clock.h"], | |
521 | deps = [ | |
522 | ":port", | |
523 | ":singleton", | |
524 | ], | |
525 | ) | |
526 | ||
527 | cc_test_mozc( | |
528 | name = "clock_test", | |
529 | srcs = ["clock_test.cc"], | |
530 | deps = [ | |
531 | ":clock", | |
532 | ":clock_mock", | |
533 | ":mutex", | |
534 | ":port", | |
535 | "//testing:gunit_main", | |
536 | ], | |
537 | ) | |
538 | ||
539 | cc_library_mozc( | |
540 | name = "util", | |
541 | srcs = [ | |
542 | "util.cc", | |
543 | ":character_set_data", | |
544 | ], | |
545 | hdrs = ["util.h"], | |
546 | visibility = [ | |
547 | "//:__subpackages__", | |
548 | ], | |
549 | deps = [ | |
550 | ":double_array_def", | |
551 | ":japanese_util_rule", | |
552 | ":logging", | |
553 | ":port", | |
554 | "@com_google_absl//absl/strings", | |
555 | "@com_google_absl//absl/strings:str_format", | |
556 | ], | |
557 | ) | |
558 | ||
559 | cc_test_mozc( | |
560 | name = "util_test", | |
561 | size = "small", | |
562 | srcs = [ | |
563 | "util_test.cc", | |
564 | ], | |
565 | data = ["//data/test/character_set:character_set.tsv"], | |
566 | deps = [ | |
567 | ":compiler_specific", | |
568 | ":file_stream", | |
569 | ":file_util", | |
570 | ":logging", | |
571 | ":number_util", | |
572 | ":port", | |
573 | ":util", | |
574 | "//testing:gunit_main", | |
575 | "//testing:mozctest", | |
576 | ], | |
577 | ) | |
578 | ||
579 | cc_library_mozc( | |
580 | name = "mutex", | |
581 | srcs = ["mutex.cc"], | |
582 | hdrs = ["mutex.h"], | |
583 | linkopts = select_mozc( | |
584 | linux = ["-pthread"], | |
585 | ), | |
586 | visibility = [ | |
587 | "//:__subpackages__", | |
588 | ], | |
589 | deps = [ | |
590 | ":port", | |
591 | ":win_util", | |
592 | "@com_google_absl//absl/base:core_headers", | |
593 | ], | |
594 | ) | |
595 | ||
596 | cc_test_mozc( | |
597 | name = "mutex_test", | |
598 | size = "small", | |
599 | srcs = [ | |
600 | "mutex_test.cc", | |
601 | ], | |
602 | deps = [ | |
603 | ":clock", | |
604 | ":logging", | |
605 | ":mutex", | |
606 | ":thread", | |
607 | ":util", | |
608 | "//testing:gunit_main", | |
609 | "@com_google_absl//absl/base:core_headers", | |
610 | ], | |
611 | ) | |
612 | ||
613 | cc_library_mozc( | |
614 | name = "file_stream", | |
615 | srcs = ["file_stream.cc"], | |
616 | hdrs = ["file_stream.h"], | |
617 | visibility = [ | |
618 | "//:__subpackages__", | |
619 | ], | |
620 | ) | |
621 | ||
622 | cc_binary_mozc( | |
623 | name = "text_converter_compiler", | |
624 | srcs = ["text_converter_compiler.cc"], | |
625 | deps = [ | |
626 | ":double_array_def", | |
627 | ":file_stream", | |
628 | ":flags", | |
629 | ":init_mozc_buildtool", | |
630 | ":logging", | |
631 | ":util", | |
632 | "//third_party/darts/v0_32", | |
633 | ], | |
634 | ) | |
635 | ||
636 | cc_library_mozc( | |
637 | name = "number_util", | |
638 | srcs = ["number_util.cc"], | |
639 | hdrs = ["number_util.h"], | |
640 | visibility = [ | |
641 | "//:__subpackages__", | |
642 | ], | |
643 | deps = [ | |
644 | ":double_array_def", | |
645 | ":japanese_util_rule", | |
646 | ":logging", | |
647 | ":port", | |
648 | ":util", | |
649 | "@com_google_absl//absl/strings", | |
650 | "@com_google_absl//absl/strings:str_format", | |
651 | ], | |
652 | ) | |
653 | ||
654 | cc_test_mozc( | |
655 | name = "number_util_test", | |
656 | size = "small", | |
657 | srcs = ["number_util_test.cc"], | |
658 | deps = [ | |
659 | ":number_util", | |
660 | ":port", | |
661 | "//testing:googletest", | |
662 | "//testing:gunit_main", | |
663 | ], | |
664 | ) | |
665 | ||
666 | cc_library_mozc( | |
667 | name = "trie", | |
668 | hdrs = ["trie.h"], | |
669 | visibility = ["//:__subpackages__"], | |
670 | deps = [ | |
671 | ":logging", | |
672 | ":util", | |
673 | "@com_google_absl//absl/strings", | |
674 | ], | |
675 | ) | |
676 | ||
677 | cc_test_mozc( | |
678 | name = "trie_test", | |
679 | size = "small", | |
680 | srcs = ["trie_test.cc"], | |
681 | deps = [ | |
682 | ":trie", | |
683 | "//testing:gunit_main", | |
684 | ], | |
685 | ) | |
686 | ||
687 | cc_library_mozc( | |
688 | name = "text_normalizer", | |
689 | srcs = ["text_normalizer.cc"], | |
690 | hdrs = ["text_normalizer.h"], | |
691 | visibility = ["//:__subpackages__"], | |
692 | deps = [ | |
693 | ":port", | |
694 | ":util", | |
695 | "@com_google_absl//absl/strings", | |
696 | ], | |
697 | ) | |
698 | ||
699 | cc_test_mozc( | |
700 | name = "text_normalizer_test", | |
701 | size = "small", | |
702 | srcs = ["text_normalizer_test.cc"], | |
703 | deps = [ | |
704 | ":text_normalizer", | |
705 | ":util", | |
706 | "//testing:gunit_main", | |
707 | ], | |
708 | ) | |
709 | ||
710 | cc_library_mozc( | |
711 | name = "clock_mock", | |
712 | testonly = 1, | |
713 | srcs = ["clock_mock.cc"], | |
714 | hdrs = [ | |
715 | "clock.h", # For ClockInterface | |
716 | "clock_mock.h", | |
717 | ], | |
718 | visibility = ["//:__subpackages__"], | |
719 | deps = [ | |
720 | ":port", | |
721 | ":util", | |
722 | ], | |
723 | ) | |
724 | ||
725 | cc_test_mozc( | |
726 | name = "clock_mock_test", | |
727 | size = "small", | |
728 | srcs = ["clock_mock_test.cc"], | |
729 | deps = [ | |
730 | ":clock_mock", | |
731 | ":util", | |
732 | "//testing:googletest", | |
733 | "//testing:gunit_main", | |
734 | ], | |
735 | ) | |
736 | ||
737 | cc_library_mozc( | |
738 | name = "bitarray", | |
739 | hdrs = ["bitarray.h"], | |
740 | visibility = ["//:__subpackages__"], | |
741 | deps = [":port"], | |
742 | ) | |
743 | ||
744 | cc_test_mozc( | |
745 | name = "bitarray_test", | |
746 | size = "small", | |
747 | srcs = ["bitarray_test.cc"], | |
748 | deps = [ | |
749 | ":bitarray", | |
750 | ":util", | |
751 | "//testing:googletest", | |
752 | "//testing:gunit_main", | |
753 | ], | |
754 | ) | |
755 | ||
756 | cc_library_mozc( | |
757 | name = "mmap_sync_interface", | |
758 | hdrs = ["mmap_sync_interface.h"], | |
759 | visibility = ["//visibility:private"], | |
760 | ) | |
761 | ||
762 | cc_library_mozc( | |
763 | name = "mmap", | |
764 | srcs = ["mmap.cc"], | |
765 | hdrs = ["mmap.h"], | |
766 | deps = [ | |
767 | ":logging", | |
768 | ":mmap_sync_interface", | |
769 | ":port", | |
770 | ":scoped_handle", | |
771 | ":util", | |
772 | ] + select( | |
773 | { | |
774 | "//tools/cc_target_os:nacl": [ | |
775 | ":mutex", | |
776 | ":file_stream", | |
777 | "@com_google_absl//absl/base", | |
778 | ], | |
779 | "//conditions:default": [], | |
780 | }, | |
781 | ), | |
782 | ) | |
783 | ||
784 | cc_test_mozc( | |
785 | name = "mmap_test", | |
786 | size = "small", | |
787 | srcs = ["mmap_test.cc"], | |
788 | deps = [ | |
789 | ":file_stream", | |
790 | ":file_util", | |
791 | ":flags", | |
792 | ":mmap", | |
793 | ":util", | |
794 | "//testing:googletest", | |
795 | "//testing:gunit_main", | |
796 | ], | |
797 | ) | |
798 | ||
799 | cc_library_mozc( | |
800 | name = "file_util", | |
801 | srcs = ["file_util.cc"], | |
802 | hdrs = ["file_util.h"], | |
803 | visibility = ["//:__subpackages__"], | |
804 | deps = [ | |
805 | ":file_stream", | |
806 | ":logging", | |
807 | ":mmap", | |
808 | ":mutex", | |
809 | ":port", | |
810 | ":scoped_handle", | |
811 | ":util", | |
812 | ":win_util", | |
813 | "@com_google_absl//absl/strings", | |
814 | ], | |
815 | ) | |
816 | ||
817 | cc_test_mozc( | |
818 | name = "file_util_test", | |
819 | size = "small", | |
820 | srcs = ["file_util_test.cc"], | |
821 | deps = [ | |
822 | ":file_stream", | |
823 | ":file_util", | |
824 | ":logging", | |
825 | ":number_util", | |
826 | ":util", | |
827 | "//testing:googletest", | |
828 | "//testing:gunit_main", | |
829 | ], | |
830 | ) | |
831 | ||
832 | cc_library_mozc( | |
833 | name = "system_util", | |
834 | srcs = select_mozc( | |
835 | android = [ | |
836 | "android_util.cc", | |
837 | ], | |
838 | ) + ["system_util.cc"], | |
839 | hdrs = select_mozc( | |
840 | android = [ | |
841 | "android_util.h", | |
842 | ], | |
843 | ) + ["system_util.h"], | |
844 | visibility = [ | |
845 | "//:__subpackages__", | |
846 | ], | |
847 | deps = select_mozc( | |
848 | android = [ | |
849 | # android_util.h includes this for FRIEND_TEST | |
850 | "//testing:gunit_prod", | |
851 | ], | |
852 | ios = [":mac_util"], | |
853 | ) + [ | |
854 | ":const", | |
855 | ":file_util", | |
856 | ":logging", | |
857 | ":number_util", | |
858 | ":port", | |
859 | ":singleton", | |
860 | ":util", | |
861 | ] + [ | |
862 | ":mutex", | |
863 | ":win_util", | |
864 | ], | |
865 | ) | |
866 | ||
867 | cc_test_mozc( | |
868 | name = "system_util_test", | |
869 | srcs = ["system_util_test.cc"], | |
870 | visibility = ["//visibility:private"], | |
871 | deps = [ | |
872 | ":number_util", | |
873 | ":port", | |
874 | ":system_util", | |
875 | ":util", | |
876 | "//testing:gunit_main", | |
877 | ], | |
878 | ) | |
879 | ||
880 | cc_library_mozc( | |
881 | name = "process", | |
882 | srcs = ["process.cc"], | |
883 | hdrs = ["process.h"], | |
884 | visibility = ["//:__subpackages__"], | |
885 | deps = [ | |
886 | ":const", | |
887 | ":file_util", | |
888 | ":logging", | |
889 | ":port", | |
890 | ":scoped_handle", | |
891 | ":system_util", | |
892 | ":util", | |
893 | ":win_util", | |
894 | ], | |
895 | ) | |
896 | ||
897 | cc_binary_mozc( | |
898 | name = "process_main", | |
899 | srcs = ["process_main.cc"], | |
900 | deps = [ | |
901 | ":flags", | |
902 | ":init_mozc", | |
903 | ":logging", | |
904 | ":process", | |
905 | ], | |
906 | ) | |
907 | ||
908 | cc_library_mozc( | |
909 | name = "process_mutex", | |
910 | srcs = ["process_mutex.cc"], | |
911 | hdrs = ["process_mutex.h"], | |
912 | visibility = ["//:__subpackages__"], | |
913 | deps = [ | |
914 | ":file_util", | |
915 | ":logging", | |
916 | ":mutex", | |
917 | ":port", | |
918 | ":scoped_handle", | |
919 | ":singleton", | |
920 | ":system_util", | |
921 | ":util", | |
922 | ], | |
923 | ) | |
924 | ||
925 | cc_test_mozc( | |
926 | name = "process_mutex_test", | |
927 | size = "small", | |
928 | srcs = ["process_mutex_test.cc"], | |
929 | deps = [ | |
930 | "logging", | |
931 | ":file_util", | |
932 | ":process_mutex", | |
933 | ":system_util", | |
934 | ":util", | |
935 | "//testing:googletest", | |
936 | "//testing:gunit_main", | |
937 | ], | |
938 | ) | |
939 | ||
940 | cc_library_mozc( | |
941 | name = "run_level", | |
942 | srcs = [ | |
943 | "run_level.cc", | |
944 | "win_sandbox.h", | |
945 | ], | |
946 | hdrs = ["run_level.h"], | |
947 | visibility = ["//:__subpackages__"], | |
948 | deps = [ | |
949 | ":const", | |
950 | ":logging", | |
951 | ":port", | |
952 | ":scoped_handle", | |
953 | ":system_util", | |
954 | ":util", | |
955 | ":win_util", | |
956 | ], | |
957 | ) | |
958 | ||
959 | cc_binary_mozc( | |
960 | name = "run_level_main", | |
961 | srcs = ["run_level_main.cc"], | |
962 | deps = [ | |
963 | ":flags", | |
964 | ":init_mozc", | |
965 | ":run_level", | |
966 | ], | |
967 | ) | |
968 | ||
969 | py_library_mozc( | |
970 | name = "gen_config_file_stream_data_lib", | |
971 | srcs = ["gen_config_file_stream_data.py"], | |
972 | ) | |
973 | ||
974 | py_binary_mozc( | |
975 | name = "gen_config_file_stream_data", | |
976 | srcs = ["gen_config_file_stream_data.py"], | |
977 | deps = [":gen_config_file_stream_data_lib"], | |
978 | ) | |
979 | ||
980 | genrule( | |
981 | name = "config_file_stream_data", | |
982 | srcs = [ | |
983 | "//data/keymap:atok.tsv", | |
984 | "//data/keymap:chromeos.tsv", | |
985 | "//data/keymap:kotoeri.tsv", | |
986 | "//data/keymap:mobile.tsv", | |
987 | "//data/keymap:ms-ime.tsv", | |
988 | "//data/preedit:composition_table", | |
989 | ], | |
990 | outs = ["config_file_stream_data.inc"], | |
991 | cmd = ("$(location :gen_config_file_stream_data) --output=$@ $(SRCS)"), | |
992 | exec_tools = [":gen_config_file_stream_data"], | |
993 | visibility = ["//visibility:private"], | |
994 | ) | |
995 | ||
996 | cc_library_mozc( | |
997 | name = "config_file_stream", | |
998 | srcs = [ | |
999 | "config_file_stream.cc", | |
1000 | ":config_file_stream_data", | |
1001 | ], | |
1002 | hdrs = ["config_file_stream.h"], | |
1003 | visibility = ["//:__subpackages__"], | |
1004 | deps = [ | |
1005 | ":file_stream", | |
1006 | ":file_util", | |
1007 | ":logging", | |
1008 | ":port", | |
1009 | ":singleton", | |
1010 | ":system_util", | |
1011 | ":util", | |
1012 | ], | |
1013 | ) | |
1014 | ||
1015 | cc_test_mozc( | |
1016 | name = "config_file_stream_test", | |
1017 | size = "small", | |
1018 | srcs = ["config_file_stream_test.cc"], | |
1019 | deps = [ | |
1020 | ":config_file_stream", | |
1021 | ":file_util", | |
1022 | ":system_util", | |
1023 | "//testing:googletest", | |
1024 | "//testing:gunit_main", | |
1025 | ], | |
1026 | ) | |
1027 | ||
1028 | TARGET_PLATFORM = select({ | |
1029 | "//tools/cc_target_os:oss_android": "Android", | |
1030 | "//tools/cc_target_os:android": "Android", | |
1031 | "//tools/cc_target_os:nacl": "NaCl", | |
1032 | "//tools/cc_target_os:wasm": "Wasm", | |
1033 | "//tools/cc_target_os:linux": "Linux", | |
1034 | "//tools/cc_target_os:oss_linux": "Linux", | |
1035 | }) | |
1036 | ||
1037 | genrule( | |
1038 | name = "mozc_version_txt", | |
1039 | srcs = [ | |
1040 | "//data/version:mozc_version_template.bzl", | |
1041 | ], | |
1042 | outs = ["mozc_version.txt"], | |
1043 | cmd = ('$(location //build_tools:mozc_version) --template_path="$(location //data/version:mozc_version_template.bzl)" --output="$(OUTS)" --build_override=302566722 --target_platform=' + TARGET_PLATFORM), | |
1044 | tools = ["//build_tools:mozc_version"], | |
1045 | visibility = ["//visibility:private"], | |
1046 | ) | |
1047 | ||
1048 | genrule( | |
1049 | name = "version_def_h", | |
1050 | srcs = [ | |
1051 | "mozc_version.txt", | |
1052 | "version_def_template.h", | |
1053 | ], | |
1054 | outs = ["version_def.h"], | |
1055 | cmd = "$(location //build_tools:replace_version) --version_file=$(location mozc_version.txt) --input=$(location version_def_template.h) --output=$(OUTS) --branding=GoogleJapaneseInput", | |
1056 | tools = ["//build_tools:replace_version"], | |
1057 | visibility = ["//visibility:private"], | |
1058 | ) | |
1059 | ||
1060 | cc_library_mozc( | |
1061 | name = "version", | |
1062 | srcs = [ | |
1063 | "version.cc", | |
1064 | ":version_def_h", | |
1065 | ], | |
1066 | hdrs = [ | |
1067 | "version.h", | |
1068 | "version_def.h", | |
1069 | ], | |
1070 | deps = [ | |
1071 | ":logging", | |
1072 | ":number_util", | |
1073 | ":port", | |
1074 | ":util", | |
1075 | ], | |
1076 | ) | |
1077 | ||
1078 | cc_test_mozc( | |
1079 | name = "version_test", | |
1080 | size = "small", | |
1081 | srcs = ["version_test.cc"], | |
1082 | deps = [ | |
1083 | ":util", | |
1084 | ":version", | |
1085 | "//testing:gunit_main", | |
1086 | ], | |
1087 | ) | |
1088 | ||
1089 | cc_library_mozc( | |
1090 | name = "obfuscator_support", | |
1091 | srcs = [ | |
1092 | "unverified_aes256.cc", | |
1093 | "unverified_sha1.cc", | |
1094 | ], | |
1095 | hdrs = [ | |
1096 | "unverified_aes256.h", | |
1097 | "unverified_sha1.h", | |
1098 | ], | |
1099 | visibility = [ | |
1100 | "//data_manager:__pkg__", | |
1101 | "//ipc:__pkg__", | |
1102 | ], | |
1103 | deps = [ | |
1104 | ":logging", | |
1105 | ":port", | |
1106 | "@com_google_absl//absl/strings", | |
1107 | ], | |
1108 | ) | |
1109 | ||
1110 | cc_test_mozc( | |
1111 | name = "obfuscator_support_test", | |
1112 | size = "small", | |
1113 | srcs = [ | |
1114 | "unverified_aes256_test.cc", | |
1115 | "unverified_sha1_test.cc", | |
1116 | ], | |
1117 | visibility = ["//visibility:private"], | |
1118 | deps = [ | |
1119 | ":obfuscator_support", | |
1120 | "//testing:googletest", | |
1121 | "//testing:gunit_main", | |
1122 | ], | |
1123 | ) | |
1124 | ||
1125 | # TODO(team): encryptor.cc and password_manager.cc are mutually dependent and | |
1126 | # cannot be decoupled. Fix this issue. | |
1127 | cc_library_mozc( | |
1128 | name = "encryptor", | |
1129 | srcs = [ | |
1130 | "encryptor.cc", | |
1131 | "password_manager.cc", | |
1132 | ], | |
1133 | hdrs = [ | |
1134 | "encryptor.h", | |
1135 | "password_manager.h", | |
1136 | ], | |
1137 | visibility = ["//:__subpackages__"], | |
1138 | deps = [ | |
1139 | ":const", | |
1140 | ":file_stream", | |
1141 | ":file_util", | |
1142 | ":logging", | |
1143 | ":mmap", | |
1144 | ":mutex", | |
1145 | ":obfuscator_support", | |
1146 | ":port", | |
1147 | ":singleton", | |
1148 | ":system_util", | |
1149 | ":util", | |
1150 | ] + select_mozc( | |
1151 | ios = [":mac_util"], | |
1152 | ), | |
1153 | ) | |
1154 | ||
1155 | cc_test_mozc( | |
1156 | name = "encryptor_test", | |
1157 | size = "small", | |
1158 | srcs = [ | |
1159 | "encryptor_test.cc", | |
1160 | "password_manager_test.cc", | |
1161 | ], | |
1162 | visibility = ["//visibility:private"], | |
1163 | deps = [ | |
1164 | ":encryptor", | |
1165 | ":system_util", | |
1166 | ":util", | |
1167 | "//testing:googletest", | |
1168 | "//testing:gunit_main", | |
1169 | ], | |
1170 | ) | |
1171 | ||
1172 | cc_binary_mozc( | |
1173 | name = "encryptor_main", | |
1174 | srcs = ["encryptor_main.cc"], | |
1175 | visibility = ["//visibility:private"], | |
1176 | deps = [ | |
1177 | ":encryptor", | |
1178 | ":file_stream", | |
1179 | ":flags", | |
1180 | ":init_mozc", | |
1181 | ":logging", | |
1182 | ":mmap", | |
1183 | ":util", | |
1184 | ], | |
1185 | ) | |
1186 | ||
1187 | cc_binary_mozc( | |
1188 | name = "password_manager_main", | |
1189 | srcs = ["password_manager_main.cc"], | |
1190 | visibility = ["//visibility:private"], | |
1191 | deps = [ | |
1192 | ":encryptor", | |
1193 | ":flags", | |
1194 | ":init_mozc", | |
1195 | ":logging", | |
1196 | ":util", | |
1197 | ], | |
1198 | ) | |
1199 | ||
1200 | cc_library_mozc( | |
1201 | name = "scheduler", | |
1202 | srcs = [ | |
1203 | "scheduler.cc", | |
1204 | ], | |
1205 | hdrs = ["scheduler.h"], | |
1206 | deps = [ | |
1207 | ":clock", | |
1208 | ":logging", | |
1209 | ":mutex", | |
1210 | ":port", | |
1211 | ":singleton", | |
1212 | ":thread", | |
1213 | ":unnamed_event", | |
1214 | ":util", | |
1215 | ], | |
1216 | ) | |
1217 | ||
1218 | cc_test_mozc( | |
1219 | name = "scheduler_test", | |
1220 | size = "small", | |
1221 | srcs = ["scheduler_test.cc"], | |
1222 | deps = [ | |
1223 | ":logging", | |
1224 | ":scheduler", | |
1225 | ":unnamed_event", | |
1226 | ":util", | |
1227 | "//testing:gunit_main", | |
1228 | ], | |
1229 | ) | |
1230 | ||
1231 | cc_library_mozc( | |
1232 | name = "scheduler_stub", | |
1233 | testonly = 1, | |
1234 | srcs = ["scheduler_stub.cc"], | |
1235 | hdrs = ["scheduler_stub.h"], | |
1236 | visibility = ["//:__subpackages__"], | |
1237 | deps = [ | |
1238 | ":logging", | |
1239 | ":port", | |
1240 | ":scheduler", | |
1241 | ], | |
1242 | ) | |
1243 | ||
1244 | cc_test_mozc( | |
1245 | name = "scheduler_stub_test", | |
1246 | size = "small", | |
1247 | srcs = ["scheduler_stub_test.cc"], | |
1248 | deps = [ | |
1249 | ":scheduler_stub", | |
1250 | "//testing:gunit_main", | |
1251 | ], | |
1252 | ) | |
1253 | ||
1254 | cc_library_mozc( | |
1255 | name = "cpu_stats", | |
1256 | srcs = ["cpu_stats.cc"], | |
1257 | hdrs = ["cpu_stats.h"], | |
1258 | visibility = ["//:__subpackages__"], | |
1259 | deps = [ | |
1260 | ":logging", | |
1261 | ":port", | |
1262 | ], | |
1263 | ) | |
1264 | ||
1265 | cc_test_mozc( | |
1266 | name = "cpu_stats_test", | |
1267 | size = "small", | |
1268 | srcs = ["cpu_stats_test.cc"], | |
1269 | deps = [ | |
1270 | ":cpu_stats", | |
1271 | "//testing:googletest", | |
1272 | "//testing:gunit_main", | |
1273 | ], | |
1274 | ) | |
1275 | ||
1276 | cc_binary_mozc( | |
1277 | name = "cpu_stats_main", | |
1278 | srcs = ["cpu_stats_main.cc"], | |
1279 | deps = [ | |
1280 | ":cpu_stats", | |
1281 | ":flags", | |
1282 | ":init_mozc", | |
1283 | ":port", | |
1284 | ":thread", | |
1285 | ":util", | |
1286 | ], | |
1287 | ) | |
1288 | ||
1289 | cc_library_mozc( | |
1290 | name = "stopwatch", | |
1291 | srcs = ["stopwatch.cc"], | |
1292 | hdrs = ["stopwatch.h"], | |
1293 | visibility = ["//:__subpackages__"], | |
1294 | deps = [ | |
1295 | ":clock", | |
1296 | ":port", | |
1297 | ], | |
1298 | ) | |
1299 | ||
1300 | cc_test_mozc( | |
1301 | name = "stopwatch_test", | |
1302 | size = "small", | |
1303 | srcs = ["stopwatch_test.cc"], | |
1304 | deps = [ | |
1305 | ":clock", | |
1306 | ":clock_mock", | |
1307 | ":stopwatch", | |
1308 | "//testing:gunit_main", | |
1309 | ], | |
1310 | ) | |
1311 | ||
1312 | cc_binary_mozc( | |
1313 | name = "stopwatch_main", | |
1314 | srcs = ["stopwatch_main.cc"], | |
1315 | deps = [ | |
1316 | ":flags", | |
1317 | ":init_mozc", | |
1318 | ":stopwatch", | |
1319 | ":util", | |
1320 | ], | |
1321 | ) | |
1322 | ||
1323 | cc_library_mozc( | |
1324 | name = "url", | |
1325 | srcs = ["url.cc"], | |
1326 | hdrs = ["url.h"], | |
1327 | visibility = ["//:__subpackages__"], | |
1328 | deps = [ | |
1329 | ":logging", | |
1330 | ":port", | |
1331 | ":singleton", | |
1332 | ":util", | |
1333 | ":version", | |
1334 | ], | |
1335 | ) | |
1336 | ||
1337 | cc_test_mozc( | |
1338 | name = "url_test", | |
1339 | size = "small", | |
1340 | srcs = ["url_test.cc"], | |
1341 | deps = [ | |
1342 | ":url", | |
1343 | ":util", | |
1344 | "//testing:gunit_main", | |
1345 | ], | |
1346 | ) | |
1347 | ||
1348 | cc_library_mozc( | |
1349 | name = "multifile", | |
1350 | srcs = ["multifile.cc"], | |
1351 | hdrs = ["multifile.h"], | |
1352 | visibility = [ | |
1353 | "//:__subpackages__", | |
1354 | ], | |
1355 | deps = [ | |
1356 | ":file_stream", | |
1357 | ":logging", | |
1358 | ":port", | |
1359 | ":util", | |
1360 | ], | |
1361 | ) | |
1362 | ||
1363 | cc_test_mozc( | |
1364 | name = "multifile_test", | |
1365 | size = "small", | |
1366 | srcs = ["multifile_test.cc"], | |
1367 | deps = [ | |
1368 | ":file_stream", | |
1369 | ":file_util", | |
1370 | ":flags", | |
1371 | ":multifile", | |
1372 | ":util", | |
1373 | "//testing:googletest", | |
1374 | "//testing:gunit_main", | |
1375 | ], | |
1376 | ) | |
1377 | ||
1378 | cc_library_mozc( | |
1379 | name = "coordinates", | |
1380 | hdrs = ["coordinates.h"], | |
1381 | visibility = ["//:__subpackages__"], | |
1382 | ) | |
1383 | ||
1384 | cc_library_mozc( | |
1385 | name = "crash_report_handler", | |
1386 | srcs = ["crash_report_handler.cc"], | |
1387 | hdrs = ["crash_report_handler.h"], | |
1388 | deps = [ | |
1389 | ":base", | |
1390 | ":file_util", | |
1391 | ":logging", | |
1392 | ":system_util", | |
1393 | ":util", | |
1394 | ":version", | |
1395 | ], | |
1396 | ) | |
1397 | ||
1398 | objc_library_mozc( | |
1399 | name = "mac_util", | |
1400 | srcs = [ | |
1401 | "mac_util.mm", | |
1402 | "scoped_cftyperef.h", | |
1403 | ], | |
1404 | hdrs = ["mac_util.h"], | |
1405 | visibility = ["//:__subpackages__"], | |
1406 | deps = [ | |
1407 | ":const", | |
1408 | ":logging", | |
1409 | ":port", | |
1410 | ":singleton", | |
1411 | ":util", | |
1412 | ], | |
1413 | ) | |
1414 | ||
1415 | cc_library_mozc( | |
1416 | name = "winmain", | |
1417 | hdrs = ["winmain.h"], | |
1418 | visibility = [ | |
1419 | # For //server:mozc_server. | |
1420 | "//server:__pkg__", | |
1421 | ], | |
1422 | deps = [ | |
1423 | ":base", | |
1424 | ":port", | |
1425 | ":util", | |
1426 | ], | |
1427 | ) | |
1428 | ||
1429 | cc_library_mozc( | |
1430 | name = "win_api_test_helper", | |
1431 | hdrs = ["win_api_test_helper.h"], | |
1432 | visibility = [ | |
1433 | # For //config:stats_config_util_test. | |
1434 | "//config:__pkg__", | |
1435 | ], | |
1436 | deps = [":port"], | |
1437 | ) | |
1438 | ||
1439 | cc_library_mozc( | |
1440 | name = "embedded_file", | |
1441 | hdrs = ["embedded_file.h"], | |
1442 | visibility = ["//:__subpackages__"], | |
1443 | deps = [ | |
1444 | ":port", | |
1445 | "@com_google_absl//absl/strings", | |
1446 | ], | |
1447 | ) | |
1448 | ||
1449 | genrule( | |
1450 | name = "gen_embedded_file_test_data", | |
1451 | srcs = ["embedded_file.h"], | |
1452 | outs = ["embedded_file_test_data.inc"], | |
1453 | cmd = "$(location //build_tools:embed_file) --input=$< --name=kEmbeddedFileTestData --output=$@", | |
1454 | exec_tools = ["//build_tools:embed_file"], | |
1455 | ) | |
1456 | ||
1457 | cc_test_mozc( | |
1458 | name = "embedded_file_test", | |
1459 | srcs = [ | |
1460 | "embedded_file_test.cc", | |
1461 | ":gen_embedded_file_test_data", | |
1462 | ], | |
1463 | data = ["embedded_file.h"], | |
1464 | deps = [ | |
1465 | ":embedded_file", | |
1466 | ":file_stream", | |
1467 | ":port", | |
1468 | "//testing:gunit_main", | |
1469 | "//testing:mozctest", | |
1470 | ], | |
1471 | ) | |
1472 | ||
1473 | cc_library_mozc( | |
1474 | name = "serialized_string_array", | |
1475 | srcs = ["serialized_string_array.cc"], | |
1476 | hdrs = ["serialized_string_array.h"], | |
1477 | deps = [ | |
1478 | ":file_stream", | |
1479 | ":logging", | |
1480 | ":port", | |
1481 | ":util", | |
1482 | "@com_google_absl//absl/strings", | |
1483 | ], | |
1484 | ) | |
1485 | ||
1486 | cc_test_mozc( | |
1487 | name = "serialized_string_array_test", | |
1488 | srcs = ["serialized_string_array_test.cc"], | |
1489 | deps = [ | |
1490 | ":port", | |
1491 | ":serialized_string_array", | |
1492 | "//testing:gunit_main", | |
1493 | "@com_google_absl//absl/strings", | |
1494 | ], | |
1495 | ) | |
1496 | ||
1497 | cc_library_mozc( | |
1498 | name = "status", | |
1499 | srcs = [ | |
1500 | "status.cc", | |
1501 | ], | |
1502 | hdrs = [ | |
1503 | "status.h", | |
1504 | "statusor.h", | |
1505 | ], | |
1506 | deps = select_mozc( | |
1507 | default = [ | |
1508 | "@com_google_absl//absl/status", | |
1509 | ], | |
1510 | oss = [ | |
1511 | ":logging", | |
1512 | ":flags", | |
1513 | ], | |
1514 | ), | |
1515 | ) | |
1516 | ||
1517 | cc_test_mozc( | |
1518 | name = "status_test", | |
1519 | srcs = [ | |
1520 | "status_test.cc", | |
1521 | "statusor_test.cc", | |
1522 | ], | |
1523 | deps = [ | |
1524 | ":status", | |
1525 | "//testing:gunit_main", | |
1526 | "@com_google_absl//absl/memory", | |
1527 | ], | |
1528 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | ) | |
34 | ||
35 | package(default_visibility = ["//:__subpackages__"]) | |
36 | ||
37 | # Dummy rule for header files. | |
38 | cc_library_mozc( | |
39 | name = "protobuf", | |
40 | hdrs = ["protobuf.h"], | |
41 | deps = ["@com_google_protobuf//:protobuf"], | |
42 | ) | |
43 | ||
44 | cc_library_mozc( | |
45 | name = "descriptor", | |
46 | hdrs = ["descriptor.h"], | |
47 | visibility = ["//:__subpackages__"], | |
48 | deps = [ | |
49 | ":protobuf", | |
50 | "@com_google_protobuf//:protobuf", | |
51 | ], | |
52 | ) | |
53 | ||
54 | cc_library_mozc( | |
55 | name = "message", | |
56 | hdrs = ["message.h"], | |
57 | visibility = ["//:__subpackages__"], | |
58 | deps = [ | |
59 | ":protobuf", | |
60 | "@com_google_protobuf//:protobuf", | |
61 | ], | |
62 | ) | |
63 | ||
64 | cc_library_mozc( | |
65 | name = "zero_copy_stream_impl", | |
66 | hdrs = ["zero_copy_stream_impl.h"], | |
67 | visibility = ["//:__subpackages__"], | |
68 | deps = [ | |
69 | ":protobuf", | |
70 | "@com_google_protobuf//:protobuf", | |
71 | ], | |
72 | ) | |
73 | ||
74 | cc_library_mozc( | |
75 | name = "repeated_field", | |
76 | hdrs = ["repeated_field.h"], | |
77 | visibility = ["//:__subpackages__"], | |
78 | deps = [ | |
79 | ":protobuf", | |
80 | "@com_google_protobuf//:protobuf", | |
81 | ], | |
82 | ) | |
83 | ||
84 | cc_library_mozc( | |
85 | name = "text_format", | |
86 | hdrs = ["text_format.h"], | |
87 | visibility = ["//:__subpackages__"], | |
88 | deps = [ | |
89 | ":protobuf", | |
90 | "@com_google_protobuf//:protobuf", | |
91 | ], | |
92 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # cc_(library|binary|test) wrappers to add base:macro dependency. | |
31 | # base:macro declares defines attribute for Android and CrOS (NaCl) | |
32 | # so required macros are defined by depending on it. | |
33 | ||
34 | load("//tools/build_defs:build_cleaner.bzl", "register_extension_info") | |
35 | load("//tools/build_rules/android_cc_test:def.bzl", "android_cc_test") | |
36 | ||
37 | def cc_library_mozc(deps = [], **kwargs): | |
38 | """ | |
39 | cc_library wrapper adding //:macro dependecny. | |
40 | """ | |
41 | native.cc_library( | |
42 | deps = deps + ["//:macro"], | |
43 | **kwargs | |
44 | ) | |
45 | ||
46 | register_extension_info( | |
47 | extension = "cc_library_mozc", | |
48 | label_regex_for_dep = "{extension_name}", | |
49 | ) | |
50 | ||
51 | def cc_binary_mozc(deps = [], **kwargs): | |
52 | """ | |
53 | cc_binary wrapper adding //:macro dependecny. | |
54 | """ | |
55 | native.cc_binary( | |
56 | deps = deps + ["//:macro"], | |
57 | **kwargs | |
58 | ) | |
59 | ||
60 | register_extension_info( | |
61 | extension = "cc_binary_mozc", | |
62 | label_regex_for_dep = "{extension_name}", | |
63 | ) | |
64 | ||
65 | def cc_test_mozc(name, tags = [], deps = [], **kwargs): | |
66 | """ | |
67 | cc_test wrapper adding //:macro dependecny. | |
68 | """ | |
69 | native.cc_test( | |
70 | name = name, | |
71 | tags = tags, | |
72 | deps = deps + ["//:macro"], | |
73 | **kwargs | |
74 | ) | |
75 | ||
76 | if "no_android" not in tags: | |
77 | android_cc_test( | |
78 | name = name + "_android", | |
79 | # "manual" prevents this target triggered by a wild card. | |
80 | # So that "blaze test ..." does not contain this target. | |
81 | # Otherwise it is too slow. | |
82 | tags = ["manual", "notap"], | |
83 | cc_test_name = name, | |
84 | ) | |
85 | ||
86 | register_extension_info( | |
87 | extension = "cc_test_mozc", | |
88 | label_regex_for_dep = "{extension_name}", | |
89 | ) | |
90 | ||
91 | def py_library_mozc(name, srcs, **kwargs): | |
92 | """py_library wrapper generating import-modified python scripts for iOS.""" | |
93 | native.py_library( | |
94 | name = name, | |
95 | srcs = srcs, | |
96 | **kwargs | |
97 | ) | |
98 | ||
99 | register_extension_info( | |
100 | extension = "py_library_mozc", | |
101 | label_regex_for_dep = "{extension_name}", | |
102 | ) | |
103 | ||
104 | def py_binary_mozc(name, srcs, **kwargs): | |
105 | """py_binary wrapper generating import-modified python script for iOS. | |
106 | ||
107 | To use this rule, corresponding py_library_mozc needs to be defined to | |
108 | generate iOS sources. | |
109 | """ | |
110 | native.py_binary( | |
111 | name = name, | |
112 | srcs = srcs, | |
113 | python_version = "PY3", | |
114 | # This main specifier is required because, without it, py_binary expects | |
115 | # that the file name of source containing main() is name.py. | |
116 | main = srcs[0], | |
117 | **kwargs | |
118 | ) | |
119 | ||
120 | register_extension_info( | |
121 | extension = "py_binary_mozc", | |
122 | label_regex_for_dep = "{extension_name}", | |
123 | ) | |
124 | ||
125 | def objc_library_mozc(name, srcs = [], hdrs = [], deps = [], **kwargs): | |
126 | # objc_library's hdrs are somehow not exposed, so the library is defined as | |
127 | # {name}_lib and wraps it by cc_library below. | |
128 | native.objc_library( | |
129 | name = name + "_lib", | |
130 | srcs = srcs, | |
131 | hdrs = hdrs, | |
132 | deps = deps, | |
133 | **kwargs | |
134 | ) | |
135 | ||
136 | cc_library_mozc( | |
137 | name = name, | |
138 | hdrs = hdrs, # Export headers. | |
139 | deps = [":" + name + "_lib"], | |
140 | **kwargs | |
141 | ) | |
142 | ||
143 | def _get_value(args): | |
144 | for arg in args: | |
145 | if arg != None: | |
146 | return arg | |
147 | return None | |
148 | ||
149 | def select_mozc( | |
150 | default = [], | |
151 | client = None, | |
152 | oss = None, | |
153 | android = None, | |
154 | ios = None, | |
155 | nacl = None, | |
156 | linux = None, | |
157 | oss_android = None, | |
158 | oss_linux = None, | |
159 | wasm = None): | |
160 | """select wrapper for target os selection. | |
161 | ||
162 | The priority of value checking: | |
163 | android: android > client > default | |
164 | ios,nacl,wasm,linux: same with android. | |
165 | oss_linux: oss_linux > oss > linux > client > default | |
166 | ||
167 | Args: | |
168 | default: default fallback value. | |
169 | client: default value for android, ios, nacl, wasm and oss_linux. | |
170 | If client is not specified, default is used. | |
171 | oss: default value for OSS build. | |
172 | If oss or specific platform is not specified, client is used. | |
173 | android: value for Android build. | |
174 | ios: value for iOS build. | |
175 | nacl: value for NaCl build. | |
176 | linux: value for Linux build. | |
177 | oss_linux: value for OSS Linux build. | |
178 | wasm: value for wasm build. | |
179 | ||
180 | Returns: | |
181 | Generated select statement. | |
182 | """ | |
183 | return select({ | |
184 | "//tools/cc_target_os:android": _get_value([android, client, default]), | |
185 | "//tools/cc_target_os:apple": _get_value([ios, client, default]), | |
186 | "//tools/cc_target_os:nacl": _get_value([nacl, client, default]), | |
187 | "//tools/cc_target_os:wasm": _get_value([wasm, client, default]), | |
188 | "//tools/cc_target_os:linux": _get_value([linux, client, default]), | |
189 | "//tools/cc_target_os:oss_android": _get_value([oss_android, oss, android, client, default]), | |
190 | "//tools/cc_target_os:oss_linux": _get_value([oss_linux, oss, linux, client, default]), | |
191 | "//conditions:default": default, | |
192 | }) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # Description: | |
31 | # Contains tools which are required to build mozc. | |
32 | ||
33 | load( | |
34 | "//:build_defs.bzl", | |
35 | "py_binary_mozc", | |
36 | "py_library_mozc", | |
37 | ) | |
38 | ||
39 | py_library_mozc( | |
40 | name = "replace_macros_lib", | |
41 | srcs = ["replace_macros.py"], | |
42 | ) | |
43 | ||
44 | py_binary_mozc( | |
45 | name = "replace_macros", | |
46 | srcs = ["replace_macros.py"], | |
47 | deps = [":replace_macros_lib"], | |
48 | ) | |
49 | ||
50 | # TODO(noriyukit): Stop using //testing/pybase to support tests on iOS. | |
51 | py_test( | |
52 | name = "replace_macros_test", | |
53 | size = "small", | |
54 | srcs = ["replace_macros_test.py"], | |
55 | python_version = "PY2", | |
56 | deps = [ | |
57 | ":replace_macros_lib", | |
58 | "//testing/pybase", | |
59 | ], | |
60 | ) | |
61 | ||
62 | py_library_mozc( | |
63 | name = "code_generator_util", | |
64 | srcs = ["code_generator_util.py"], | |
65 | visibility = ["//:__subpackages__"], | |
66 | deps = [], | |
67 | ) | |
68 | ||
69 | # TODO(noriyukit): Stop using //testing/pybase to support tests on iOS. | |
70 | py_test( | |
71 | name = "code_generator_util_test", | |
72 | size = "small", | |
73 | srcs = ["code_generator_util_test.py"], | |
74 | python_version = "PY3", | |
75 | deps = [ | |
76 | ":code_generator_util", | |
77 | "//testing/pybase", | |
78 | ], | |
79 | ) | |
80 | ||
81 | py_library_mozc( | |
82 | name = "mozc_version_lib", | |
83 | srcs = ["mozc_version.py"], | |
84 | ) | |
85 | ||
86 | py_binary_mozc( | |
87 | name = "mozc_version", | |
88 | srcs = ["mozc_version.py"], | |
89 | visibility = ["//:__subpackages__"], | |
90 | deps = [":mozc_version_lib"], | |
91 | ) | |
92 | ||
93 | # TODO(noriyukit): Stop using //testing/pybase to support tests on iOS. | |
94 | py_test( | |
95 | name = "mozc_version_test", | |
96 | size = "small", | |
97 | srcs = ["mozc_version_test.py"], | |
98 | python_version = "PY2", | |
99 | deps = [ | |
100 | ":mozc_version_lib", | |
101 | "//testing/pybase", | |
102 | ], | |
103 | ) | |
104 | ||
105 | py_library_mozc( | |
106 | name = "replace_version_lib", | |
107 | srcs = ["replace_version.py"], | |
108 | deps = [":mozc_version_lib"], | |
109 | ) | |
110 | ||
111 | py_binary_mozc( | |
112 | name = "replace_version", | |
113 | srcs = ["replace_version.py"], | |
114 | visibility = ["//:__subpackages__"], | |
115 | deps = [":mozc_version_lib"], | |
116 | ) | |
117 | ||
118 | py_library_mozc( | |
119 | name = "util", | |
120 | srcs = ["util.py"], | |
121 | visibility = ["//:__subpackages__"], | |
122 | deps = [], | |
123 | ) | |
124 | ||
125 | py_library_mozc( | |
126 | name = "zlib_util_lib", | |
127 | srcs = ["zlib_util.py"], | |
128 | ) | |
129 | ||
130 | py_binary_mozc( | |
131 | name = "zlib_util", | |
132 | srcs = ["zlib_util.py"], | |
133 | visibility = ["//:__subpackages__"], | |
134 | deps = [":zlib_util_main_lib"], | |
135 | ) | |
136 | ||
137 | py_library( | |
138 | name = "zlib_util_main_lib", | |
139 | srcs = ["zlib_util.py"], | |
140 | ) | |
141 | ||
142 | py_library_mozc( | |
143 | name = "embed_pathname_lib", | |
144 | srcs = ["embed_pathname.py"], | |
145 | ) | |
146 | ||
147 | py_binary_mozc( | |
148 | name = "embed_pathname", | |
149 | srcs = ["embed_pathname.py"], | |
150 | visibility = ["//:__subpackages__"], | |
151 | deps = [":embed_pathname_lib"], | |
152 | ) | |
153 | ||
154 | py_library_mozc( | |
155 | name = "embed_file_lib", | |
156 | srcs = ["embed_file.py"], | |
157 | deps = [], | |
158 | ) | |
159 | ||
160 | py_binary_mozc( | |
161 | name = "embed_file", | |
162 | srcs = ["embed_file.py"], | |
163 | visibility = ["//:__subpackages__"], | |
164 | deps = [":embed_file_lib"], | |
165 | ) | |
166 | ||
167 | py_library_mozc( | |
168 | name = "serialized_string_array_builder", | |
169 | srcs = ["serialized_string_array_builder.py"], | |
170 | visibility = ["//:__subpackages__"], | |
171 | deps = [], | |
172 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | "select_mozc", | |
36 | ) | |
37 | ||
38 | package(default_visibility = ["//:__subpackages__"]) | |
39 | ||
40 | cc_library_mozc( | |
41 | name = "client_interface", | |
42 | hdrs = ["client_interface.h"], | |
43 | deps = [ | |
44 | "//base:port", | |
45 | "//protocol:commands_proto", | |
46 | ], | |
47 | ) | |
48 | ||
49 | cc_library_mozc( | |
50 | name = "client", | |
51 | srcs = [ | |
52 | "client.cc", | |
53 | "server_launcher.cc", | |
54 | ], | |
55 | hdrs = [ | |
56 | "client.h", | |
57 | ], | |
58 | deps = [ | |
59 | ":client_interface", | |
60 | "//base", | |
61 | "//base:file_stream", | |
62 | "//base:file_util", | |
63 | "//base:logging", | |
64 | "//base:port", | |
65 | "//base:process", | |
66 | "//base:run_level", | |
67 | "//base:singleton", | |
68 | "//base:system_util", | |
69 | "//base:util", | |
70 | "//base:version", | |
71 | "//base:win_util", | |
72 | "//ipc", | |
73 | "//ipc:named_event", | |
74 | "//protocol:commands_proto", | |
75 | "//protocol:config_proto", | |
76 | "//testing:gunit_prod", | |
77 | ] + select_mozc( | |
78 | ios = ["//base:mac_util"], | |
79 | ), | |
80 | ) | |
81 | ||
82 | cc_test_mozc( | |
83 | name = "client_test", | |
84 | size = "small", | |
85 | srcs = ["client_test.cc"], | |
86 | deps = [ | |
87 | ":client", | |
88 | "//base", | |
89 | "//base:logging", | |
90 | "//base:number_util", | |
91 | "//base:port", | |
92 | "//base:util", | |
93 | "//base:version", | |
94 | "//ipc:ipc_mock", | |
95 | "//protocol:commands_proto", | |
96 | "//testing:gunit_main", | |
97 | "@com_google_absl//absl/strings:str_format", | |
98 | ], | |
99 | ) | |
100 | ||
101 | cc_library_mozc( | |
102 | name = "client_mock", | |
103 | testonly = 1, | |
104 | srcs = ["client_mock.cc"], | |
105 | hdrs = ["client_mock.h"], | |
106 | deps = [ | |
107 | ":client_interface", | |
108 | "//base", | |
109 | "//base:logging", | |
110 | "//protocol:commands_proto", | |
111 | ], | |
112 | ) | |
113 | ||
114 | cc_binary_mozc( | |
115 | name = "server_launcher_main", | |
116 | srcs = ["server_launcher_main.cc"], | |
117 | deps = [ | |
118 | ":client", | |
119 | "//base", | |
120 | "//base:flags", | |
121 | "//base:init_mozc", | |
122 | "//base:logging", | |
123 | "//base:process", | |
124 | ], | |
125 | ) | |
126 | ||
127 | cc_binary_mozc( | |
128 | name = "client_stress_test_main", | |
129 | srcs = ["client_stress_test_main.cc"], | |
130 | deps = [ | |
131 | ":client", | |
132 | "//base", | |
133 | "//base:file_stream", | |
134 | "//base:flags", | |
135 | "//base:init_mozc", | |
136 | "//base:logging", | |
137 | "//base:port", | |
138 | "//base:util", | |
139 | "//protocol:renderer_proto", | |
140 | "//renderer:renderer_client", | |
141 | "//session:random_keyevents_generator", | |
142 | ], | |
143 | ) | |
144 | ||
145 | cc_binary_mozc( | |
146 | name = "client_scenario_test_main", | |
147 | srcs = ["client_scenario_test_main.cc"], | |
148 | deps = [ | |
149 | ":client", | |
150 | "//base", | |
151 | "//base:file_stream", | |
152 | "//base:file_util", | |
153 | "//base:flags", | |
154 | "//base:init_mozc", | |
155 | "//base:logging", | |
156 | "//base:port", | |
157 | "//base:system_util", | |
158 | "//base:util", | |
159 | "//composer:key_parser", | |
160 | "//protocol:commands_proto", | |
161 | "//protocol:renderer_proto", | |
162 | "//renderer:renderer_client", | |
163 | ], | |
164 | ) | |
165 | ||
166 | cc_binary_mozc( | |
167 | name = "client_performance_test_main", | |
168 | srcs = ["client_performance_test_main.cc"], | |
169 | deps = [ | |
170 | ":client", | |
171 | "//base", | |
172 | "//base:file_stream", | |
173 | "//base:flags", | |
174 | "//base:init_mozc", | |
175 | "//base:logging", | |
176 | "//base:port", | |
177 | "//base:singleton", | |
178 | "//base:stopwatch", | |
179 | "//base:util", | |
180 | "//composer:key_parser", | |
181 | "//config:config_handler", | |
182 | "//protocol:commands_proto", | |
183 | "//session:random_keyevents_generator", | |
184 | ], | |
185 | ) | |
186 | ||
187 | cc_binary_mozc( | |
188 | name = "ping_server_main", | |
189 | srcs = ["ping_server_main.cc"], | |
190 | deps = [ | |
191 | ":client", | |
192 | "//base", | |
193 | "//base:flags", | |
194 | "//base:init_mozc", | |
195 | "//base:logging", | |
196 | ], | |
197 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | ) | |
36 | ||
37 | package(default_visibility = [ | |
38 | "//:__subpackages__", | |
39 | ]) | |
40 | ||
41 | test_suite( | |
42 | name = "nacl_test", | |
43 | tags = ["-disable_on_nacl_test"], | |
44 | ) | |
45 | ||
46 | cc_library_mozc( | |
47 | name = "composer", | |
48 | srcs = ["composer.cc"], | |
49 | hdrs = ["composer.h"], | |
50 | deps = [ | |
51 | ":composition_interface", | |
52 | ":key_event_util", | |
53 | ":table", | |
54 | ":type_corrected_query", | |
55 | "//base", | |
56 | "//base:flags", | |
57 | "//base:logging", | |
58 | "//base:port", | |
59 | "//base:util", | |
60 | "//base/protobuf", | |
61 | "//base/protobuf:repeated_field", | |
62 | "//composer/internal:composition", | |
63 | "//composer/internal:composition_input", | |
64 | "//composer/internal:mode_switching_handler", | |
65 | "//composer/internal:transliterators", | |
66 | "//composer/internal:typing_corrector", | |
67 | "//config:character_form_manager", | |
68 | "//config:config_handler", | |
69 | "//protocol:commands_proto", | |
70 | "//protocol:config_proto", | |
71 | "//testing:gunit_prod", | |
72 | "//transliteration", | |
73 | ], | |
74 | ) | |
75 | ||
76 | cc_test_mozc( | |
77 | name = "composer_test", | |
78 | size = "small", | |
79 | srcs = ["composer_test.cc"], | |
80 | deps = [ | |
81 | ":composer", | |
82 | ":key_parser", | |
83 | ":table", | |
84 | "//base", | |
85 | "//base:logging", | |
86 | "//base:system_util", | |
87 | "//base:util", | |
88 | "//composer/internal:typing_model", | |
89 | "//config:character_form_manager", | |
90 | "//config:config_handler", | |
91 | "//data_manager/testing:mock_data_manager", | |
92 | "//protocol:commands_proto", | |
93 | "//protocol:config_proto", | |
94 | "//session:request_test_util", | |
95 | "//testing:gunit_main", | |
96 | "@com_google_absl//absl/strings", | |
97 | ], | |
98 | ) | |
99 | ||
100 | cc_library_mozc( | |
101 | name = "table", | |
102 | srcs = ["table.cc"], | |
103 | hdrs = ["table.h"], | |
104 | deps = [ | |
105 | "//base", | |
106 | "//base:config_file_stream", | |
107 | "//base:file_stream", | |
108 | "//base:hash", | |
109 | "//base:logging", | |
110 | "//base:port", | |
111 | "//base:trie", | |
112 | "//base:util", | |
113 | "//composer/internal:composition_input", | |
114 | "//composer/internal:typing_model", | |
115 | "//config:config_handler", | |
116 | "//data_manager:data_manager_interface", | |
117 | "//protocol:commands_proto", | |
118 | "//protocol:config_proto", | |
119 | "//testing:gunit_prod", | |
120 | ], | |
121 | ) | |
122 | ||
123 | cc_library_mozc( | |
124 | name = "composition_interface", | |
125 | hdrs = ["composition_interface.h"], | |
126 | visibility = [ | |
127 | # For //composer/internal:composition. | |
128 | "//composer/internal:__pkg__", | |
129 | ], | |
130 | deps = ["//composer/internal:transliterators"], | |
131 | ) | |
132 | ||
133 | cc_library_mozc( | |
134 | name = "type_corrected_query", | |
135 | hdrs = ["type_corrected_query.h"], | |
136 | visibility = [ | |
137 | # For //composer/internal:typing_corrector_test. | |
138 | "//composer/internal:__pkg__", | |
139 | ], | |
140 | ) | |
141 | ||
142 | cc_binary_mozc( | |
143 | name = "composer_main", | |
144 | srcs = ["composer_main.cc"], | |
145 | deps = [ | |
146 | ":composer", | |
147 | ":composition_interface", | |
148 | ":table", | |
149 | "//base", | |
150 | "//base:flags", | |
151 | "//base:init_mozc", | |
152 | "//base/protobuf", | |
153 | "//protocol:commands_proto", | |
154 | "//protocol:config_proto", | |
155 | "//transliteration", | |
156 | ], | |
157 | ) | |
158 | ||
159 | cc_test_mozc( | |
160 | name = "table_test", | |
161 | size = "small", | |
162 | srcs = ["table_test.cc"], | |
163 | deps = [ | |
164 | ":table", | |
165 | "//base", | |
166 | "//base:file_util", | |
167 | "//base:port", | |
168 | "//base:system_util", | |
169 | "//composer/internal:composition_input", | |
170 | "//config:config_handler", | |
171 | "//data_manager/testing:mock_data_manager", | |
172 | "//protocol:commands_proto", | |
173 | "//protocol:config_proto", | |
174 | "//testing:googletest", | |
175 | "//testing:gunit_main", | |
176 | ], | |
177 | ) | |
178 | ||
179 | cc_library_mozc( | |
180 | name = "key_event_util", | |
181 | srcs = ["key_event_util.cc"], | |
182 | hdrs = ["key_event_util.h"], | |
183 | deps = [ | |
184 | "//base", | |
185 | "//base:logging", | |
186 | "//base:port", | |
187 | "//protocol:commands_proto", | |
188 | ], | |
189 | ) | |
190 | ||
191 | cc_test_mozc( | |
192 | name = "key_event_util_test", | |
193 | size = "small", | |
194 | srcs = ["key_event_util_test.cc"], | |
195 | deps = [ | |
196 | ":key_event_util", | |
197 | ":key_parser", | |
198 | "//base", | |
199 | "//base:util", | |
200 | "//protocol:commands_proto", | |
201 | "//testing:gunit_main", | |
202 | ], | |
203 | ) | |
204 | ||
205 | cc_library_mozc( | |
206 | name = "key_parser", | |
207 | srcs = ["key_parser.cc"], | |
208 | hdrs = ["key_parser.h"], | |
209 | deps = [ | |
210 | "//base", | |
211 | "//base:logging", | |
212 | "//base:port", | |
213 | "//base:singleton", | |
214 | "//base:util", | |
215 | "//protocol:commands_proto", | |
216 | ], | |
217 | ) | |
218 | ||
219 | cc_test_mozc( | |
220 | name = "key_parser_test", | |
221 | size = "small", | |
222 | srcs = ["key_parser_test.cc"], | |
223 | deps = [ | |
224 | ":key_event_util", | |
225 | ":key_parser", | |
226 | "//base", | |
227 | "//base:port", | |
228 | "//protocol:commands_proto", | |
229 | "//testing:gunit_main", | |
230 | ], | |
231 | ) | |
232 | ||
233 | cc_test_mozc( | |
234 | name = "composer_benchmark_test", | |
235 | size = "small", | |
236 | srcs = ["composer_benchmark_test.cc"], | |
237 | tags = ["disable_on_nacl_test"], | |
238 | deps = [ | |
239 | ":composer", | |
240 | ":key_parser", | |
241 | ":table", | |
242 | "//base", | |
243 | "//composer/internal:typing_model", | |
244 | "//config:character_form_manager", | |
245 | "//config:config_handler", | |
246 | "//data_manager/testing:mock_data_manager", | |
247 | "//engine:engine_interface", | |
248 | "//protocol:commands_proto", | |
249 | "//protocol:config_proto", | |
250 | "//request:conversion_request", | |
251 | "//session:request_test_util", | |
252 | "//testing:gunit_main", | |
253 | "//testing:mozctest", | |
254 | "//testing/base/public:gunit_main", | |
255 | ], | |
256 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | "py_binary_mozc", | |
36 | "py_library_mozc", | |
37 | ) | |
38 | ||
39 | package(default_visibility = [ | |
40 | "//:__subpackages__", | |
41 | ]) | |
42 | ||
43 | test_suite( | |
44 | name = "nacl_test", | |
45 | ) | |
46 | ||
47 | cc_library_mozc( | |
48 | name = "transliterator_interface", | |
49 | hdrs = ["transliterator_interface.h"], | |
50 | ) | |
51 | ||
52 | cc_library_mozc( | |
53 | name = "char_chunk", | |
54 | srcs = [ | |
55 | "char_chunk.cc", | |
56 | ], | |
57 | hdrs = ["char_chunk.h"], | |
58 | deps = [ | |
59 | ":composition_input", | |
60 | ":transliterator_interface", | |
61 | ":transliterators", | |
62 | "//base", | |
63 | "//base:logging", | |
64 | "//base:port", | |
65 | "//base:util", | |
66 | "//composer:table", | |
67 | "//testing:gunit_prod", | |
68 | ], | |
69 | ) | |
70 | ||
71 | cc_library_mozc( | |
72 | name = "transliterators", | |
73 | srcs = [ | |
74 | "transliterators.cc", | |
75 | ], | |
76 | hdrs = ["transliterators.h"], | |
77 | deps = [ | |
78 | ":transliterator_interface", | |
79 | "//base", | |
80 | "//base:logging", | |
81 | "//base:singleton", | |
82 | "//base:util", | |
83 | "//config:character_form_manager", | |
84 | ], | |
85 | ) | |
86 | ||
87 | cc_test_mozc( | |
88 | name = "transliterators_test", | |
89 | size = "small", | |
90 | srcs = [ | |
91 | "transliterators_test.cc", | |
92 | ], | |
93 | deps = [ | |
94 | ":transliterator_interface", | |
95 | ":transliterators", | |
96 | "//testing:gunit_main", | |
97 | ], | |
98 | ) | |
99 | ||
100 | cc_test_mozc( | |
101 | name = "char_chunk_test", | |
102 | size = "small", | |
103 | srcs = [ | |
104 | "char_chunk_test.cc", | |
105 | ], | |
106 | deps = [ | |
107 | ":char_chunk", | |
108 | ":composition_input", | |
109 | ":transliterator_interface", | |
110 | ":transliterators", | |
111 | "//composer:table", | |
112 | "//testing:gunit_main", | |
113 | ], | |
114 | ) | |
115 | ||
116 | cc_library_mozc( | |
117 | name = "composition_input", | |
118 | srcs = ["composition_input.cc"], | |
119 | hdrs = ["composition_input.h"], | |
120 | deps = [ | |
121 | "//base", | |
122 | "//base:logging", | |
123 | "//base:port", | |
124 | ], | |
125 | ) | |
126 | ||
127 | cc_test_mozc( | |
128 | name = "composition_input_test", | |
129 | size = "small", | |
130 | srcs = [ | |
131 | "composition_input_test.cc", | |
132 | ], | |
133 | deps = [ | |
134 | ":composition_input", | |
135 | ":transliterator_interface", | |
136 | ":transliterators", | |
137 | "//testing:gunit_main", | |
138 | ], | |
139 | ) | |
140 | ||
141 | cc_library_mozc( | |
142 | name = "composition", | |
143 | srcs = [ | |
144 | "composition.cc", | |
145 | ], | |
146 | hdrs = ["composition.h"], | |
147 | deps = [ | |
148 | ":char_chunk", | |
149 | ":composition_input", | |
150 | ":transliterator_interface", | |
151 | ":transliterators", | |
152 | "//base", | |
153 | "//base:logging", | |
154 | "//base:port", | |
155 | "//base:util", | |
156 | "//composer:composition_interface", | |
157 | "//composer:table", | |
158 | "//testing:gunit_prod", | |
159 | ], | |
160 | ) | |
161 | ||
162 | cc_test_mozc( | |
163 | name = "composition_test", | |
164 | size = "small", | |
165 | srcs = [ | |
166 | "composition_test.cc", | |
167 | ], | |
168 | deps = [ | |
169 | ":char_chunk", | |
170 | ":composition", | |
171 | ":composition_input", | |
172 | ":transliterator_interface", | |
173 | ":transliterators", | |
174 | "//composer:composition_interface", | |
175 | "//composer:table", | |
176 | "//testing:gunit_main", | |
177 | ], | |
178 | ) | |
179 | ||
180 | cc_binary_mozc( | |
181 | name = "composition_main", | |
182 | srcs = ["composition_main.cc"], | |
183 | deps = [ | |
184 | ":composition", | |
185 | "//base:flags", | |
186 | "//base:init_mozc", | |
187 | "//composer:composition_interface", | |
188 | "//composer:table", | |
189 | ], | |
190 | ) | |
191 | ||
192 | cc_library_mozc( | |
193 | name = "converter", | |
194 | srcs = ["converter.cc"], | |
195 | hdrs = ["converter.h"], | |
196 | deps = [ | |
197 | "//base", | |
198 | "//base:port", | |
199 | "//composer:table", | |
200 | ], | |
201 | ) | |
202 | ||
203 | cc_test_mozc( | |
204 | name = "converter_test", | |
205 | size = "small", | |
206 | srcs = ["converter_test.cc"], | |
207 | deps = [ | |
208 | ":converter", | |
209 | "//base", | |
210 | "//composer:table", | |
211 | "//testing:gunit_main", | |
212 | ], | |
213 | ) | |
214 | ||
215 | cc_library_mozc( | |
216 | name = "mode_switching_handler", | |
217 | srcs = ["mode_switching_handler.cc"], | |
218 | hdrs = ["mode_switching_handler.h"], | |
219 | deps = [ | |
220 | "//base", | |
221 | "//base:logging", | |
222 | "//base:singleton", | |
223 | ], | |
224 | ) | |
225 | ||
226 | cc_test_mozc( | |
227 | name = "mode_switching_handler_test", | |
228 | size = "small", | |
229 | srcs = ["mode_switching_handler_test.cc"], | |
230 | deps = [ | |
231 | ":mode_switching_handler", | |
232 | "//base", | |
233 | "//testing:gunit_main", | |
234 | ], | |
235 | ) | |
236 | ||
237 | cc_binary_mozc( | |
238 | name = "converter_main", | |
239 | srcs = ["converter_main.cc"], | |
240 | deps = [ | |
241 | ":converter", | |
242 | "//base:flags", | |
243 | "//base:init_mozc", | |
244 | "//composer:table", | |
245 | ], | |
246 | ) | |
247 | ||
248 | py_library_mozc( | |
249 | name = "gen_typing_model_lib", | |
250 | srcs = ["gen_typing_model.py"], | |
251 | ) | |
252 | ||
253 | py_binary_mozc( | |
254 | name = "gen_typing_model", | |
255 | srcs = ["gen_typing_model.py"], | |
256 | deps = [":gen_typing_model_lib"], | |
257 | ) | |
258 | ||
259 | cc_library_mozc( | |
260 | name = "typing_model", | |
261 | srcs = ["typing_model.cc"], | |
262 | hdrs = ["typing_model.h"], | |
263 | deps = [ | |
264 | "//base", | |
265 | "//base:port", | |
266 | "//data_manager:data_manager_interface", | |
267 | "//protocol:commands_proto", | |
268 | "//testing:gunit_prod", | |
269 | "@com_google_absl//absl/strings", | |
270 | ], | |
271 | ) | |
272 | ||
273 | cc_test_mozc( | |
274 | name = "typing_model_test", | |
275 | size = "small", | |
276 | srcs = ["typing_model_test.cc"], | |
277 | deps = [ | |
278 | ":typing_model", | |
279 | "//base", | |
280 | "//composer:type_corrected_query", | |
281 | "//session:request_test_util", | |
282 | "//testing:gunit_main", | |
283 | ], | |
284 | ) | |
285 | ||
286 | cc_library_mozc( | |
287 | name = "typing_corrector", | |
288 | srcs = [ | |
289 | "typing_corrector.cc", | |
290 | ], | |
291 | hdrs = ["typing_corrector.h"], | |
292 | deps = [ | |
293 | ":composition", | |
294 | ":composition_input", | |
295 | ":typing_model", | |
296 | "//base", | |
297 | "//base:flags", | |
298 | "//base:port", | |
299 | "//base/protobuf", | |
300 | "//base/protobuf:repeated_field", | |
301 | "//composer:composition_interface", | |
302 | "//composer:table", | |
303 | "//composer:type_corrected_query", | |
304 | "//config:config_handler", | |
305 | "//protocol:config_proto", | |
306 | "@com_google_absl//absl/strings", | |
307 | ], | |
308 | ) | |
309 | ||
310 | cc_test_mozc( | |
311 | name = "typing_corrector_test", | |
312 | size = "small", | |
313 | srcs = ["typing_corrector_test.cc"], | |
314 | deps = [ | |
315 | "typing_corrector", | |
316 | ":typing_model", | |
317 | "//base", | |
318 | "//base:singleton", | |
319 | "//composer:table", | |
320 | "//composer:type_corrected_query", | |
321 | "//config:config_handler", | |
322 | "//data_manager/testing:mock_data_manager", | |
323 | "//protocol:commands_proto", | |
324 | "//session:request_test_util", | |
325 | "//testing:gunit_main", | |
326 | "@com_google_absl//absl/strings", | |
327 | ], | |
328 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | "select_mozc", | |
35 | ) | |
36 | ||
37 | package(default_visibility = [ | |
38 | "//:__subpackages__", | |
39 | ]) | |
40 | ||
41 | test_suite( | |
42 | name = "nacl_test", | |
43 | ) | |
44 | ||
45 | cc_library_mozc( | |
46 | name = "config_handler", | |
47 | srcs = ["config_handler.cc"], | |
48 | hdrs = ["config_handler.h"], | |
49 | deps = [ | |
50 | "//base", | |
51 | "//base:clock", | |
52 | "//base:config_file_stream", | |
53 | "//base:logging", | |
54 | "//base:mutex", | |
55 | "//base:port", | |
56 | "//base:singleton", | |
57 | "//base:system_util", | |
58 | "//base:version", | |
59 | "//protocol:config_proto", | |
60 | ], | |
61 | ) | |
62 | ||
63 | cc_test_mozc( | |
64 | name = "config_handler_test", | |
65 | size = "large", | |
66 | srcs = ["config_handler_test.cc"], | |
67 | data = ["//data/test/config:config_test_data"], | |
68 | deps = [ | |
69 | ":config_handler", | |
70 | "//base", | |
71 | "//base:file_util", | |
72 | "//base:logging", | |
73 | "//base:mozc_hash_set", | |
74 | "//base:port", | |
75 | "//base:system_util", | |
76 | "//base:thread", | |
77 | "//base:util", | |
78 | "//protocol:config_proto", | |
79 | "//testing:googletest", | |
80 | "//testing:gunit_main", | |
81 | "//testing:mozctest", | |
82 | ], | |
83 | ) | |
84 | ||
85 | cc_library_mozc( | |
86 | name = "stats_config_util", | |
87 | srcs = ["stats_config_util.cc"], | |
88 | hdrs = ["stats_config_util.h"], | |
89 | deps = [ | |
90 | ":config_handler", | |
91 | "//base:file_util", | |
92 | "//base:mutex", | |
93 | "//base:singleton", | |
94 | "//base:system_util", | |
95 | ] + select_mozc( | |
96 | ios = ["//base:mac_util"], | |
97 | ) + [ | |
98 | "//base:port", | |
99 | "//protocol:config_proto", | |
100 | ], | |
101 | ) | |
102 | ||
103 | cc_test_mozc( | |
104 | name = "stats_config_util_test", | |
105 | size = "small", | |
106 | srcs = ["stats_config_util_test.cc"], | |
107 | deps = [ | |
108 | ":config_handler", | |
109 | ":stats_config_util", | |
110 | "//base:file_util", | |
111 | "//base:singleton", | |
112 | "//base:system_util", | |
113 | "//base:win_api_test_helper", | |
114 | "//protocol:config_proto", | |
115 | "//testing:googletest", | |
116 | "//testing:gunit_main", | |
117 | ], | |
118 | ) | |
119 | ||
120 | cc_library_mozc( | |
121 | name = "stats_config_util_mock", | |
122 | testonly = 1, | |
123 | hdrs = ["stats_config_util_mock.h"], | |
124 | deps = [":stats_config_util"], | |
125 | ) | |
126 | ||
127 | cc_library_mozc( | |
128 | name = "character_form_manager", | |
129 | srcs = ["character_form_manager.cc"], | |
130 | hdrs = ["character_form_manager.h"], | |
131 | visibility = ["//:__subpackages__"], | |
132 | deps = [ | |
133 | ":config_handler", | |
134 | "//base", | |
135 | "//base:config_file_stream", | |
136 | "//base:logging", | |
137 | "//base:port", | |
138 | "//base:singleton", | |
139 | "//base:util", | |
140 | "//protocol:config_proto", | |
141 | "//storage:lru_storage", | |
142 | ], | |
143 | ) | |
144 | ||
145 | cc_test_mozc( | |
146 | name = "character_form_manager_test", | |
147 | size = "large", | |
148 | srcs = ["character_form_manager_test.cc"], | |
149 | deps = [ | |
150 | ":character_form_manager", | |
151 | ":config_handler", | |
152 | "//base", | |
153 | "//base:system_util", | |
154 | "//protocol:config_proto", | |
155 | "//testing:googletest", | |
156 | "//testing:gunit_main", | |
157 | ], | |
158 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | "py_binary_mozc", | |
36 | "py_library_mozc", | |
37 | ) | |
38 | load( | |
39 | ":quality_regression_test.bzl", | |
40 | "quality_regression_tests", | |
41 | ) | |
42 | ||
43 | package(default_visibility = [ | |
44 | "//:__subpackages__", | |
45 | ]) | |
46 | ||
47 | test_suite( | |
48 | name = "nacl_test", | |
49 | tags = ["-disable_on_nacl_test"], | |
50 | ) | |
51 | ||
52 | test_suite( | |
53 | name = "nacl_tap_test", | |
54 | tags = [ | |
55 | "-disable_on_nacl_tap_test", | |
56 | "-disable_on_nacl_test", | |
57 | ], | |
58 | ) | |
59 | ||
60 | cc_library_mozc( | |
61 | name = "segments", | |
62 | srcs = [ | |
63 | "segments.cc", | |
64 | ], | |
65 | hdrs = ["segments.h"], | |
66 | visibility = [ | |
67 | "//:__subpackages__", | |
68 | ], | |
69 | deps = [ | |
70 | ":lattice", | |
71 | "//base", | |
72 | "//base:freelist", | |
73 | "//base:logging", | |
74 | "//base:number_util", | |
75 | "//base:port", | |
76 | "//base:util", | |
77 | "//config:config_handler", | |
78 | "//dictionary:pos_matcher_lib", | |
79 | "@com_google_absl//absl/strings", | |
80 | ], | |
81 | ) | |
82 | ||
83 | cc_test_mozc( | |
84 | name = "segments_test", | |
85 | size = "small", | |
86 | srcs = ["segments_test.cc"], | |
87 | deps = [ | |
88 | ":segments", | |
89 | "//base", | |
90 | "//base:number_util", | |
91 | "//base:system_util", | |
92 | "//base:util", | |
93 | "//config:config_handler", | |
94 | "//testing:gunit_main", | |
95 | "@com_google_absl//absl/strings", | |
96 | ], | |
97 | ) | |
98 | ||
99 | cc_library_mozc( | |
100 | name = "node", | |
101 | hdrs = ["node.h"], | |
102 | visibility = [ | |
103 | "//data_manager:__pkg__", | |
104 | "//dictionary:__subpackages__", | |
105 | ], | |
106 | deps = [ | |
107 | "//base", | |
108 | "//base:port", | |
109 | "//dictionary:dictionary_token", | |
110 | ], | |
111 | ) | |
112 | ||
113 | cc_library_mozc( | |
114 | name = "node_allocator", | |
115 | hdrs = ["node_allocator.h"], | |
116 | visibility = [ | |
117 | "//dictionary:__subpackages__", | |
118 | "//prediction:__pkg__", | |
119 | ], | |
120 | deps = [ | |
121 | ":node", | |
122 | "//base", | |
123 | "//base:freelist", | |
124 | "//base:logging", | |
125 | "//base:port", | |
126 | ], | |
127 | ) | |
128 | ||
129 | cc_library_mozc( | |
130 | name = "node_list_builder", | |
131 | hdrs = ["node_list_builder.h"], | |
132 | deps = [ | |
133 | ":node", | |
134 | ":node_allocator", | |
135 | "//base:logging", | |
136 | "//base:port", | |
137 | "//base:trie", | |
138 | "//dictionary:dictionary_interface", | |
139 | "//dictionary:dictionary_token", | |
140 | "@com_google_absl//absl/strings", | |
141 | ], | |
142 | ) | |
143 | ||
144 | cc_library_mozc( | |
145 | name = "connector", | |
146 | srcs = ["connector.cc"], | |
147 | hdrs = ["connector.h"], | |
148 | deps = [ | |
149 | "//base", | |
150 | "//base:logging", | |
151 | "//base:mutex", | |
152 | "//base:port", | |
153 | "//base:status", | |
154 | "//base:util", | |
155 | "//data_manager:data_manager_interface", | |
156 | "//storage/louds:simple_succinct_bit_vector_index", | |
157 | "@com_google_absl//absl/memory", | |
158 | "@com_google_absl//absl/strings", | |
159 | ], | |
160 | ) | |
161 | ||
162 | cc_test_mozc( | |
163 | name = "connector_test", | |
164 | srcs = ["connector_test.cc"], | |
165 | data = [ | |
166 | "//data_manager/testing:mozc_dataset_for_testing@connection", | |
167 | "//data_manager/testing:mozc_dataset_for_testing@connection_single_column", | |
168 | ], | |
169 | deps = [ | |
170 | ":connector", | |
171 | "//base", | |
172 | "//base:logging", | |
173 | "//base:mmap", | |
174 | "//data_manager:connection_file_reader", | |
175 | "//testing:gunit_main", | |
176 | "//testing:mozctest", | |
177 | "@com_google_absl//absl/memory", | |
178 | ], | |
179 | ) | |
180 | ||
181 | cc_library_mozc( | |
182 | name = "nbest_generator", | |
183 | srcs = [ | |
184 | "nbest_generator.cc", | |
185 | ], | |
186 | hdrs = ["nbest_generator.h"], | |
187 | deps = [ | |
188 | ":candidate_filter", | |
189 | ":connector", | |
190 | ":lattice", | |
191 | ":node", | |
192 | ":segmenter", | |
193 | ":segments", | |
194 | "//base", | |
195 | "//base:freelist", | |
196 | "//base:logging", | |
197 | "//base:port", | |
198 | "//base:util", | |
199 | "//dictionary:pos_matcher_lib", | |
200 | "//dictionary:suppression_dictionary", | |
201 | ], | |
202 | ) | |
203 | ||
204 | cc_test_mozc( | |
205 | name = "nbest_generator_test", | |
206 | srcs = [ | |
207 | "nbest_generator_test.cc", | |
208 | ], | |
209 | deps = [ | |
210 | ":connector", | |
211 | ":immutable_converter_no_factory", | |
212 | ":nbest_generator", | |
213 | ":segmenter", | |
214 | ":segments", | |
215 | "//base", | |
216 | "//base:logging", | |
217 | "//base:port", | |
218 | "//base:system_util", | |
219 | "//config:config_handler", | |
220 | "//data_manager:data_manager_interface", | |
221 | "//data_manager/testing:mock_data_manager", | |
222 | "//dictionary:dictionary_impl", | |
223 | "//dictionary:dictionary_interface", | |
224 | "//dictionary:pos_group", | |
225 | "//dictionary:pos_matcher_lib", | |
226 | "//dictionary:suffix_dictionary", | |
227 | "//dictionary:suppression_dictionary", | |
228 | "//dictionary:user_dictionary_stub", | |
229 | "//dictionary/system:system_dictionary", | |
230 | "//dictionary/system:value_dictionary", | |
231 | "//prediction:suggestion_filter", | |
232 | "//request:conversion_request", | |
233 | "//session:request_test_util", | |
234 | "//testing:googletest", | |
235 | "//testing:gunit_main", | |
236 | "@com_google_absl//absl/memory", | |
237 | "@com_google_absl//absl/strings", | |
238 | ], | |
239 | ) | |
240 | ||
241 | cc_library_mozc( | |
242 | name = "candidate_filter", | |
243 | srcs = [ | |
244 | "candidate_filter.cc", | |
245 | ], | |
246 | hdrs = ["candidate_filter.h"], | |
247 | deps = [ | |
248 | ":lattice", | |
249 | ":node", | |
250 | ":node_allocator", | |
251 | ":segments", | |
252 | "//base", | |
253 | "//base:logging", | |
254 | "//base:port", | |
255 | "//base:util", | |
256 | "//dictionary:pos_matcher_lib", | |
257 | "//dictionary:suppression_dictionary", | |
258 | "//prediction:suggestion_filter", | |
259 | ], | |
260 | ) | |
261 | ||
262 | cc_test_mozc( | |
263 | name = "candidate_filter_test", | |
264 | size = "small", | |
265 | srcs = ["candidate_filter_test.cc"], | |
266 | deps = [ | |
267 | ":candidate_filter", | |
268 | ":node", | |
269 | ":segments", | |
270 | "//base", | |
271 | "//base:freelist", | |
272 | "//base:port", | |
273 | "//base:util", | |
274 | "//data_manager/testing:mock_data_manager", | |
275 | "//dictionary:pos_matcher_lib", | |
276 | "//dictionary:suppression_dictionary", | |
277 | "//prediction:suggestion_filter", | |
278 | "//testing:gunit_main", | |
279 | ], | |
280 | ) | |
281 | ||
282 | cc_library_mozc( | |
283 | name = "segmenter", | |
284 | srcs = ["segmenter.cc"], | |
285 | hdrs = ["segmenter.h"], | |
286 | deps = [ | |
287 | ":node", | |
288 | "//base", | |
289 | "//base:bitarray", | |
290 | "//base:logging", | |
291 | "//base:port", | |
292 | "//data_manager:data_manager_interface", | |
293 | ], | |
294 | ) | |
295 | ||
296 | cc_library_mozc( | |
297 | name = "lattice", | |
298 | srcs = [ | |
299 | "lattice.cc", | |
300 | ], | |
301 | hdrs = ["lattice.h"], | |
302 | visibility = ["//visibility:private"], | |
303 | deps = [ | |
304 | ":node", | |
305 | ":node_allocator", | |
306 | "//base", | |
307 | "//base:freelist", | |
308 | "//base:logging", | |
309 | "//base:port", | |
310 | "//base:singleton", | |
311 | "//base:util", | |
312 | "@com_google_absl//absl/strings", | |
313 | ], | |
314 | ) | |
315 | ||
316 | cc_test_mozc( | |
317 | name = "lattice_test", | |
318 | size = "small", | |
319 | srcs = ["lattice_test.cc"], | |
320 | deps = [ | |
321 | ":lattice", | |
322 | ":node", | |
323 | "//base", | |
324 | "//base:port", | |
325 | "//testing:gunit_main", | |
326 | ], | |
327 | ) | |
328 | ||
329 | cc_library_mozc( | |
330 | name = "immutable_converter_interface", | |
331 | srcs = ["immutable_converter_interface.cc"], | |
332 | hdrs = ["immutable_converter_interface.h"], | |
333 | visibility = [ | |
334 | "//:__subpackages__", | |
335 | ], | |
336 | deps = [ | |
337 | "//base:logging", | |
338 | "//request:conversion_request", | |
339 | ], | |
340 | ) | |
341 | ||
342 | cc_library_mozc( | |
343 | name = "immutable_converter_no_factory", | |
344 | srcs = [ | |
345 | "immutable_converter.cc", | |
346 | ], | |
347 | hdrs = ["immutable_converter.h"], | |
348 | visibility = [ | |
349 | "//engine:__pkg__", | |
350 | "//prediction:__pkg__", | |
351 | ], | |
352 | deps = [ | |
353 | ":connector", | |
354 | ":immutable_converter_interface", | |
355 | ":key_corrector", | |
356 | ":lattice", | |
357 | ":nbest_generator", | |
358 | ":node", | |
359 | ":node_allocator", | |
360 | ":node_list_builder", | |
361 | ":segmenter", | |
362 | ":segments", | |
363 | "//base", | |
364 | "//base:logging", | |
365 | "//base:port", | |
366 | "//base:stl_util", | |
367 | "//base:util", | |
368 | "//config:config_handler", | |
369 | "//dictionary:dictionary_interface", | |
370 | "//dictionary:pos_group", | |
371 | "//dictionary:pos_matcher_lib", | |
372 | "//dictionary:suppression_dictionary", | |
373 | "//prediction:suggestion_filter", | |
374 | "//protocol:commands_proto", | |
375 | "//protocol:config_proto", | |
376 | "//request:conversion_request", | |
377 | "//testing:gunit_prod", | |
378 | "@com_google_absl//absl/strings", | |
379 | ], | |
380 | ) | |
381 | ||
382 | cc_library_mozc( | |
383 | name = "immutable_converter_factory", | |
384 | srcs = ["immutable_converter_factory.cc"], | |
385 | hdrs = ["immutable_converter_factory.h"], | |
386 | visibility = [ | |
387 | ], | |
388 | deps = [ | |
389 | ":immutable_converter_interface", | |
390 | ":immutable_converter_no_factory", | |
391 | "//base:singleton", | |
392 | "//engine:large_immutable_converter", | |
393 | ], | |
394 | ) | |
395 | ||
396 | cc_test_mozc( | |
397 | name = "immutable_converter_test", | |
398 | size = "small", | |
399 | srcs = [ | |
400 | "immutable_converter_test.cc", | |
401 | ], | |
402 | deps = [ | |
403 | ":connector", | |
404 | ":immutable_converter_no_factory", | |
405 | ":lattice", | |
406 | ":segmenter", | |
407 | ":segments", | |
408 | "//base", | |
409 | "//base:logging", | |
410 | "//base:port", | |
411 | "//base:system_util", | |
412 | "//base:util", | |
413 | "//config:config_handler", | |
414 | "//data_manager:data_manager_interface", | |
415 | "//data_manager/testing:mock_data_manager", | |
416 | "//dictionary:dictionary_impl", | |
417 | "//dictionary:dictionary_interface", | |
418 | "//dictionary:pos_group", | |
419 | "//dictionary:pos_matcher_lib", | |
420 | "//dictionary:suffix_dictionary", | |
421 | "//dictionary:suppression_dictionary", | |
422 | "//dictionary:user_dictionary_stub", | |
423 | "//dictionary/system:system_dictionary", | |
424 | "//dictionary/system:value_dictionary", | |
425 | "//prediction:suggestion_filter", | |
426 | "//protocol:commands_proto", | |
427 | "//request:conversion_request", | |
428 | "//session:request_test_util", | |
429 | "//testing:googletest", | |
430 | "//testing:gunit_main", | |
431 | "@com_google_absl//absl/memory", | |
432 | "@com_google_absl//absl/strings", | |
433 | ], | |
434 | ) | |
435 | ||
436 | cc_library_mozc( | |
437 | name = "converter_interface", | |
438 | hdrs = ["converter_interface.h"], | |
439 | deps = [ | |
440 | ":segments", | |
441 | "//base:port", | |
442 | "//request:conversion_request", | |
443 | "@com_google_absl//absl/strings", | |
444 | ], | |
445 | ) | |
446 | ||
447 | cc_library_mozc( | |
448 | name = "converter_util", | |
449 | srcs = ["converter_util.cc"], | |
450 | hdrs = ["converter_util.h"], | |
451 | visibility = ["//session:__pkg__"], | |
452 | deps = [ | |
453 | ":segments", | |
454 | "//base:port", | |
455 | ], | |
456 | ) | |
457 | ||
458 | cc_library_mozc( | |
459 | name = "converter", | |
460 | srcs = [ | |
461 | "converter.cc", | |
462 | ], | |
463 | hdrs = ["converter.h"], | |
464 | visibility = [ | |
465 | "//engine:__pkg__", | |
466 | "//evaluation/simulator:__pkg__", | |
467 | "//rewriter:__pkg__", | |
468 | "//session:__pkg__", | |
469 | ], | |
470 | deps = [ | |
471 | ":converter_interface", | |
472 | ":immutable_converter_interface", | |
473 | ":segments", | |
474 | "//base", | |
475 | "//base:logging", | |
476 | "//base:number_util", | |
477 | "//base:port", | |
478 | "//base:util", | |
479 | "//composer", | |
480 | "//dictionary:dictionary_interface", | |
481 | "//dictionary:pos_group", | |
482 | "//dictionary:pos_matcher_lib", | |
483 | "//dictionary:suppression_dictionary", | |
484 | "//prediction:predictor_interface", | |
485 | "//request:conversion_request", | |
486 | "//rewriter:rewriter_interface", | |
487 | "//testing:gunit_prod", | |
488 | "//transliteration", | |
489 | "//usage_stats", | |
490 | "@com_google_absl//absl/strings", | |
491 | ], | |
492 | ) | |
493 | ||
494 | cc_test_mozc( | |
495 | name = "converter_test", | |
496 | size = "small", | |
497 | timeout = "moderate", | |
498 | srcs = ["converter_test.cc"], | |
499 | deps = [ | |
500 | ":connector", | |
501 | ":converter", | |
502 | ":converter_interface", | |
503 | ":immutable_converter_interface", | |
504 | ":immutable_converter_no_factory", | |
505 | ":node", | |
506 | ":segmenter", | |
507 | ":segments", | |
508 | "//base", | |
509 | "//base:logging", | |
510 | "//base:port", | |
511 | "//base:system_util", | |
512 | "//base:util", | |
513 | "//composer", | |
514 | "//composer:table", | |
515 | "//config:config_handler", | |
516 | "//data_manager:data_manager_interface", | |
517 | "//data_manager/testing:mock_data_manager", | |
518 | "//dictionary:dictionary_impl", | |
519 | "//dictionary:dictionary_interface", | |
520 | "//dictionary:dictionary_mock", | |
521 | "//dictionary:pos_group", | |
522 | "//dictionary:pos_matcher_lib", | |
523 | "//dictionary:suffix_dictionary", | |
524 | "//dictionary:suppression_dictionary", | |
525 | "//dictionary:user_dictionary", | |
526 | "//dictionary:user_dictionary_stub", | |
527 | "//dictionary:user_pos", | |
528 | "//dictionary/system:system_dictionary", | |
529 | "//dictionary/system:value_dictionary", | |
530 | "//engine", | |
531 | "//engine:engine_factory", | |
532 | "//engine:engine_interface", | |
533 | "//engine:mock_data_engine_factory", | |
534 | "//prediction:dictionary_predictor", | |
535 | "//prediction:predictor", | |
536 | "//prediction:predictor_interface", | |
537 | "//prediction:suggestion_filter", | |
538 | "//prediction:user_history_predictor", | |
539 | "//protocol:commands_proto", | |
540 | "//protocol:config_proto", | |
541 | "//request:conversion_request", | |
542 | "//rewriter", | |
543 | "//rewriter:rewriter_interface", | |
544 | "//session:request_test_util", | |
545 | "//testing:googletest", | |
546 | "//testing:gunit_main", | |
547 | "//testing:mozctest", | |
548 | "//transliteration", | |
549 | "//usage_stats", | |
550 | "//usage_stats:usage_stats_testing_util", | |
551 | "@com_google_absl//absl/memory", | |
552 | "@com_google_absl//absl/strings", | |
553 | ], | |
554 | ) | |
555 | ||
556 | cc_test_mozc( | |
557 | name = "converter_regression_test", | |
558 | size = "medium", | |
559 | srcs = ["converter_regression_test.cc"], | |
560 | # Disable on NaCl TAP since GoogleDataManager is too large to build on ARM. | |
561 | tags = ["disable_on_nacl_tap_test"], | |
562 | deps = [ | |
563 | ":converter", | |
564 | ":converter_interface", | |
565 | ":segments", | |
566 | "//base", | |
567 | "//base:file_util", | |
568 | "//base:system_util", | |
569 | "//composer", | |
570 | "//composer:table", | |
571 | "//config:config_handler", | |
572 | "//engine", | |
573 | "//engine:engine_factory", | |
574 | "//engine:engine_interface", | |
575 | "//protocol:commands_proto", | |
576 | "//protocol:config_proto", | |
577 | "//request:conversion_request", | |
578 | "//session:request_test_util", | |
579 | "//testing:googletest", | |
580 | "//testing:gunit_main", | |
581 | "//testing:mozctest", | |
582 | ], | |
583 | ) | |
584 | ||
585 | cc_library_mozc( | |
586 | name = "pos_id_printer", | |
587 | srcs = ["pos_id_printer.cc"], | |
588 | hdrs = ["pos_id_printer.h"], | |
589 | deps = [ | |
590 | "//base", | |
591 | "//base:file_stream", | |
592 | "//base:logging", | |
593 | "//base:number_util", | |
594 | "//base:port", | |
595 | "//base:util", | |
596 | ], | |
597 | ) | |
598 | ||
599 | cc_test_mozc( | |
600 | name = "pos_id_printer_test", | |
601 | size = "small", | |
602 | srcs = ["pos_id_printer_test.cc"], | |
603 | data = ["//data/test/dictionary:id.def"], | |
604 | deps = [ | |
605 | ":pos_id_printer", | |
606 | "//base", | |
607 | "//base:file_stream", | |
608 | "//base:file_util", | |
609 | "//base:flags", | |
610 | "//testing:gunit_main", | |
611 | "//testing:mozctest", | |
612 | ], | |
613 | ) | |
614 | ||
615 | cc_binary_mozc( | |
616 | name = "converter_main", | |
617 | testonly = 1, | |
618 | srcs = ["converter_main.cc"], | |
619 | data = [ | |
620 | "//data/dictionary:id.def", | |
621 | "//data/dictionary_android:id.def", | |
622 | "//data/dictionary_chromeos:id.def", | |
623 | "//data/dictionary_oss:id.def", | |
624 | "//data/test/dictionary:id.def", | |
625 | "//data_manager/android:mozc.data", | |
626 | "//data_manager/chromeos:zipped_data_chromeos", | |
627 | "//data_manager/google:mozc.data", | |
628 | "//data_manager/oss:mozc.data", | |
629 | "//data_manager/testing:mock_mozc.data", | |
630 | ], | |
631 | deps = [ | |
632 | ":converter_interface", | |
633 | ":lattice", | |
634 | ":pos_id_printer", | |
635 | ":segments", | |
636 | "//base", | |
637 | "//base:file_stream", | |
638 | "//base:file_util", | |
639 | "//base:flags", | |
640 | "//base:init_mozc", | |
641 | "//base:logging", | |
642 | "//base:number_util", | |
643 | "//base:port", | |
644 | "//base:singleton", | |
645 | "//base:system_util", | |
646 | "//base:util", | |
647 | "//composer", | |
648 | "//composer:table", | |
649 | "//data_manager", | |
650 | "//engine", | |
651 | "//protocol:commands_proto", | |
652 | "//protocol:config_proto", | |
653 | "//request:conversion_request", | |
654 | "//session:request_test_util", | |
655 | ], | |
656 | ) | |
657 | ||
658 | cc_library_mozc( | |
659 | name = "gen_segmenter_bitarray", | |
660 | srcs = ["gen_segmenter_bitarray.cc"], | |
661 | hdrs = ["gen_segmenter_bitarray.h"], | |
662 | visibility = ["//data_manager:__subpackages__"], | |
663 | deps = [ | |
664 | "//base", | |
665 | "//base:bitarray", | |
666 | "//base:file_stream", | |
667 | "//base:logging", | |
668 | "//base:port", | |
669 | "//base:util", | |
670 | "//protocol:segmenter_data_proto", | |
671 | ], | |
672 | ) | |
673 | ||
674 | py_library_mozc( | |
675 | name = "gen_segmenter_code_lib", | |
676 | srcs = ["gen_segmenter_code.py"], | |
677 | visibility = ["//visibility:private"], | |
678 | ) | |
679 | ||
680 | py_binary_mozc( | |
681 | name = "gen_segmenter_code", | |
682 | srcs = ["gen_segmenter_code.py"], | |
683 | visibility = ["//data_manager:__subpackages__"], | |
684 | deps = [":gen_segmenter_code_lib"], | |
685 | ) | |
686 | ||
687 | py_library_mozc( | |
688 | name = "gen_boundary_data_lib", | |
689 | srcs = ["gen_boundary_data.py"], | |
690 | visibility = ["//visibility:private"], | |
691 | deps = [], | |
692 | ) | |
693 | ||
694 | py_binary_mozc( | |
695 | name = "gen_boundary_data", | |
696 | srcs = ["gen_boundary_data.py"], | |
697 | visibility = ["//data_manager:__subpackages__"], | |
698 | deps = [":gen_boundary_data_lib"], | |
699 | ) | |
700 | ||
701 | cc_library_mozc( | |
702 | name = "key_corrector", | |
703 | srcs = ["key_corrector.cc"], | |
704 | hdrs = ["key_corrector.h"], | |
705 | deps = [ | |
706 | "//base", | |
707 | "//base:logging", | |
708 | "//base:port", | |
709 | "//base:util", | |
710 | "//protocol:config_proto", | |
711 | ], | |
712 | ) | |
713 | ||
714 | cc_test_mozc( | |
715 | name = "key_corrector_test", | |
716 | size = "small", | |
717 | srcs = ["key_corrector_test.cc"], | |
718 | deps = [ | |
719 | ":key_corrector", | |
720 | "//base", | |
721 | "//base:port", | |
722 | "//testing:gunit_main", | |
723 | ], | |
724 | ) | |
725 | ||
726 | cc_library_mozc( | |
727 | name = "converter_mock", | |
728 | testonly = 1, | |
729 | srcs = [ | |
730 | "converter_mock.cc", | |
731 | ], | |
732 | hdrs = ["converter_mock.h"], | |
733 | deps = [ | |
734 | ":converter_interface", | |
735 | ":segments", | |
736 | "//base", | |
737 | "//base:logging", | |
738 | "//base:port", | |
739 | "//request:conversion_request", | |
740 | ], | |
741 | ) | |
742 | ||
743 | cc_test_mozc( | |
744 | name = "converter_mock_test", | |
745 | size = "small", | |
746 | srcs = ["converter_mock_test.cc"], | |
747 | deps = [ | |
748 | ":converter_mock", | |
749 | ":segments", | |
750 | "//base", | |
751 | "//request:conversion_request", | |
752 | "//testing:googletest", | |
753 | "//testing:gunit_main", | |
754 | ], | |
755 | ) | |
756 | ||
757 | py_library_mozc( | |
758 | name = "gen_quality_regression_test_data_lib", | |
759 | srcs = ["gen_quality_regression_test_data.py"], | |
760 | ) | |
761 | ||
762 | py_binary_mozc( | |
763 | name = "gen_quality_regression_test_data", | |
764 | srcs = ["gen_quality_regression_test_data.py"], | |
765 | deps = [":gen_quality_regression_test_data_lib"], | |
766 | ) | |
767 | ||
768 | cc_library_mozc( | |
769 | name = "quality_regression_util", | |
770 | srcs = ["quality_regression_util.cc"], | |
771 | hdrs = ["quality_regression_util.h"], | |
772 | deps = [ | |
773 | ":converter_interface", | |
774 | ":segments", | |
775 | "//base", | |
776 | "//base:file_stream", | |
777 | "//base:logging", | |
778 | "//base:port", | |
779 | "//base:text_normalizer", | |
780 | "//base:util", | |
781 | "//composer", | |
782 | "//composer:table", | |
783 | "//protocol:commands_proto", | |
784 | "//protocol:config_proto", | |
785 | "//request:conversion_request", | |
786 | "@com_google_absl//absl/strings", | |
787 | ], | |
788 | ) | |
789 | ||
790 | cc_binary_mozc( | |
791 | name = "quality_regression_main", | |
792 | srcs = ["quality_regression_main.cc"], | |
793 | deps = [ | |
794 | ":quality_regression_util", | |
795 | "//base", | |
796 | "//base:flags", | |
797 | "//base:init_mozc", | |
798 | "//base:util", | |
799 | "//engine:engine_factory", | |
800 | "//engine:engine_interface", | |
801 | ], | |
802 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_test_mozc", | |
33 | ) | |
34 | ||
35 | def quality_regression_test(name, src, deps, **kwargs): | |
36 | native.genrule( | |
37 | name = name + "@data", | |
38 | srcs = [src], | |
39 | outs = [name + ".cc"], | |
40 | cmd = "$(location //converter:gen_quality_regression_test_data) $< > $@", | |
41 | tools = ["//converter:gen_quality_regression_test_data"], | |
42 | ) | |
43 | ||
44 | cc_test_mozc( | |
45 | name = name, | |
46 | srcs = [ | |
47 | "quality_regression_test.cc", | |
48 | name + "@data", | |
49 | ], | |
50 | data = [ | |
51 | "//data_manager/android:mozc.data", | |
52 | "//data_manager/chromeos:zipped_data_chromeos", | |
53 | "//data_manager/google:mozc.data", | |
54 | "//data_manager/oss:mozc.data", | |
55 | "//dictionary:pos_matcher_lib", | |
56 | ], | |
57 | deps = deps, | |
58 | size = "large", | |
59 | **kwargs | |
60 | ) | |
61 | ||
62 | def quality_regression_tests(name, srcs, deps, **kwargs): | |
63 | for src in srcs: | |
64 | quality_regression_test( | |
65 | "%s@%s" % (name, src.rsplit(":", 1)[1]), | |
66 | src, | |
67 | deps, | |
68 | **kwargs | |
69 | ) | |
70 | ||
71 | native.test_suite( | |
72 | name = name, | |
73 | tests = ["%s@%s" % (name, src.rsplit(":", 1)[1]) for src in srcs], | |
74 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files(["keyboard_layout_japanese109a.kcm"]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files([ | |
31 | "domain.txt", | |
32 | "era.txt", | |
33 | ]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | package(default_visibility = ["//:__subpackages__"]) | |
31 | ||
32 | exports_files([ | |
33 | "collocation.txt", | |
34 | "collocation_suppression.txt", | |
35 | "connection.deflate", | |
36 | "dictionary00.txt", | |
37 | "dictionary01.txt", | |
38 | "dictionary02.txt", | |
39 | "dictionary03.txt", | |
40 | "dictionary04.txt", | |
41 | "dictionary05.txt", | |
42 | "dictionary06.txt", | |
43 | "dictionary07.txt", | |
44 | "dictionary08.txt", | |
45 | "dictionary09.txt", | |
46 | "id.def", | |
47 | "reading_correction.tsv", | |
48 | "suffix.txt", | |
49 | "suggestion_filter.txt", | |
50 | ]) | |
51 | ||
52 | filegroup( | |
53 | name = "dictionary_data", | |
54 | srcs = [ | |
55 | ":dictionary00.txt", | |
56 | ":dictionary01.txt", | |
57 | ":dictionary02.txt", | |
58 | ":dictionary03.txt", | |
59 | ":dictionary04.txt", | |
60 | ":dictionary05.txt", | |
61 | ":dictionary06.txt", | |
62 | ":dictionary07.txt", | |
63 | ":dictionary08.txt", | |
64 | ":dictionary09.txt", | |
65 | ], | |
66 | ) | |
67 | ||
68 | filegroup( | |
69 | name = "dictionary", | |
70 | srcs = [ | |
71 | ":connection.deflate", | |
72 | ":dictionary00.txt", | |
73 | ":dictionary01.txt", | |
74 | ":dictionary02.txt", | |
75 | ":dictionary03.txt", | |
76 | ":dictionary04.txt", | |
77 | ":dictionary05.txt", | |
78 | ":dictionary06.txt", | |
79 | ":dictionary07.txt", | |
80 | ":dictionary08.txt", | |
81 | ":dictionary09.txt", | |
82 | ":suffix.txt", | |
83 | ], | |
84 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files(["emoji_data.tsv"]) | |
31 | ||
32 | py_binary( | |
33 | name = "filter", | |
34 | srcs = ["filter.py"], | |
35 | python_version = "PY2", | |
36 | visibility = [ | |
37 | ], | |
38 | deps = ["//build_tools:code_generator_util"], | |
39 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files([ | |
31 | "emoticon.tsv", | |
32 | "categorized.tsv", | |
33 | ]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files(["product_icon_32bpp-128.png"]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files(glob(["*"])) | |
31 | ||
32 | genrule( | |
33 | name = "android_asset_licenses", | |
34 | srcs = ["credits_en.html"], | |
35 | outs = ["assets/licenses.html"], | |
36 | cmd = "cp $< $@", | |
37 | visibility = [ | |
38 | ], | |
39 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files([ | |
31 | "atok.tsv", | |
32 | "ms-ime.tsv", | |
33 | "kotoeri.tsv", | |
34 | "mobile.tsv", | |
35 | "chromeos.tsv", | |
36 | ]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | filegroup( | |
31 | name = "composition_table", | |
32 | srcs = [ | |
33 | "12keys-halfwidthascii.tsv", | |
34 | "12keys-hiragana.tsv", | |
35 | "12keys-hiragana_intuitive.tsv", | |
36 | "flick-halfwidthascii.tsv", | |
37 | "flick-halfwidthascii_ios.tsv", | |
38 | "flick-hiragana.tsv", | |
39 | "flick-hiragana_intuitive.tsv", | |
40 | "flick-number.tsv", | |
41 | "godan-hiragana.tsv", | |
42 | "hiragana-romanji.tsv", | |
43 | "kana.tsv", | |
44 | "notouch-hiragana.tsv", | |
45 | "qwerty_mobile-halfwidthascii.tsv", | |
46 | "qwerty_mobile-hiragana.tsv", | |
47 | "romanji-hiragana.tsv", | |
48 | "toggle_flick-halfwidthascii.tsv", | |
49 | "toggle_flick-halfwidthascii_ios.tsv", | |
50 | "toggle_flick-hiragana.tsv", | |
51 | "toggle_flick-hiragana_intuitive.tsv", | |
52 | "toggle_flick-number.tsv", | |
53 | ], | |
54 | visibility = ["//base:__pkg__"], | |
55 | ) | |
56 | ||
57 | exports_files(glob(["*.tsv"])) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | package(default_visibility = [ | |
31 | "//:__subpackages__", | |
32 | ]) | |
33 | ||
34 | exports_files([ | |
35 | "boundary.def", | |
36 | "cforms.def", | |
37 | "pos_matcher_rule.def", | |
38 | "rewrite.def", | |
39 | "segmenter.def", | |
40 | "sorting_map.tsv", | |
41 | "special_pos.def", | |
42 | "third_party_pos_map.def", | |
43 | "user_pos.def", | |
44 | "user_segment_history_pos_group.def", | |
45 | ]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files([ | |
31 | "single_kanji.tsv", | |
32 | "variant_rule.txt", | |
33 | ]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files([ | |
31 | "categorized.tsv", | |
32 | "ordering_rule.txt", | |
33 | "symbol.tsv", | |
34 | ]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files(["testset.txt"]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files(["character_set.tsv"]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | filegroup( | |
31 | name = "config_test_data", | |
32 | srcs = glob(["*config1.db"]), | |
33 | visibility = ["//visibility:public"], | |
34 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | package(default_visibility = ["//:__subpackages__"]) | |
31 | ||
32 | exports_files([ | |
33 | "collocation.txt", | |
34 | "collocation_suppression.txt", | |
35 | "connection.deflate", | |
36 | "dictionary.txt", | |
37 | "id.def", | |
38 | "reading_correction.tsv", | |
39 | "suffix.txt", | |
40 | "suggestion_filter.txt", | |
41 | ]) | |
42 | ||
43 | filegroup( | |
44 | name = "dictionary", | |
45 | srcs = [ | |
46 | ":connection.deflate", | |
47 | ":dictionary.txt", | |
48 | ":suffix.txt", | |
49 | ], | |
50 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # Description: files of scenario test for Mozc. | |
31 | ||
32 | # Export all .txt files to mozc/session package for the scenario test. | |
33 | filegroup( | |
34 | name = "scenario_files", | |
35 | srcs = glob(["*.txt"]), | |
36 | visibility = ["//session:__pkg__"], | |
37 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # Description: files of usage stats related scenario test for Mozc. | |
31 | ||
32 | exports_files(glob(["*.txt"])) | |
33 | ||
34 | filegroup( | |
35 | name = "usage_stats_scenario_files", | |
36 | srcs = glob(["*.txt"]), | |
37 | visibility = ["//session:__pkg__"], | |
38 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files(glob(["*.tsv"])) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files([ | |
31 | "CP932.TXT", | |
32 | "JIS0201.TXT", | |
33 | "JIS0208.TXT", | |
34 | "JIS0212.TXT", | |
35 | "jisx0213-2004-std.txt", | |
36 | "Unihan.txt", | |
37 | ]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | exports_files(["stats.def"]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # Description: Version configuration for Google Japanese Input | |
31 | ||
32 | exports_files( | |
33 | ["mozc_version_template.bzl"], | |
34 | visibility = [ | |
35 | "//base:__pkg__", | |
36 | "//data_manager:__subpackages__", | |
37 | "//tools/release:__pkg__", | |
38 | ], | |
39 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | package(default_visibility = ["//:__subpackages__"]) | |
31 | ||
32 | exports_files([ | |
33 | "zero_query.def", | |
34 | "zero_query_number.def", | |
35 | ]) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | "py_binary_mozc", | |
36 | "py_library_mozc", | |
37 | "select_mozc", | |
38 | ) | |
39 | load("//tools/build_defs:stubs.bzl", "portable_proto_library") | |
40 | ||
41 | package(default_visibility = ["//visibility:public"]) | |
42 | ||
43 | cc_library_mozc( | |
44 | name = "data_manager_interface", | |
45 | hdrs = ["data_manager_interface.h"], | |
46 | deps = [ | |
47 | "//base:port", | |
48 | "@com_google_absl//absl/strings", | |
49 | ], | |
50 | ) | |
51 | ||
52 | cc_library_mozc( | |
53 | name = "data_manager", | |
54 | srcs = [ | |
55 | "data_manager.cc", | |
56 | ], | |
57 | hdrs = ["data_manager.h"], | |
58 | deps = [ | |
59 | ":data_manager_interface", | |
60 | ":dataset_reader", | |
61 | ":serialized_dictionary", | |
62 | "//base:logging", | |
63 | "//base:mmap", | |
64 | "//base:port", | |
65 | "//base:serialized_string_array", | |
66 | "//base:stl_util", | |
67 | "//base:util", | |
68 | "//base:version", | |
69 | "//dictionary:pos_matcher_lib", | |
70 | "//protocol:segmenter_data_proto", | |
71 | "@com_google_absl//absl/strings", | |
72 | ], | |
73 | ) | |
74 | ||
75 | cc_library_mozc( | |
76 | name = "data_manager_test_base", | |
77 | testonly = 1, | |
78 | srcs = [ | |
79 | "data_manager_test_base.cc", | |
80 | ], | |
81 | hdrs = ["data_manager_test_base.h"], | |
82 | deps = [ | |
83 | ":connection_file_reader", | |
84 | ":data_manager_interface", | |
85 | "//base", | |
86 | "//base:file_stream", | |
87 | "//base:file_util", | |
88 | "//base:logging", | |
89 | "//base:mozc_hash_set", | |
90 | "//base:port", | |
91 | "//base:serialized_string_array", | |
92 | "//base:util", | |
93 | "//converter:connector", | |
94 | "//converter:node", | |
95 | "//converter:segmenter", | |
96 | "//dictionary:pos_matcher_lib", | |
97 | "//prediction:suggestion_filter", | |
98 | "//testing", | |
99 | "@com_google_absl//absl/strings", | |
100 | ], | |
101 | ) | |
102 | ||
103 | py_library_mozc( | |
104 | name = "gen_connection_data_lib", | |
105 | srcs = ["gen_connection_data.py"], | |
106 | deps = [ | |
107 | "//build_tools:code_generator_util", | |
108 | ], | |
109 | ) | |
110 | ||
111 | py_binary_mozc( | |
112 | name = "gen_connection_data", | |
113 | srcs = ["gen_connection_data.py"], | |
114 | deps = [ | |
115 | ":gen_connection_data_lib", | |
116 | "//build_tools:code_generator_util", | |
117 | ], | |
118 | ) | |
119 | ||
120 | cc_library_mozc( | |
121 | name = "connection_file_reader", | |
122 | srcs = ["connection_file_reader.cc"], | |
123 | hdrs = ["connection_file_reader.h"], | |
124 | deps = [ | |
125 | "//base", | |
126 | "//base:file_stream", | |
127 | "//base:logging", | |
128 | "//base:number_util", | |
129 | "//base:port", | |
130 | ], | |
131 | ) | |
132 | ||
133 | proto_library( | |
134 | name = "dataset_proto_full", | |
135 | srcs = ["dataset.proto"], | |
136 | visibility = ["//visibility:private"], | |
137 | ) | |
138 | ||
139 | portable_proto_library( | |
140 | name = "dataset_proto", | |
141 | config = "//protocol:portable_proto.pbtxt", | |
142 | header_outs = ["dataset.pb.h"], | |
143 | proto_deps = [":dataset_proto_full"], | |
144 | visibility = ["//visibility:private"], | |
145 | ) | |
146 | ||
147 | cc_library_mozc( | |
148 | name = "dataset_writer", | |
149 | srcs = ["dataset_writer.cc"], | |
150 | hdrs = ["dataset_writer.h"], | |
151 | deps = [ | |
152 | ":dataset_proto", | |
153 | "//base:file_stream", | |
154 | "//base:logging", | |
155 | "//base:obfuscator_support", | |
156 | "//base:port", | |
157 | "//base:util", | |
158 | "@com_google_absl//absl/strings", | |
159 | ], | |
160 | ) | |
161 | ||
162 | cc_test_mozc( | |
163 | name = "dataset_writer_test", | |
164 | srcs = ["dataset_writer_test.cc"], | |
165 | deps = [ | |
166 | ":dataset_proto", | |
167 | ":dataset_writer", | |
168 | "//base:file_stream", | |
169 | "//base:file_util", | |
170 | "//base:obfuscator_support", | |
171 | "//base:util", | |
172 | "//testing:googletest", | |
173 | "//testing:gunit_main", | |
174 | "//testing:mozctest", | |
175 | ], | |
176 | ) | |
177 | ||
178 | cc_binary_mozc( | |
179 | name = "dataset_writer_main", | |
180 | srcs = ["dataset_writer_main.cc"], | |
181 | deps = [ | |
182 | ":dataset_writer", | |
183 | "//base", | |
184 | "//base:file_stream", | |
185 | "//base:file_util", | |
186 | "//base:flags", | |
187 | "//base:init_mozc_buildtool", | |
188 | "//base:logging", | |
189 | "//base:number_util", | |
190 | "//base:util", | |
191 | ], | |
192 | ) | |
193 | ||
194 | cc_library_mozc( | |
195 | name = "dataset_reader", | |
196 | srcs = ["dataset_reader.cc"], | |
197 | hdrs = ["dataset_reader.h"], | |
198 | deps = [ | |
199 | ":dataset_proto", | |
200 | "//base:logging", | |
201 | "//base:obfuscator_support", | |
202 | "//base:port", | |
203 | "//base:util", | |
204 | "@com_google_absl//absl/strings", | |
205 | ], | |
206 | ) | |
207 | ||
208 | cc_test_mozc( | |
209 | name = "dataset_reader_test", | |
210 | srcs = ["dataset_reader_test.cc"], | |
211 | deps = [ | |
212 | ":dataset_reader", | |
213 | ":dataset_writer", | |
214 | "//base:port", | |
215 | "//base:util", | |
216 | "//testing:gunit_main", | |
217 | "@com_google_absl//absl/strings", | |
218 | ], | |
219 | ) | |
220 | ||
221 | py_library_mozc( | |
222 | name = "gen_data_version_lib", | |
223 | srcs = ["gen_data_version.py"], | |
224 | visibility = ["//visibility:private"], | |
225 | ) | |
226 | ||
227 | py_binary_mozc( | |
228 | name = "gen_data_version", | |
229 | srcs = ["gen_data_version.py"], | |
230 | visibility = ["//data_manager:__subpackages__"], | |
231 | deps = [":gen_data_version_lib"], | |
232 | ) | |
233 | ||
234 | cc_library_mozc( | |
235 | name = "serialized_dictionary", | |
236 | srcs = ["serialized_dictionary.cc"], | |
237 | hdrs = ["serialized_dictionary.h"], | |
238 | deps = [ | |
239 | "//base:file_stream", | |
240 | "//base:logging", | |
241 | "//base:number_util", | |
242 | "//base:port", | |
243 | "//base:serialized_string_array", | |
244 | "//base:util", | |
245 | "@com_google_absl//absl/strings", | |
246 | ], | |
247 | ) | |
248 | ||
249 | cc_test_mozc( | |
250 | name = "serialized_dictionary_test", | |
251 | srcs = ["serialized_dictionary_test.cc"], | |
252 | deps = [ | |
253 | ":serialized_dictionary", | |
254 | "//base:port", | |
255 | "//base:serialized_string_array", | |
256 | "//testing:gunit_main", | |
257 | "@com_google_absl//absl/strings", | |
258 | ], | |
259 | ) | |
260 | ||
261 | cc_library_mozc( | |
262 | name = "pos_list_provider", | |
263 | srcs = ["pos_list_provider.cc"], | |
264 | hdrs = ["pos_list_provider.h"], | |
265 | textual_hdrs = select_mozc( | |
266 | android = ["//data_manager/android:pos_list.h"], | |
267 | client = ["//data_manager/google:pos_list.h"], | |
268 | default = [], | |
269 | nacl = ["//data_manager/chromeos:pos_list.h"], | |
270 | oss = ["//data_manager/oss:pos_list.h"], | |
271 | ), | |
272 | deps = [ | |
273 | "//base:embedded_file", | |
274 | "//base:logging", | |
275 | "//base:serialized_string_array", | |
276 | "//dictionary:user_pos_interface", | |
277 | ], | |
278 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # Macro for Mozc data set. | |
31 | ||
32 | # This macro defines a set of genrules each of which has name "name + @xxx", | |
33 | # where xxx is listed below: | |
34 | # - No suffix (i.e., "name" is target name): Main binary file of the data | |
35 | # - header: Embedded file (to be included in C++) of the data set file | |
36 | # - collocation: Collocation data | |
37 | # - collocation_suppression: Collocation suppression data | |
38 | # - connection: Connection matrix data | |
39 | # - connection_single_column: Connection data in text format | |
40 | # - dictionary: System dictionary data | |
41 | # - suggestion_filter: Suggestion filter data | |
42 | # - pos_group: POS group data | |
43 | # - boundary: Boundary data | |
44 | # - segmenter_inl_header: C++ header to be included in segmenter_generator. | |
45 | # - segmenter_generator: C++ binary generating segmenter data files. | |
46 | # - segmenter: Data files for segmenter. | |
47 | # - counter_suffix: Counter suffix sorted array. | |
48 | # - suffix: Suffix dictionary data. | |
49 | # - reading_correction: Reading correction arrays. | |
50 | # - symbol: Symbol dictionary data. | |
51 | # - usage: [Optional] Usage dictionary data. Available only if usage_dict is | |
52 | # provided. | |
53 | # - user_pos: User POS data. | |
54 | # - user_pos_manager_data: User POS manager data. | |
55 | # - pos_matcher: POS matcher data. | |
56 | # - emoticon_src: Emoticon data | |
57 | # - emoticon_categorized_src: Categorized emoticon data | |
58 | # - single_kanji: Single Kanji dictionary and variant data | |
59 | # - single_kanji_noun_prefix: Single Kanji noun prefix data | |
60 | # - zero_query_def: Zero query definition file | |
61 | # - zero_query_number_def: Zero query number definition file | |
62 | # For usage, see //data_manager/google/BUILD. | |
63 | def mozc_dataset( | |
64 | name, | |
65 | outs, | |
66 | boundary_def, | |
67 | cforms, | |
68 | collocation_src, | |
69 | collocation_suppression_src, | |
70 | connection_deflate, | |
71 | dictionary_srcs, | |
72 | emoji_src, | |
73 | emoticon_categorized_src, | |
74 | emoticon_src, | |
75 | id_def, | |
76 | magic, | |
77 | pos_group_def, | |
78 | pos_matcher_rule_def, | |
79 | reading_correction_src, | |
80 | segmenter_def, | |
81 | segmenter_generator_src, | |
82 | single_kanji_src, | |
83 | sorting_map, | |
84 | special_pos, | |
85 | suffix, | |
86 | suggestion_filter_src, | |
87 | symbol_ordering_rule, | |
88 | symbol_src, | |
89 | tag, | |
90 | use_1byte_cost, | |
91 | user_pos_def, | |
92 | variant_rule, | |
93 | varname, | |
94 | zero_query_def, | |
95 | zero_query_number_def, | |
96 | typing_models = [], | |
97 | usage_dict = None): | |
98 | sources = [ | |
99 | ":" + name + "@user_pos", | |
100 | ":" + name + "@pos_matcher", | |
101 | ":" + name + "@collocation", | |
102 | ":" + name + "@collocation_suppression", | |
103 | ":" + name + "@connection", | |
104 | ":" + name + "@dictionary", | |
105 | ":" + name + "@suggestion_filter", | |
106 | ":" + name + "@pos_group", | |
107 | ":" + name + "@boundary", | |
108 | ":" + name + "@segmenter", | |
109 | ":" + name + "@counter_suffix", | |
110 | ":" + name + "@suffix", | |
111 | ":" + name + "@reading_correction", | |
112 | ":" + name + "@symbol", | |
113 | ":" + name + "@emoticon", | |
114 | ":" + name + "@emoji", | |
115 | ":" + name + "@single_kanji", | |
116 | ":" + name + "@single_kanji_noun_prefix", | |
117 | ":" + name + "@zero_query", | |
118 | ":" + name + "@zero_query_number", | |
119 | ":" + name + "@version", | |
120 | ] | |
121 | arguments = ( | |
122 | # TODO(noriyukit): Rename keys to more descriptive names. | |
123 | "pos_matcher:32:$(@D)/pos_matcher.data " + | |
124 | "user_pos_token:32:$(@D)/user_pos_token_array.data " + | |
125 | "user_pos_string:32:$(@D)/user_pos_string_array.data " + | |
126 | "coll:32:$(location :" + name + "@collocation) " + | |
127 | "cols:32:$(location :" + name + "@collocation_suppression) " + | |
128 | "conn:32:$(location :" + name + "@connection) " + | |
129 | "dict:32:$(location :" + name + "@dictionary) " + | |
130 | "sugg:32:$(location :" + name + "@suggestion_filter) " + | |
131 | "posg:32:$(location :" + name + "@pos_group) " + | |
132 | "bdry:32:$(location :" + name + "@boundary) " + | |
133 | "segmenter_sizeinfo:32:$(@D)/segmenter_sizeinfo.data " + | |
134 | "segmenter_ltable:32:$(@D)/segmenter_ltable.data " + | |
135 | "segmenter_rtable:32:$(@D)/segmenter_rtable.data " + | |
136 | "segmenter_bitarray:32:$(@D)/segmenter_bitarray.data " + | |
137 | "counter_suffix:32:$(location :" + name + "@counter_suffix) " + | |
138 | "suffix_key:32:$(@D)/suffix_key.data " + | |
139 | "suffix_value:32:$(@D)/suffix_value.data " + | |
140 | "suffix_token:32:$(@D)/suffix_token.data " + | |
141 | "reading_correction_value:32:$(@D)/reading_correction_value.data " + | |
142 | "reading_correction_error:32:$(@D)/reading_correction_error.data " + | |
143 | "reading_correction_correction:32:$(@D)/reading_correction_correction.data " + | |
144 | "symbol_token:32:$(@D)/symbol_token.data " + | |
145 | "symbol_string:32:$(@D)/symbol_string.data " + | |
146 | "emoticon_token:32:$(@D)/emoticon_token.data " + | |
147 | "emoticon_string:32:$(@D)/emoticon_string.data " + | |
148 | "emoji_token:32:$(@D)/emoji_token.data " + | |
149 | "emoji_string:32:$(@D)/emoji_string.data " + | |
150 | "single_kanji_token:32:$(@D)/single_kanji_token.data " + | |
151 | "single_kanji_string:32:$(@D)/single_kanji_string.data " + | |
152 | "single_kanji_variant_type:32:$(@D)/single_kanji_variant_type.data " + | |
153 | "single_kanji_variant_token:32:$(@D)/single_kanji_variant_token.data " + | |
154 | "single_kanji_variant_string:32:$(@D)/single_kanji_variant_string.data " + | |
155 | "single_kanji_noun_prefix_token:32:$(@D)/single_kanji_noun_prefix_token.data " + | |
156 | "single_kanji_noun_prefix_string:32:$(@D)/single_kanji_noun_prefix_string.data " + | |
157 | "zero_query_token_array:32:$(@D)/zero_query_token.data " + | |
158 | "zero_query_string_array:32:$(@D)/zero_query_string.data " + | |
159 | "zero_query_number_token_array:32:$(@D)/zero_query_number_token.data " + | |
160 | "zero_query_number_string_array:32:$(@D)/zero_query_number_string.data " + | |
161 | "version:32:$(location :" + name + "@version) " | |
162 | ) | |
163 | for model_file in typing_models: | |
164 | filename = Label(model_file).name | |
165 | sources += [":" + name + "@" + filename] | |
166 | arguments += "%s:32:$(@D)/%s " % (filename, filename + ".data") | |
167 | if usage_dict: | |
168 | sources += [":" + name + "@usage"] | |
169 | arguments += ( | |
170 | "usage_base_conjugation_suffix:32:$(@D)/usage_base_conj_suffix.data " + | |
171 | "usage_conjugation_suffix:32:$(@D)/usage_conj_suffix.data " + | |
172 | "usage_conjugation_index:32:$(@D)/usage_conj_index.data " + | |
173 | "usage_item_array:32:$(@D)/usage_item_array.data " + | |
174 | "usage_string_array:32:$(@D)/usage_string_array.data " | |
175 | ) | |
176 | native.genrule( | |
177 | name = name, | |
178 | srcs = sources, | |
179 | outs = [outs[0]], | |
180 | cmd = ( | |
181 | "$(location //data_manager:dataset_writer_main) " + | |
182 | "--magic='" + magic + "' --output=$@ " + arguments | |
183 | ), | |
184 | tools = ["//data_manager:dataset_writer_main"], | |
185 | ) | |
186 | ||
187 | native.genrule( | |
188 | name = name + "@header", | |
189 | srcs = [":" + name], | |
190 | outs = [outs[1]], | |
191 | cmd = ( | |
192 | "$(location //build_tools:embed_file) " + | |
193 | "--input=$< --name=" + varname + " --output=$@" | |
194 | ), | |
195 | exec_tools = ["//build_tools:embed_file"], | |
196 | ) | |
197 | ||
198 | native.genrule( | |
199 | name = name + "@user_pos_manager_data", | |
200 | srcs = [ | |
201 | ":" + name + "@user_pos", | |
202 | ":" + name + "@pos_matcher", | |
203 | ], | |
204 | outs = ["user_pos_manager.data"], | |
205 | cmd = ( | |
206 | "$(location //data_manager:dataset_writer_main) " + | |
207 | "--output=$@ " + | |
208 | "pos_matcher:32:$(@D)/pos_matcher.data " + | |
209 | "user_pos_token:32:$(@D)/user_pos_token_array.data " + | |
210 | "user_pos_string:32:$(@D)/user_pos_string_array.data " | |
211 | ), | |
212 | tools = ["//data_manager:dataset_writer_main"], | |
213 | ) | |
214 | ||
215 | native.genrule( | |
216 | name = name + "@user_pos", | |
217 | srcs = [ | |
218 | cforms, | |
219 | id_def, | |
220 | special_pos, | |
221 | user_pos_def, | |
222 | ], | |
223 | outs = [ | |
224 | "user_pos_token_array.data", | |
225 | "user_pos_string_array.data", | |
226 | "pos_list.data", | |
227 | ], | |
228 | cmd = ( | |
229 | "$(location //dictionary:gen_user_pos_data) " + | |
230 | "--id_file=$(location " + id_def + ") " + | |
231 | "--special_pos_file=$(location " + special_pos + ") " + | |
232 | "--user_pos_file=$(location " + user_pos_def + ") " + | |
233 | "--cforms_file=$(location " + cforms + ") " + | |
234 | "--output_token_array=$(location :user_pos_token_array.data) " + | |
235 | "--output_string_array=$(location :user_pos_string_array.data) " + | |
236 | "--output_pos_list=$(location :pos_list.data)" | |
237 | ), | |
238 | tools = ["//dictionary:gen_user_pos_data"], | |
239 | ) | |
240 | ||
241 | native.genrule( | |
242 | name = name + "@pos_list_header", | |
243 | srcs = [":" + name + "@user_pos"], | |
244 | outs = [outs[2]], | |
245 | cmd = ( | |
246 | "$(location //build_tools:embed_file) " + | |
247 | "--input=$(@D)/pos_list.data --name=kPosArray --output=$@" | |
248 | ), | |
249 | exec_tools = ["//build_tools:embed_file"], | |
250 | ) | |
251 | ||
252 | native.genrule( | |
253 | name = name + "@pos_matcher", | |
254 | srcs = [ | |
255 | id_def, | |
256 | special_pos, | |
257 | pos_matcher_rule_def, | |
258 | ], | |
259 | outs = [ | |
260 | "pos_matcher.data", | |
261 | ], | |
262 | cmd = ( | |
263 | "$(location //dictionary:gen_pos_matcher_code) " + | |
264 | "--id_file=$(location " + id_def + ") " + | |
265 | "--special_pos_file=$(location " + special_pos + ") " + | |
266 | "--pos_matcher_rule_file=$(location " + pos_matcher_rule_def + ") " + | |
267 | "--output_pos_matcher_data=$@" | |
268 | ), | |
269 | tools = ["//dictionary:gen_pos_matcher_code"], | |
270 | ) | |
271 | ||
272 | native.genrule( | |
273 | name = name + "@collocation", | |
274 | srcs = [collocation_src], | |
275 | outs = ["collocation.data"], | |
276 | cmd = ( | |
277 | "$(location //rewriter:gen_collocation_data_main) " + | |
278 | "--collocation_data=$< --output=$@ --binary_mode" | |
279 | ), | |
280 | tools = ["//rewriter:gen_collocation_data_main"], | |
281 | ) | |
282 | ||
283 | native.genrule( | |
284 | name = name + "@collocation_suppression", | |
285 | srcs = [collocation_suppression_src], | |
286 | outs = ["collocation_suppression.data"], | |
287 | cmd = ( | |
288 | "$(location //rewriter:gen_collocation_suppression_data_main) " + | |
289 | "--suppression_data=$< --output=$@ --binary_mode" | |
290 | ), | |
291 | tools = ["//rewriter:gen_collocation_suppression_data_main"], | |
292 | ) | |
293 | ||
294 | native.genrule( | |
295 | name = name + "@connection_single_column", | |
296 | srcs = [connection_deflate], | |
297 | outs = ["connection_single_column.txt"], | |
298 | cmd = ( | |
299 | "$(location //build_tools:zlib_util) " + | |
300 | "decompress $< $@" | |
301 | ), | |
302 | tools = ["//build_tools:zlib_util"], | |
303 | ) | |
304 | ||
305 | native.genrule( | |
306 | name = name + "@connection", | |
307 | srcs = [ | |
308 | name + "@connection_single_column", | |
309 | id_def, | |
310 | special_pos, | |
311 | ], | |
312 | outs = ["connection.data"], | |
313 | cmd = ( | |
314 | "$(location //data_manager:gen_connection_data) " + | |
315 | "--text_connection_file=" + | |
316 | "$(location :" + name + "@connection_single_column) " + | |
317 | "--id_file=$(location " + id_def + ") " + | |
318 | "--special_pos_file=$(location " + special_pos + ") " + | |
319 | "--binary_output_file=$@ " + | |
320 | "--use_1byte_cost=" + use_1byte_cost | |
321 | ), | |
322 | tools = ["//data_manager:gen_connection_data"], | |
323 | ) | |
324 | ||
325 | native.genrule( | |
326 | name = name + "@dictionary", | |
327 | srcs = dictionary_srcs + [":" + name + "@user_pos_manager_data"], | |
328 | outs = ["dictionary.data"], | |
329 | cmd = ( | |
330 | "$(location //dictionary:gen_system_dictionary_data_main) " + | |
331 | "--input=\"" + " ".join(["$(location %s)" % s for s in dictionary_srcs]) + "\" " + | |
332 | "--user_pos_manager_data=$(location :" + name + "@user_pos_manager_data) " + | |
333 | "--output=$@" | |
334 | ), | |
335 | tools = ["//dictionary:gen_system_dictionary_data_main"], | |
336 | ) | |
337 | ||
338 | native.genrule( | |
339 | name = name + "@suggestion_filter", | |
340 | srcs = [suggestion_filter_src], | |
341 | outs = ["suggestion_filter.data"], | |
342 | cmd = ( | |
343 | "$(location //prediction:gen_suggestion_filter_main) " + | |
344 | "--input=$< --output=$@ --header=false" | |
345 | ), | |
346 | tools = ["//prediction:gen_suggestion_filter_main"], | |
347 | ) | |
348 | ||
349 | native.genrule( | |
350 | name = name + "@pos_group", | |
351 | srcs = [ | |
352 | id_def, | |
353 | special_pos, | |
354 | pos_group_def, | |
355 | ], | |
356 | outs = ["pos_group.data"], | |
357 | cmd = ( | |
358 | "$(location //dictionary:gen_pos_rewrite_rule) " + | |
359 | "--id_def=$(location " + id_def + ") " + | |
360 | "--special_pos=$(location " + special_pos + ") " + | |
361 | "--pos_group_def=$(location " + pos_group_def + ") " + | |
362 | "--output=$@" | |
363 | ), | |
364 | tools = ["//dictionary:gen_pos_rewrite_rule"], | |
365 | ) | |
366 | ||
367 | native.genrule( | |
368 | name = name + "@boundary", | |
369 | srcs = [ | |
370 | boundary_def, | |
371 | id_def, | |
372 | special_pos, | |
373 | ], | |
374 | outs = ["boundary.data"], | |
375 | cmd = ( | |
376 | "$(location //converter:gen_boundary_data) " + | |
377 | "--boundary_def=$(location " + boundary_def + ") " + | |
378 | "--id_def=$(location " + id_def + ") " + | |
379 | "--special_pos=$(location " + special_pos + ") " + | |
380 | "--output=$@" | |
381 | ), | |
382 | tools = ["//converter:gen_boundary_data"], | |
383 | ) | |
384 | ||
385 | native.genrule( | |
386 | name = name + "@segmenter_inl_header", | |
387 | srcs = [ | |
388 | id_def, | |
389 | special_pos, | |
390 | segmenter_def, | |
391 | ], | |
392 | outs = ["segmenter_inl.inc"], | |
393 | cmd = ("$(location //converter:gen_segmenter_code) $(SRCS) > $@"), | |
394 | tools = ["//converter:gen_segmenter_code"], | |
395 | ) | |
396 | ||
397 | native.cc_binary( | |
398 | name = name + "@segmenter_generator", | |
399 | srcs = [ | |
400 | segmenter_generator_src, | |
401 | ":" + name + "@segmenter_inl_header", | |
402 | ], | |
403 | copts = ["-Wno-parentheses"], | |
404 | deps = [ | |
405 | "//base", | |
406 | "//base:flags", | |
407 | "//base:init_mozc_buildtool", | |
408 | "//converter:gen_segmenter_bitarray", | |
409 | "//:macro", | |
410 | ], | |
411 | ) | |
412 | ||
413 | native.genrule( | |
414 | name = name + "@segmenter", | |
415 | outs = [ | |
416 | "segmenter_sizeinfo.data", | |
417 | "segmenter_ltable.data", | |
418 | "segmenter_rtable.data", | |
419 | "segmenter_bitarray.data", | |
420 | ], | |
421 | cmd = ( | |
422 | "$(location :" + name + "@segmenter_generator) " + | |
423 | "--output_size_info=$(@D)/segmenter_sizeinfo.data " + | |
424 | "--output_ltable=$(@D)/segmenter_ltable.data " + | |
425 | "--output_rtable=$(@D)/segmenter_rtable.data " + | |
426 | "--output_bitarray=$(@D)/segmenter_bitarray.data" | |
427 | ), | |
428 | tools = [":" + name + "@segmenter_generator"], | |
429 | ) | |
430 | ||
431 | native.genrule( | |
432 | name = name + "@counter_suffix", | |
433 | srcs = dictionary_srcs + [id_def], | |
434 | outs = ["counter_suffix.data"], | |
435 | cmd = ( | |
436 | "$(location //rewriter:gen_counter_suffix_array) " + | |
437 | "--id_file=$(location " + id_def + ") " + | |
438 | "--output=$@ " + | |
439 | " ".join(["$(location " + s + ")" for s in dictionary_srcs]) | |
440 | ), | |
441 | tools = ["//rewriter:gen_counter_suffix_array"], | |
442 | ) | |
443 | ||
444 | native.genrule( | |
445 | name = name + "@suffix", | |
446 | srcs = [suffix], | |
447 | outs = [ | |
448 | "suffix_key.data", | |
449 | "suffix_value.data", | |
450 | "suffix_token.data", | |
451 | ], | |
452 | cmd = ( | |
453 | "$(location //dictionary:gen_suffix_data) " + | |
454 | "--input=$< " + | |
455 | "--output_key_array=$(@D)/suffix_key.data " + | |
456 | "--output_value_array=$(@D)/suffix_value.data " + | |
457 | "--output_token_array=$(@D)/suffix_token.data" | |
458 | ), | |
459 | tools = ["//dictionary:gen_suffix_data"], | |
460 | ) | |
461 | ||
462 | native.genrule( | |
463 | name = name + "@reading_correction", | |
464 | srcs = [reading_correction_src], | |
465 | outs = [ | |
466 | "reading_correction_value.data", | |
467 | "reading_correction_error.data", | |
468 | "reading_correction_correction.data", | |
469 | ], | |
470 | cmd = ( | |
471 | "$(location //rewriter:gen_reading_correction_data) " + | |
472 | "--input=$< " + | |
473 | "--output_value_array=$(@D)/reading_correction_value.data " + | |
474 | "--output_error_array=$(@D)/reading_correction_error.data " + | |
475 | "--output_correction_array=$(@D)/reading_correction_correction.data" | |
476 | ), | |
477 | tools = ["//rewriter:gen_reading_correction_data"], | |
478 | ) | |
479 | ||
480 | native.genrule( | |
481 | name = name + "@symbol", | |
482 | srcs = [ | |
483 | symbol_src, | |
484 | symbol_ordering_rule, | |
485 | sorting_map, | |
486 | ":" + name + "@user_pos_manager_data", | |
487 | ], | |
488 | outs = [ | |
489 | "symbol_token.data", | |
490 | "symbol_string.data", | |
491 | ], | |
492 | cmd = ( | |
493 | "$(location //rewriter:gen_symbol_rewriter_dictionary_main) " + | |
494 | "--input=$(location " + symbol_src + ") " + | |
495 | "--user_pos_manager_data=$(location :" + name + "@user_pos_manager_data) " + | |
496 | "--sorting_table=$(location " + sorting_map + ") " + | |
497 | "--ordering_rule=$(location " + symbol_ordering_rule + ") " + | |
498 | "--output_token_array=$(location :symbol_token.data) " + | |
499 | "--output_string_array=$(location :symbol_string.data)" | |
500 | ), | |
501 | tools = ["//rewriter:gen_symbol_rewriter_dictionary_main"], | |
502 | ) | |
503 | ||
504 | native.genrule( | |
505 | name = name + "@emoticon", | |
506 | srcs = [emoticon_src], | |
507 | outs = [ | |
508 | "emoticon_token.data", | |
509 | "emoticon_string.data", | |
510 | ], | |
511 | cmd = ( | |
512 | "$(location //rewriter:gen_emoticon_rewriter_data) " + | |
513 | "--input=$< " + | |
514 | "--output_token_array=$(location :emoticon_token.data) " + | |
515 | "--output_string_array=$(location :emoticon_string.data)" | |
516 | ), | |
517 | tools = ["//rewriter:gen_emoticon_rewriter_data"], | |
518 | ) | |
519 | ||
520 | native.genrule( | |
521 | name = name + "@emoji", | |
522 | srcs = [emoji_src], | |
523 | outs = [ | |
524 | "emoji_token.data", | |
525 | "emoji_string.data", | |
526 | ], | |
527 | cmd = ( | |
528 | "$(location //rewriter:gen_emoji_rewriter_data) " + | |
529 | "--input=$< " + | |
530 | "--output_token_array=$(location :emoji_token.data) " + | |
531 | "--output_string_array=$(location :emoji_string.data)" | |
532 | ), | |
533 | tools = ["//rewriter:gen_emoji_rewriter_data"], | |
534 | ) | |
535 | ||
536 | native.genrule( | |
537 | name = name + "@single_kanji", | |
538 | srcs = [ | |
539 | single_kanji_src, | |
540 | variant_rule, | |
541 | ], | |
542 | outs = [ | |
543 | "single_kanji_string.data", | |
544 | "single_kanji_token.data", | |
545 | "single_kanji_variant_type.data", | |
546 | "single_kanji_variant_token.data", | |
547 | "single_kanji_variant_string.data", | |
548 | ], | |
549 | cmd = ( | |
550 | "$(location //rewriter:gen_single_kanji_rewriter_data) " + | |
551 | "--single_kanji_file=$(location " + single_kanji_src + ") " + | |
552 | "--variant_file=$(location " + variant_rule + ") " + | |
553 | "--output_single_kanji_token=$(location :single_kanji_token.data) " + | |
554 | "--output_single_kanji_string=$(location :single_kanji_string.data) " + | |
555 | "--output_variant_types=$(location :single_kanji_variant_type.data) " + | |
556 | "--output_variant_tokens=$(location :single_kanji_variant_token.data) " + | |
557 | "--output_variant_strings=$(location :single_kanji_variant_string.data) " | |
558 | ), | |
559 | tools = ["//rewriter:gen_single_kanji_rewriter_data"], | |
560 | ) | |
561 | ||
562 | native.genrule( | |
563 | name = name + "@single_kanji_noun_prefix", | |
564 | outs = [ | |
565 | "single_kanji_noun_prefix_token.data", | |
566 | "single_kanji_noun_prefix_string.data", | |
567 | ], | |
568 | cmd = ( | |
569 | "$(location //rewriter:gen_single_kanji_noun_prefix_data) " + | |
570 | "--output_token_array=$(location :single_kanji_noun_prefix_token.data) " + | |
571 | "--output_string_array=$(location :single_kanji_noun_prefix_string.data)" | |
572 | ), | |
573 | tools = ["//rewriter:gen_single_kanji_noun_prefix_data"], | |
574 | ) | |
575 | ||
576 | native.genrule( | |
577 | name = name + "@zero_query", | |
578 | srcs = [ | |
579 | emoji_src, | |
580 | emoticon_categorized_src, | |
581 | symbol_src, | |
582 | zero_query_def, | |
583 | ], | |
584 | outs = [ | |
585 | "zero_query_token.data", | |
586 | "zero_query_string.data", | |
587 | ], | |
588 | cmd = ( | |
589 | "$(location //prediction:gen_zero_query_data) " + | |
590 | "--input_rule=$(location " + zero_query_def + ") " + | |
591 | "--input_symbol=$(location " + symbol_src + ") " + | |
592 | "--input_emoji=$(location " + emoji_src + ") " + | |
593 | "--input_emoticon=$(location " + emoticon_categorized_src + ") " + | |
594 | "--output_token_array=$(location :zero_query_token.data) " + | |
595 | "--output_string_array=$(location :zero_query_string.data)" | |
596 | ), | |
597 | tools = ["//prediction:gen_zero_query_data"], | |
598 | ) | |
599 | ||
600 | native.genrule( | |
601 | name = name + "@zero_query_number", | |
602 | srcs = [zero_query_number_def], | |
603 | outs = [ | |
604 | "zero_query_number_token.data", | |
605 | "zero_query_number_string.data", | |
606 | ], | |
607 | cmd = ( | |
608 | "$(location //prediction:gen_zero_query_number_data) " + | |
609 | "--input=$< " + | |
610 | "--output_token_array=$(location :zero_query_number_token.data) " + | |
611 | "--output_string_array=$(location :zero_query_number_string.data)" | |
612 | ), | |
613 | tools = ["//prediction:gen_zero_query_number_data"], | |
614 | ) | |
615 | ||
616 | native.genrule( | |
617 | name = name + "@version", | |
618 | srcs = ["//data/version:mozc_version_template.bzl"], | |
619 | outs = ["version.data"], | |
620 | cmd = ( | |
621 | "$(location //data_manager:gen_data_version) " + | |
622 | "--tag=" + tag + " --mozc_version_template=$< --output=$@" | |
623 | ), | |
624 | tools = ["//data_manager:gen_data_version"], | |
625 | ) | |
626 | ||
627 | for model_file in typing_models: | |
628 | filename = Label(model_file).name | |
629 | native.genrule( | |
630 | name = name + "@" + filename, | |
631 | srcs = [model_file], | |
632 | outs = [filename + ".data"], | |
633 | cmd = ( | |
634 | "$(location //composer/internal:gen_typing_model) " + | |
635 | "--input_path=$< --output_path=$@" | |
636 | ), | |
637 | tools = ["//composer/internal:gen_typing_model"], | |
638 | ) | |
639 | native.filegroup( | |
640 | name = name + "@typing_models", | |
641 | srcs = [name + "@" + Label(label).name for label in typing_models], | |
642 | ) | |
643 | ||
644 | if usage_dict: | |
645 | native.genrule( | |
646 | name = name + "@usage", | |
647 | srcs = [ | |
648 | cforms, | |
649 | usage_dict, | |
650 | ], | |
651 | outs = [ | |
652 | "usage_base_conj_suffix.data", | |
653 | "usage_conj_index.data", | |
654 | "usage_conj_suffix.data", | |
655 | "usage_item_array.data", | |
656 | "usage_string_array.data", | |
657 | ], | |
658 | cmd = ( | |
659 | "$(location //rewriter:gen_usage_rewriter_dictionary_main) " + | |
660 | "--usage_data_file=$(location " + usage_dict + ") " + | |
661 | "--cforms_file=$(location " + cforms + ") " + | |
662 | "--output_base_conjugation_suffix=$(location :usage_base_conj_suffix.data) " + | |
663 | "--output_conjugation_suffix=$(location :usage_conj_suffix.data) " + | |
664 | "--output_conjugation_index=$(location :usage_conj_index.data) " + | |
665 | "--output_usage_item_array=$(location :usage_item_array.data) " + | |
666 | "--output_string_array=$(location :usage_string_array.data) " | |
667 | ), | |
668 | tools = ["//rewriter:gen_usage_rewriter_dictionary_main"], | |
669 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | ) | |
35 | load( | |
36 | "//data_manager:mozc_data.bzl", | |
37 | "mozc_dataset", | |
38 | ) | |
39 | ||
40 | package(default_visibility = ["//visibility:public"]) | |
41 | ||
42 | # "\xEFMOZC\r\n" | |
43 | MOZC_DATASET_MAGIC_NUMBER = "\\xEF\\x4D\\x4F\\x5A\\x43\\x0D\\x0A" | |
44 | ||
45 | mozc_dataset( | |
46 | name = "mozc_dataset_for_oss", | |
47 | outs = [ | |
48 | "mozc.data", | |
49 | "mozc_data.inc", | |
50 | "pos_list.h", | |
51 | ], | |
52 | boundary_def = "//data/rules:boundary.def", | |
53 | cforms = "//data/rules:cforms.def", | |
54 | collocation_src = "//data/dictionary_oss:collocation.txt", | |
55 | collocation_suppression_src = "//data/dictionary_oss:collocation_suppression.txt", | |
56 | connection_deflate = "//data/dictionary_oss:connection.deflate", | |
57 | dictionary_srcs = [ | |
58 | "//data/dictionary_oss:dictionary00.txt", | |
59 | "//data/dictionary_oss:dictionary01.txt", | |
60 | "//data/dictionary_oss:dictionary02.txt", | |
61 | "//data/dictionary_oss:dictionary03.txt", | |
62 | "//data/dictionary_oss:dictionary04.txt", | |
63 | "//data/dictionary_oss:dictionary05.txt", | |
64 | "//data/dictionary_oss:dictionary06.txt", | |
65 | "//data/dictionary_oss:dictionary07.txt", | |
66 | "//data/dictionary_oss:dictionary08.txt", | |
67 | "//data/dictionary_oss:dictionary09.txt", | |
68 | "//data/dictionary_oss:reading_correction.tsv", | |
69 | ], | |
70 | emoji_src = "//data/emoji:emoji_data.tsv", | |
71 | emoticon_categorized_src = "//data/emoticon:categorized.tsv", | |
72 | emoticon_src = "//data/emoticon:emoticon.tsv", | |
73 | id_def = "//data/dictionary_oss:id.def", | |
74 | magic = MOZC_DATASET_MAGIC_NUMBER, | |
75 | pos_group_def = "//data/rules:user_segment_history_pos_group.def", | |
76 | pos_matcher_rule_def = "//data/rules:pos_matcher_rule.def", | |
77 | reading_correction_src = "//data/dictionary_oss:reading_correction.tsv", | |
78 | segmenter_def = "//data/rules:segmenter.def", | |
79 | segmenter_generator_src = "gen_oss_segmenter_bitarray_main.cc", | |
80 | single_kanji_src = "//data/single_kanji:single_kanji.tsv", | |
81 | sorting_map = "//data/rules:sorting_map.tsv", | |
82 | special_pos = "//data/rules:special_pos.def", | |
83 | suffix = "//data/dictionary_oss:suffix.txt", | |
84 | suggestion_filter_src = "//data/dictionary_oss:suggestion_filter.txt", | |
85 | symbol_ordering_rule = "//data/symbol:ordering_rule.txt", | |
86 | symbol_src = "//data/symbol:symbol.tsv", | |
87 | tag = "oss", | |
88 | typing_models = [ | |
89 | "//data/typing:typing_model_12keys-hiragana.tsv", | |
90 | "//data/typing:typing_model_flick-hiragana.tsv", | |
91 | "//data/typing:typing_model_godan-hiragana.tsv", | |
92 | "//data/typing:typing_model_qwerty_mobile-hiragana.tsv", | |
93 | "//data/typing:typing_model_toggle_flick-hiragana.tsv", | |
94 | ], | |
95 | usage_dict = "//third_party/japanese_usage_dictionary:usage_dict.txt", | |
96 | use_1byte_cost = "false", | |
97 | user_pos_def = "//data/rules:user_pos.def", | |
98 | variant_rule = "//data/single_kanji:variant_rule.txt", | |
99 | varname = "kOssMozcDataSet", | |
100 | zero_query_def = "//data/zero_query:zero_query.def", | |
101 | zero_query_number_def = "//data/zero_query:zero_query_number.def", | |
102 | ) | |
103 | ||
104 | cc_library_mozc( | |
105 | name = "oss_data_manager", | |
106 | srcs = [ | |
107 | "oss_data_manager.cc", | |
108 | ":mozc_dataset_for_oss@header", | |
109 | ], | |
110 | hdrs = ["oss_data_manager.h"], | |
111 | copts = [ | |
112 | "-DMOZC_DATASET_MAGIC_NUMBER='\"" + MOZC_DATASET_MAGIC_NUMBER + "\"'", | |
113 | ], | |
114 | deps = [ | |
115 | "//base:embedded_file", | |
116 | "//base:logging", | |
117 | "//base:port", | |
118 | "//data_manager", | |
119 | "@com_google_absl//absl/strings", | |
120 | ], | |
121 | ) | |
122 | ||
123 | cc_test_mozc( | |
124 | name = "oss_data_manager_test", | |
125 | size = "large", | |
126 | srcs = [ | |
127 | "oss_data_manager_test.cc", | |
128 | ":mozc_dataset_for_oss@segmenter_inl_header", | |
129 | ], | |
130 | copts = ["-Wno-parentheses"], | |
131 | data = [ | |
132 | ":mozc_dataset_for_oss@connection_single_column", | |
133 | ":mozc_dataset_for_oss@typing_models", | |
134 | "//data/dictionary_oss:dictionary00.txt", | |
135 | "//data/dictionary_oss:dictionary01.txt", | |
136 | "//data/dictionary_oss:dictionary02.txt", | |
137 | "//data/dictionary_oss:dictionary03.txt", | |
138 | "//data/dictionary_oss:dictionary04.txt", | |
139 | "//data/dictionary_oss:dictionary05.txt", | |
140 | "//data/dictionary_oss:dictionary06.txt", | |
141 | "//data/dictionary_oss:dictionary07.txt", | |
142 | "//data/dictionary_oss:dictionary08.txt", | |
143 | "//data/dictionary_oss:dictionary09.txt", | |
144 | "//data/dictionary_oss:suggestion_filter.txt", | |
145 | ], | |
146 | deps = [ | |
147 | ":mozc_dataset_for_oss@connection_single_column", | |
148 | ":oss_data_manager", | |
149 | "//data_manager:data_manager_test_base", | |
150 | "//dictionary:pos_matcher_lib", | |
151 | "//testing:gunit_main", | |
152 | "//testing:mozctest", | |
153 | ], | |
154 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | ) | |
35 | load( | |
36 | "//data_manager:mozc_data.bzl", | |
37 | "mozc_dataset", | |
38 | ) | |
39 | ||
40 | package(default_visibility = ["//visibility:public"]) | |
41 | ||
42 | # MOCK | |
43 | MOZC_DATASET_MAGIC_NUMBER = "\\x4D\\x4F\\x43\\x4B" | |
44 | ||
45 | cc_library_mozc( | |
46 | name = "mock_data_manager", | |
47 | testonly = 1, | |
48 | srcs = [ | |
49 | "mock_data_manager.cc", | |
50 | ":mozc_dataset_for_testing@header", | |
51 | ], | |
52 | hdrs = ["mock_data_manager.h"], | |
53 | copts = [ | |
54 | "-DMOZC_DATASET_MAGIC_NUMBER='\"" + MOZC_DATASET_MAGIC_NUMBER + "\"'", | |
55 | ], | |
56 | deps = [ | |
57 | "//base:embedded_file", | |
58 | "//base:logging", | |
59 | "//base:port", | |
60 | "//data_manager", | |
61 | "@com_google_absl//absl/strings", | |
62 | ], | |
63 | ) | |
64 | ||
65 | cc_test_mozc( | |
66 | name = "mock_data_manager_test", | |
67 | size = "medium", | |
68 | srcs = [ | |
69 | "mock_data_manager_test.cc", | |
70 | ":mozc_dataset_for_testing@segmenter_inl_header", | |
71 | ], | |
72 | copts = ["-Wno-parentheses"], | |
73 | data = [ | |
74 | ":mozc_dataset_for_testing@connection_single_column", | |
75 | ":mozc_dataset_for_testing@typing_models", | |
76 | "//data/test/dictionary:dictionary.txt", | |
77 | "//data/test/dictionary:suggestion_filter.txt", | |
78 | ], | |
79 | deps = [ | |
80 | ":mock_data_manager", | |
81 | "//data_manager:data_manager_test_base", | |
82 | "//dictionary:pos_matcher_lib", | |
83 | "//testing:gunit_main", | |
84 | "//testing:mozctest", | |
85 | ], | |
86 | ) | |
87 | ||
88 | mozc_dataset( | |
89 | name = "mozc_dataset_for_testing", | |
90 | outs = [ | |
91 | "mock_mozc.data", | |
92 | "mock_mozc_data.inc", | |
93 | "pos_list.h", | |
94 | ], | |
95 | boundary_def = "//data/rules:boundary.def", | |
96 | cforms = "//data/rules:cforms.def", | |
97 | collocation_src = "//data/test/dictionary:collocation.txt", | |
98 | collocation_suppression_src = "//data/test/dictionary:collocation_suppression.txt", | |
99 | connection_deflate = "//data/test/dictionary:connection.deflate", | |
100 | dictionary_srcs = [ | |
101 | "//data/test/dictionary:dictionary.txt", | |
102 | "//data/dictionary_manual:domain.txt", | |
103 | ], | |
104 | emoji_src = "//data/emoji:emoji_data.tsv", | |
105 | emoticon_categorized_src = "//data/emoticon:categorized.tsv", | |
106 | emoticon_src = "//data/emoticon:emoticon.tsv", | |
107 | id_def = "//data/test/dictionary:id.def", | |
108 | magic = MOZC_DATASET_MAGIC_NUMBER, | |
109 | pos_group_def = "//data/rules:user_segment_history_pos_group.def", | |
110 | pos_matcher_rule_def = "//data/rules:pos_matcher_rule.def", | |
111 | reading_correction_src = "//data/test/dictionary:reading_correction.tsv", | |
112 | segmenter_def = "//data/rules:segmenter.def", | |
113 | segmenter_generator_src = "gen_mock_segmenter_bitarray_main.cc", | |
114 | single_kanji_src = "//data/single_kanji:single_kanji.tsv", | |
115 | sorting_map = "//data/rules:sorting_map.tsv", | |
116 | special_pos = "//data/rules:special_pos.def", | |
117 | suffix = "//data/test/dictionary:suffix.txt", | |
118 | suggestion_filter_src = "//data/test/dictionary:suggestion_filter.txt", | |
119 | symbol_ordering_rule = "//data/symbol:ordering_rule.txt", | |
120 | symbol_src = "//data/symbol:symbol.tsv", | |
121 | tag = "mock", | |
122 | typing_models = [ | |
123 | "//data/typing:typing_model_12keys-hiragana.tsv", | |
124 | "//data/typing:typing_model_flick-hiragana.tsv", | |
125 | "//data/typing:typing_model_godan-hiragana.tsv", | |
126 | "//data/typing:typing_model_qwerty_mobile-hiragana.tsv", | |
127 | "//data/typing:typing_model_toggle_flick-hiragana.tsv", | |
128 | ], | |
129 | usage_dict = "//third_party/japanese_usage_dictionary:usage_dict.txt", | |
130 | use_1byte_cost = "false", | |
131 | user_pos_def = "//data/rules:user_pos.def", | |
132 | variant_rule = "//data/single_kanji:variant_rule.txt", | |
133 | varname = "kMockMozcDataSet", | |
134 | zero_query_def = "//data/zero_query:zero_query.def", | |
135 | zero_query_number_def = "//data/zero_query:zero_query_number.def", | |
136 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # Description: | |
31 | # The implementation of dictionaries used in Mozc. | |
32 | ||
33 | load( | |
34 | "//:build_defs.bzl", | |
35 | "cc_binary_mozc", | |
36 | "cc_library_mozc", | |
37 | "cc_test_mozc", | |
38 | "py_binary_mozc", | |
39 | "py_library_mozc", | |
40 | ) | |
41 | ||
42 | test_suite( | |
43 | name = "nacl_test", | |
44 | ) | |
45 | ||
46 | cc_library_mozc( | |
47 | name = "dictionary_interface", | |
48 | hdrs = ["dictionary_interface.h"], | |
49 | visibility = [ | |
50 | # For //converter:converter_impl. | |
51 | "//converter:__pkg__", | |
52 | # For //dictionary/system:system_dictionary. | |
53 | "//dictionary/system:__pkg__", | |
54 | # For //engine:small_immutable_converter. | |
55 | "//engine:__pkg__", | |
56 | # For //prediction:dictionary_predictor. | |
57 | "//prediction:__pkg__", | |
58 | # For //rewriter:language_aware_rewriter. | |
59 | "//rewriter:__pkg__", | |
60 | ], | |
61 | deps = [ | |
62 | ":dictionary_token", | |
63 | "//base:port", | |
64 | "//request:conversion_request", | |
65 | "@com_google_absl//absl/strings", | |
66 | ], | |
67 | ) | |
68 | ||
69 | cc_test_mozc( | |
70 | name = "dictionary_impl_test", | |
71 | size = "small", | |
72 | srcs = ["dictionary_impl_test.cc"], | |
73 | deps = [ | |
74 | ":dictionary_impl", | |
75 | ":dictionary_interface", | |
76 | ":dictionary_token", | |
77 | ":pos_matcher_lib", | |
78 | ":suffix_dictionary", | |
79 | ":suppression_dictionary", | |
80 | ":user_dictionary_stub", | |
81 | "//base", | |
82 | "//base:port", | |
83 | "//base:system_util", | |
84 | "//base:util", | |
85 | "//config:config_handler", | |
86 | "//converter:node", | |
87 | "//converter:node_allocator", | |
88 | "//data_manager/testing:mock_data_manager", | |
89 | "//dictionary/system:system_dictionary", | |
90 | "//dictionary/system:value_dictionary", | |
91 | "//protocol:config_proto", | |
92 | "//request:conversion_request", | |
93 | "//testing:googletest", | |
94 | "//testing:gunit_main", | |
95 | "@com_google_absl//absl/memory", | |
96 | "@com_google_absl//absl/strings", | |
97 | ], | |
98 | ) | |
99 | ||
100 | cc_library_mozc( | |
101 | name = "dictionary_impl", | |
102 | srcs = [ | |
103 | "dictionary_impl.cc", | |
104 | ], | |
105 | hdrs = [ | |
106 | "dictionary_impl.h", | |
107 | ], | |
108 | visibility = ["//:__subpackages__"], | |
109 | deps = [ | |
110 | ":dictionary_interface", | |
111 | ":dictionary_token", | |
112 | ":pos_matcher_lib", | |
113 | ":suppression_dictionary", | |
114 | "//base", | |
115 | "//base:logging", | |
116 | "//base:port", | |
117 | "//base:util", | |
118 | "//protocol:commands_proto", | |
119 | "//usage_stats", | |
120 | "@com_google_absl//absl/strings", | |
121 | ], | |
122 | ) | |
123 | ||
124 | cc_library_mozc( | |
125 | name = "suffix_dictionary", | |
126 | srcs = ["suffix_dictionary.cc"], | |
127 | hdrs = ["suffix_dictionary.h"], | |
128 | visibility = ["//:__subpackages__"], | |
129 | deps = [ | |
130 | ":dictionary_interface", | |
131 | ":dictionary_token", | |
132 | "//base", | |
133 | "//base:logging", | |
134 | "//base:port", | |
135 | "//base:serialized_string_array", | |
136 | "//base:util", | |
137 | "@com_google_absl//absl/strings", | |
138 | ], | |
139 | ) | |
140 | ||
141 | cc_library_mozc( | |
142 | name = "user_dictionary", | |
143 | srcs = [ | |
144 | "user_dictionary.cc", | |
145 | ], | |
146 | hdrs = [ | |
147 | "user_dictionary.h", | |
148 | ], | |
149 | visibility = ["//:__subpackages__"], | |
150 | deps = [ | |
151 | ":dictionary_interface", | |
152 | ":dictionary_token", | |
153 | ":pos_matcher_lib", | |
154 | ":suppression_dictionary", | |
155 | ":user_dictionary_storage", | |
156 | ":user_dictionary_util", | |
157 | ":user_pos", | |
158 | ":user_pos_interface", | |
159 | "//base", | |
160 | "//base:file_util", | |
161 | "//base:hash", | |
162 | "//base:logging", | |
163 | "//base:mutex", | |
164 | "//base:port", | |
165 | "//base:singleton", | |
166 | "//base:stl_util", | |
167 | "//base:thread", | |
168 | "//base:util", | |
169 | "//config:config_handler", | |
170 | "//protocol:config_proto", | |
171 | "//protocol:user_dictionary_storage_proto", | |
172 | "//usage_stats", | |
173 | "@com_google_absl//absl/strings", | |
174 | ], | |
175 | ) | |
176 | ||
177 | cc_test_mozc( | |
178 | name = "user_dictionary_test", | |
179 | size = "small", | |
180 | srcs = [ | |
181 | "user_dictionary_test.cc", | |
182 | ], | |
183 | deps = [ | |
184 | ":dictionary_test_util", | |
185 | ":dictionary_token", | |
186 | ":pos_matcher_lib", | |
187 | ":suppression_dictionary", | |
188 | ":user_dictionary", | |
189 | ":user_dictionary_storage", | |
190 | ":user_pos", | |
191 | ":user_pos_interface", | |
192 | "//base:file_util", | |
193 | "//base:logging", | |
194 | "//base:port", | |
195 | "//base:singleton", | |
196 | "//base:util", | |
197 | "//config:config_handler", | |
198 | "//data_manager/testing:mock_data_manager", | |
199 | "//protocol:config_proto", | |
200 | "//request:conversion_request", | |
201 | "//testing:googletest", | |
202 | "//testing:gunit_main", | |
203 | "//testing:mozctest", | |
204 | "//usage_stats", | |
205 | "//usage_stats:usage_stats_testing_util", | |
206 | "@com_google_absl//absl/strings", | |
207 | ], | |
208 | ) | |
209 | ||
210 | cc_library_mozc( | |
211 | name = "user_dictionary_stub", | |
212 | hdrs = ["user_dictionary_stub.h"], | |
213 | visibility = ["//:__subpackages__"], | |
214 | deps = [ | |
215 | ":dictionary_interface", | |
216 | "@com_google_absl//absl/strings", | |
217 | ], | |
218 | ) | |
219 | ||
220 | # TODO(team): move this rule into dictionary/system. | |
221 | cc_library_mozc( | |
222 | name = "dictionary_token", | |
223 | hdrs = ["dictionary_token.h"], | |
224 | visibility = [ | |
225 | "//converter:__subpackages__", | |
226 | "//dictionary/system:__subpackages__", | |
227 | # For //prediction:dictionary_predictor. | |
228 | "//prediction:__pkg__", | |
229 | ], | |
230 | deps = ["//base:port"], | |
231 | ) | |
232 | ||
233 | cc_library_mozc( | |
234 | name = "pos_group", | |
235 | hdrs = ["pos_group.h"], | |
236 | visibility = ["//:__subpackages__"], | |
237 | deps = ["//base:port"], | |
238 | ) | |
239 | ||
240 | py_library_mozc( | |
241 | name = "gen_pos_map_lib", | |
242 | srcs = ["gen_pos_map.py"], | |
243 | deps = [ | |
244 | "//build_tools:code_generator_util", | |
245 | ], | |
246 | ) | |
247 | ||
248 | py_binary_mozc( | |
249 | name = "gen_pos_map", | |
250 | srcs = ["gen_pos_map.py"], | |
251 | deps = [ | |
252 | ":gen_pos_map_lib", | |
253 | "//build_tools:code_generator_util", | |
254 | ], | |
255 | ) | |
256 | ||
257 | genrule( | |
258 | name = "pos_map", | |
259 | srcs = [ | |
260 | "//data/rules:user_pos.def", | |
261 | "//data/rules:third_party_pos_map.def", | |
262 | ], | |
263 | outs = ["pos_map.inc"], | |
264 | cmd = ( | |
265 | "$(location :gen_pos_map) " + | |
266 | "--user_pos_file=" + | |
267 | "$(location //data/rules:user_pos.def) " + | |
268 | "--third_party_pos_map_file=" + | |
269 | "$(location //data/rules:third_party_pos_map.def) " + | |
270 | "--output=$@" | |
271 | ), | |
272 | tools = [":gen_pos_map"], | |
273 | ) | |
274 | ||
275 | cc_library_mozc( | |
276 | name = "user_dictionary_session", | |
277 | srcs = ["user_dictionary_session.cc"], | |
278 | hdrs = ["user_dictionary_session.h"], | |
279 | visibility = ["//gui:__subpackages__"], | |
280 | deps = [ | |
281 | ":user_dictionary_importer", | |
282 | ":user_dictionary_storage", | |
283 | ":user_dictionary_util", | |
284 | "//base", | |
285 | "//base:logging", | |
286 | "//base:port", | |
287 | "//base/protobuf", | |
288 | "//base/protobuf:repeated_field", | |
289 | "//protocol:user_dictionary_storage_proto", | |
290 | ], | |
291 | ) | |
292 | ||
293 | cc_test_mozc( | |
294 | name = "user_dictionary_session_test", | |
295 | size = "medium", | |
296 | srcs = ["user_dictionary_session_test.cc"], | |
297 | deps = [ | |
298 | ":user_dictionary_session", | |
299 | ":user_dictionary_storage", | |
300 | "//base", | |
301 | "//base:file_util", | |
302 | "//base:system_util", | |
303 | "//protocol:user_dictionary_storage_proto", | |
304 | "//testing:googletest", | |
305 | "//testing:gunit_main", | |
306 | "//testing:testing_util", | |
307 | ], | |
308 | ) | |
309 | ||
310 | cc_library_mozc( | |
311 | name = "user_dictionary_session_handler", | |
312 | srcs = ["user_dictionary_session_handler.cc"], | |
313 | hdrs = ["user_dictionary_session_handler.h"], | |
314 | visibility = ["//:__subpackages__"], | |
315 | deps = [ | |
316 | ":user_dictionary_session", | |
317 | ":user_dictionary_util", | |
318 | "//base", | |
319 | "//base:file_util", | |
320 | "//base:logging", | |
321 | "//base:port", | |
322 | "//base:util", | |
323 | "//base/protobuf", | |
324 | "//base/protobuf:repeated_field", | |
325 | "//protocol:user_dictionary_storage_proto", | |
326 | ], | |
327 | ) | |
328 | ||
329 | cc_test_mozc( | |
330 | name = "user_dictionary_session_handler_test", | |
331 | size = "small", | |
332 | srcs = ["user_dictionary_session_handler_test.cc"], | |
333 | deps = [ | |
334 | ":user_dictionary_session_handler", | |
335 | "//base:file_stream", | |
336 | "//base:file_util", | |
337 | "//base:system_util", | |
338 | "//base/protobuf", | |
339 | "//base/protobuf:repeated_field", | |
340 | "//protocol:user_dictionary_storage_proto", | |
341 | "//testing:googletest", | |
342 | "//testing:gunit_main", | |
343 | "//testing:testing_util", | |
344 | ], | |
345 | ) | |
346 | ||
347 | cc_library_mozc( | |
348 | name = "user_dictionary_storage", | |
349 | srcs = ["user_dictionary_storage.cc"], | |
350 | hdrs = ["user_dictionary_storage.h"], | |
351 | visibility = ["//:__subpackages__"], | |
352 | deps = [ | |
353 | ":user_dictionary_util", | |
354 | "//base", | |
355 | "//base:file_stream", | |
356 | "//base:file_util", | |
357 | "//base:logging", | |
358 | "//base:mutex", | |
359 | "//base:port", | |
360 | "//base:process_mutex", | |
361 | "//base:util", | |
362 | "//base/protobuf:zero_copy_stream_impl", | |
363 | "//protocol:user_dictionary_storage_proto", | |
364 | ], | |
365 | ) | |
366 | ||
367 | cc_test_mozc( | |
368 | name = "user_dictionary_storage_test", | |
369 | size = "small", | |
370 | srcs = ["user_dictionary_storage_test.cc"], | |
371 | deps = [ | |
372 | ":user_dictionary_importer", | |
373 | ":user_dictionary_storage", | |
374 | ":user_dictionary_util", | |
375 | "//base", | |
376 | "//base:file_stream", | |
377 | "//base:file_util", | |
378 | "//base:logging", | |
379 | "//base:mmap", | |
380 | "//base:system_util", | |
381 | "//base:util", | |
382 | "//testing:googletest", | |
383 | "//testing:gunit_main", | |
384 | ], | |
385 | ) | |
386 | ||
387 | cc_library_mozc( | |
388 | name = "user_dictionary_util", | |
389 | srcs = ["user_dictionary_util.cc"], | |
390 | hdrs = ["user_dictionary_util.h"], | |
391 | visibility = [ | |
392 | "//:__subpackages__", | |
393 | ], | |
394 | deps = [ | |
395 | ":user_pos", | |
396 | ":user_pos_interface", | |
397 | "//base", | |
398 | "//base:config_file_stream", | |
399 | "//base:file_stream", | |
400 | "//base:logging", | |
401 | "//base:port", | |
402 | "//base:util", | |
403 | "//base/protobuf", | |
404 | "//base/protobuf:message", | |
405 | "//protocol:user_dictionary_storage_proto", | |
406 | ], | |
407 | ) | |
408 | ||
409 | cc_test_mozc( | |
410 | name = "user_dictionary_util_test", | |
411 | size = "small", | |
412 | srcs = ["user_dictionary_util_test.cc"], | |
413 | deps = [ | |
414 | ":user_dictionary_util", | |
415 | "//base", | |
416 | "//base:util", | |
417 | "//testing:googletest", | |
418 | "//testing:gunit_main", | |
419 | "//testing:testing_util", | |
420 | ], | |
421 | ) | |
422 | ||
423 | cc_library_mozc( | |
424 | name = "user_dictionary_importer", | |
425 | srcs = [ | |
426 | "user_dictionary_importer.cc", | |
427 | ":pos_map", | |
428 | ], | |
429 | hdrs = ["user_dictionary_importer.h"], | |
430 | visibility = ["//gui:__subpackages__"], | |
431 | deps = [ | |
432 | ":user_dictionary", | |
433 | ":user_dictionary_util", | |
434 | "//base", | |
435 | "//base:hash", | |
436 | "//base:logging", | |
437 | "//base:mmap", | |
438 | "//base:number_util", | |
439 | "//base:port", | |
440 | "//base:system_util", | |
441 | "//base:util", | |
442 | "//base:win_util", | |
443 | "//protocol:user_dictionary_storage_proto", | |
444 | "@com_google_absl//absl/strings", | |
445 | ], | |
446 | ) | |
447 | ||
448 | cc_test_mozc( | |
449 | name = "user_dictionary_importer_test", | |
450 | size = "small", | |
451 | srcs = ["user_dictionary_importer_test.cc"], | |
452 | deps = [ | |
453 | ":user_dictionary_importer", | |
454 | ":user_dictionary_storage", | |
455 | ":user_dictionary_util", | |
456 | "//base:util", | |
457 | "//testing:googletest", | |
458 | "//testing:gunit_main", | |
459 | ], | |
460 | ) | |
461 | ||
462 | # TODO(team): move this rule into dictionary/system. | |
463 | cc_library_mozc( | |
464 | name = "text_dictionary_loader", | |
465 | srcs = [ | |
466 | "text_dictionary_loader.cc", | |
467 | ], | |
468 | hdrs = [ | |
469 | "text_dictionary_loader.h", | |
470 | ], | |
471 | visibility = [ | |
472 | "//:__subpackages__", | |
473 | ], | |
474 | deps = [ | |
475 | ":dictionary_token", | |
476 | ":pos_matcher_lib", | |
477 | "//base", | |
478 | "//base:file_stream", | |
479 | "//base:flags", | |
480 | "//base:iterator_adapter", | |
481 | "//base:logging", | |
482 | "//base:multifile", | |
483 | "//base:number_util", | |
484 | "//base:port", | |
485 | "//base:stl_util", | |
486 | "//base:util", | |
487 | "//testing:gunit_prod", | |
488 | "@com_google_absl//absl/strings", | |
489 | ], | |
490 | ) | |
491 | ||
492 | cc_test_mozc( | |
493 | name = "text_dictionary_loader_test", | |
494 | size = "small", | |
495 | srcs = [ | |
496 | "text_dictionary_loader_test.cc", | |
497 | ], | |
498 | deps = [ | |
499 | ":dictionary_token", | |
500 | ":pos_matcher_lib", | |
501 | ":text_dictionary_loader", | |
502 | "//base:file_stream", | |
503 | "//base:file_util", | |
504 | "//base:util", | |
505 | "//data_manager/testing:mock_data_manager", | |
506 | "//testing:googletest", | |
507 | "//testing:gunit_main", | |
508 | ], | |
509 | ) | |
510 | ||
511 | cc_library_mozc( | |
512 | name = "user_pos", | |
513 | srcs = ["user_pos.cc"], | |
514 | hdrs = ["user_pos.h"], | |
515 | visibility = [ | |
516 | "//:__subpackages__", | |
517 | ], | |
518 | deps = [ | |
519 | ":user_pos_interface", | |
520 | "//base", | |
521 | "//base:logging", | |
522 | "//base:port", | |
523 | "//base:serialized_string_array", | |
524 | "//base:util", | |
525 | "//data_manager:data_manager_interface", | |
526 | "@com_google_absl//absl/strings", | |
527 | ], | |
528 | ) | |
529 | ||
530 | cc_test_mozc( | |
531 | name = "user_pos_test", | |
532 | size = "small", | |
533 | srcs = ["user_pos_test.cc"], | |
534 | deps = [ | |
535 | ":user_pos", | |
536 | ":user_pos_interface", | |
537 | "//base:logging", | |
538 | "//base:util", | |
539 | "//data_manager/testing:mock_data_manager", | |
540 | "//testing:gunit_main", | |
541 | "@com_google_absl//absl/strings", | |
542 | ], | |
543 | ) | |
544 | ||
545 | py_library_mozc( | |
546 | name = "pos_util", | |
547 | srcs = ["pos_util.py"], | |
548 | visibility = ["//visibility:private"], | |
549 | deps = [ | |
550 | "//build_tools:code_generator_util", | |
551 | ], | |
552 | ) | |
553 | ||
554 | py_library_mozc( | |
555 | name = "gen_user_pos_data_lib", | |
556 | srcs = ["gen_user_pos_data.py"], | |
557 | deps = [ | |
558 | ":pos_util", | |
559 | "//build_tools:serialized_string_array_builder", | |
560 | ], | |
561 | ) | |
562 | ||
563 | py_binary_mozc( | |
564 | name = "gen_user_pos_data", | |
565 | srcs = ["gen_user_pos_data.py"], | |
566 | visibility = ["//:__subpackages__"], | |
567 | deps = [ | |
568 | ":gen_user_pos_data_lib", | |
569 | ":pos_util", | |
570 | "//build_tools:serialized_string_array_builder", | |
571 | ], | |
572 | ) | |
573 | ||
574 | py_library_mozc( | |
575 | name = "gen_pos_matcher_code_lib", | |
576 | srcs = ["gen_pos_matcher_code.py"], | |
577 | deps = [ | |
578 | ":pos_util", | |
579 | ], | |
580 | ) | |
581 | ||
582 | py_binary_mozc( | |
583 | name = "gen_pos_matcher_code", | |
584 | srcs = ["gen_pos_matcher_code.py"], | |
585 | visibility = ["//:__subpackages__"], | |
586 | deps = [ | |
587 | ":gen_pos_matcher_code_lib", | |
588 | ":pos_util", | |
589 | ], | |
590 | ) | |
591 | ||
592 | genrule( | |
593 | name = "pos_matcher", | |
594 | srcs = ["//data/rules:pos_matcher_rule.def"], | |
595 | outs = ["pos_matcher.h"], | |
596 | cmd = ( | |
597 | "$(location :gen_pos_matcher_code) " + | |
598 | "--pos_matcher_rule_file=$< " + | |
599 | "--output_pos_matcher_h=$@" | |
600 | ), | |
601 | tools = [":gen_pos_matcher_code"], | |
602 | visibility = [ | |
603 | "//visibility:private", | |
604 | ], | |
605 | ) | |
606 | ||
607 | cc_library_mozc( | |
608 | name = "pos_matcher_lib", | |
609 | hdrs = ["pos_matcher.h"], | |
610 | visibility = [ | |
611 | "//:__subpackages__", | |
612 | ], | |
613 | deps = ["//base:port"], | |
614 | ) | |
615 | ||
616 | py_library_mozc( | |
617 | name = "gen_pos_rewrite_rule_lib", | |
618 | srcs = ["gen_pos_rewrite_rule.py"], | |
619 | ) | |
620 | ||
621 | py_binary_mozc( | |
622 | name = "gen_pos_rewrite_rule", | |
623 | srcs = ["gen_pos_rewrite_rule.py"], | |
624 | visibility = ["//:__subpackages__"], | |
625 | deps = [":gen_pos_rewrite_rule_lib"], | |
626 | ) | |
627 | ||
628 | cc_binary_mozc( | |
629 | name = "gen_system_dictionary_data_main", | |
630 | srcs = ["gen_system_dictionary_data_main.cc"], | |
631 | visibility = ["//:__subpackages__"], | |
632 | deps = [ | |
633 | ":dictionary_token", | |
634 | ":pos_matcher_lib", | |
635 | ":text_dictionary_loader", | |
636 | "//base", | |
637 | "//base:file_stream", | |
638 | "//base:flags", | |
639 | "//base:init_mozc_buildtool", | |
640 | "//base:logging", | |
641 | "//base:util", | |
642 | "//data_manager", | |
643 | "//dictionary/system:system_dictionary_builder", | |
644 | "@com_google_absl//absl/strings", | |
645 | ], | |
646 | ) | |
647 | ||
648 | cc_library_mozc( | |
649 | name = "suppression_dictionary", | |
650 | srcs = ["suppression_dictionary.cc"], | |
651 | hdrs = ["suppression_dictionary.h"], | |
652 | visibility = ["//:__subpackages__"], | |
653 | deps = [ | |
654 | "//base", | |
655 | "//base:logging", | |
656 | "//base:mutex", | |
657 | "//base:port", | |
658 | ], | |
659 | ) | |
660 | ||
661 | cc_test_mozc( | |
662 | name = "suppression_dictionary_test", | |
663 | size = "small", | |
664 | srcs = ["suppression_dictionary_test.cc"], | |
665 | deps = [ | |
666 | ":suppression_dictionary", | |
667 | "//base", | |
668 | "//base:logging", | |
669 | "//base:singleton", | |
670 | "//base:thread", | |
671 | "//base:util", | |
672 | "//testing:googletest", | |
673 | "//testing:gunit_main", | |
674 | ], | |
675 | ) | |
676 | ||
677 | cc_library_mozc( | |
678 | name = "dictionary_mock", | |
679 | testonly = 1, | |
680 | srcs = ["dictionary_mock.cc"], | |
681 | hdrs = ["dictionary_mock.h"], | |
682 | visibility = ["//:__subpackages__"], | |
683 | deps = [ | |
684 | ":dictionary_interface", | |
685 | ":dictionary_token", | |
686 | "//base", | |
687 | "//base:logging", | |
688 | "//base:port", | |
689 | "//base:stl_util", | |
690 | "//base:util", | |
691 | "//request:conversion_request", | |
692 | "@com_google_absl//absl/strings", | |
693 | ], | |
694 | ) | |
695 | ||
696 | cc_test_mozc( | |
697 | name = "dictionary_mock_test", | |
698 | size = "small", | |
699 | srcs = ["dictionary_mock_test.cc"], | |
700 | deps = [ | |
701 | ":dictionary_mock", | |
702 | ":dictionary_test_util", | |
703 | ":dictionary_token", | |
704 | "//base:logging", | |
705 | "//base:util", | |
706 | "//request:conversion_request", | |
707 | "//testing:gunit_main", | |
708 | ], | |
709 | ) | |
710 | ||
711 | py_library_mozc( | |
712 | name = "gen_suffix_data_lib", | |
713 | srcs = ["gen_suffix_data.py"], | |
714 | deps = ["//build_tools:serialized_string_array_builder"], | |
715 | ) | |
716 | ||
717 | py_binary_mozc( | |
718 | name = "gen_suffix_data", | |
719 | srcs = ["gen_suffix_data.py"], | |
720 | visibility = ["//:__subpackages__"], | |
721 | deps = [ | |
722 | ":gen_suffix_data_lib", | |
723 | "//build_tools:serialized_string_array_builder", | |
724 | ], | |
725 | ) | |
726 | ||
727 | cc_test_mozc( | |
728 | name = "suffix_dictionary_test", | |
729 | size = "small", | |
730 | srcs = ["suffix_dictionary_test.cc"], | |
731 | deps = [ | |
732 | ":dictionary_interface", | |
733 | ":dictionary_test_util", | |
734 | ":suffix_dictionary", | |
735 | "//base", | |
736 | "//base:util", | |
737 | "//data_manager/testing:mock_data_manager", | |
738 | "//request:conversion_request", | |
739 | "//testing:gunit_main", | |
740 | "@com_google_absl//absl/strings", | |
741 | ], | |
742 | ) | |
743 | ||
744 | cc_library_mozc( | |
745 | name = "dictionary_test_util", | |
746 | testonly = 1, | |
747 | srcs = ["dictionary_test_util.cc"], | |
748 | hdrs = ["dictionary_test_util.h"], | |
749 | visibility = [ | |
750 | "//:__subpackages__", | |
751 | ], | |
752 | deps = [ | |
753 | ":dictionary_interface", | |
754 | ":dictionary_token", | |
755 | "//base", | |
756 | "//base:util", | |
757 | "//testing", | |
758 | "@com_google_absl//absl/strings", | |
759 | ], | |
760 | ) | |
761 | ||
762 | cc_library_mozc( | |
763 | name = "user_pos_interface", | |
764 | hdrs = ["user_pos_interface.h"], | |
765 | visibility = ["//data_manager:__subpackages__"], | |
766 | deps = ["//base:port"], | |
767 | ) | |
768 | ||
769 | py_binary_mozc( | |
770 | name = "gen_zip_code_seed", | |
771 | srcs = [ | |
772 | "gen_zip_code_seed.py", | |
773 | "zip_code_util.py", | |
774 | ], | |
775 | visibility = ["//train/zip_code:__subpackages__"], | |
776 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | ) | |
35 | ||
36 | package(default_visibility = [ | |
37 | "//:__subpackages__", | |
38 | ]) | |
39 | ||
40 | cc_library_mozc( | |
41 | name = "dictionary_file", | |
42 | srcs = ["dictionary_file.cc"], | |
43 | hdrs = ["dictionary_file.h"], | |
44 | deps = [ | |
45 | ":codec_interface", | |
46 | ":section", | |
47 | "//base", | |
48 | "//base:logging", | |
49 | "//base:mmap", | |
50 | "//base:port", | |
51 | "//base:status", | |
52 | "@com_google_absl//absl/memory", | |
53 | "@com_google_absl//absl/strings", | |
54 | ], | |
55 | ) | |
56 | ||
57 | cc_library_mozc( | |
58 | name = "dictionary_file_builder", | |
59 | srcs = ["dictionary_file_builder.cc"], | |
60 | hdrs = ["dictionary_file_builder.h"], | |
61 | deps = [ | |
62 | ":codec", | |
63 | ":codec_interface", | |
64 | ":section", | |
65 | "//base", | |
66 | "//base:file_stream", | |
67 | "//base:logging", | |
68 | "//base:port", | |
69 | ], | |
70 | ) | |
71 | ||
72 | cc_test_mozc( | |
73 | name = "dictionary_file_test", | |
74 | size = "small", | |
75 | srcs = ["dictionary_file_test.cc"], | |
76 | deps = [ | |
77 | ":codec_factory", | |
78 | ":dictionary_file", | |
79 | ":dictionary_file_builder", | |
80 | "//base", | |
81 | "//base:file_util", | |
82 | "//base:flags", | |
83 | "//base:logging", | |
84 | "//testing:googletest", | |
85 | "//testing:gunit_main", | |
86 | ], | |
87 | ) | |
88 | ||
89 | cc_library_mozc( | |
90 | name = "codec_interface", | |
91 | hdrs = ["codec_interface.h"], | |
92 | deps = [ | |
93 | ":section", | |
94 | "//base:port", | |
95 | "//base:status", | |
96 | ], | |
97 | ) | |
98 | ||
99 | cc_library_mozc( | |
100 | name = "codec_util", | |
101 | srcs = ["codec_util.cc"], | |
102 | hdrs = ["codec_util.h"], | |
103 | deps = [ | |
104 | "//base", | |
105 | "//base:logging", | |
106 | "//base:port", | |
107 | "//base:status", | |
108 | "@com_google_absl//absl/strings", | |
109 | ], | |
110 | ) | |
111 | ||
112 | cc_library_mozc( | |
113 | name = "codec", | |
114 | srcs = ["codec.cc"], | |
115 | hdrs = ["codec.h"], | |
116 | deps = [ | |
117 | ":codec_interface", | |
118 | ":codec_util", | |
119 | ":section", | |
120 | "//base", | |
121 | "//base:hash", | |
122 | "//base:logging", | |
123 | "//base:port", | |
124 | "//base:status", | |
125 | "//base:util", | |
126 | ], | |
127 | ) | |
128 | ||
129 | cc_library_mozc( | |
130 | name = "codec_factory", | |
131 | srcs = ["codec_factory.cc"], | |
132 | hdrs = [ | |
133 | "codec_factory.h", | |
134 | ], | |
135 | deps = [ | |
136 | ":codec", | |
137 | ":codec_interface", | |
138 | ":codec_util", | |
139 | ":section", | |
140 | "//base", | |
141 | "//base:port", | |
142 | "//base:singleton", | |
143 | ], | |
144 | ) | |
145 | ||
146 | cc_library_mozc( | |
147 | name = "section", | |
148 | hdrs = ["section.h"], | |
149 | visibility = ["//visibility:private"], | |
150 | ) | |
151 | ||
152 | cc_test_mozc( | |
153 | name = "codec_test", | |
154 | size = "small", | |
155 | srcs = ["codec_test.cc"], | |
156 | deps = [ | |
157 | ":codec", | |
158 | ":codec_factory", | |
159 | ":codec_interface", | |
160 | ":section", | |
161 | "//base", | |
162 | "//base:file_stream", | |
163 | "//base:file_util", | |
164 | "//base:logging", | |
165 | "//base:util", | |
166 | "//testing:googletest", | |
167 | "//testing:gunit_main", | |
168 | "@com_google_absl//absl/memory", | |
169 | ], | |
170 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # Description: | |
31 | # System dictionary implementation of Mozc. | |
32 | ||
33 | load( | |
34 | "//:build_defs.bzl", | |
35 | "cc_library_mozc", | |
36 | "cc_test_mozc", | |
37 | ) | |
38 | ||
39 | cc_library_mozc( | |
40 | name = "codec_interface", | |
41 | hdrs = ["codec_interface.h"], | |
42 | visibility = ["//visibility:private"], | |
43 | deps = [ | |
44 | "//base:port", | |
45 | "@com_google_absl//absl/strings", | |
46 | ], | |
47 | ) | |
48 | ||
49 | cc_library_mozc( | |
50 | name = "codec", | |
51 | srcs = ["codec.cc"], | |
52 | hdrs = [ | |
53 | "codec.h", | |
54 | "codec_interface.h", | |
55 | ], | |
56 | visibility = ["//visibility:private"], | |
57 | deps = [ | |
58 | ":words_info", | |
59 | "//base", | |
60 | "//base:logging", | |
61 | "//base:port", | |
62 | "//base:singleton", | |
63 | "//base:status", | |
64 | "//base:util", | |
65 | "//dictionary:dictionary_token", | |
66 | "@com_google_absl//absl/strings", | |
67 | ], | |
68 | ) | |
69 | ||
70 | cc_test_mozc( | |
71 | name = "codec_test", | |
72 | size = "small", | |
73 | srcs = ["codec_test.cc"], | |
74 | deps = [ | |
75 | ":codec", | |
76 | ":words_info", | |
77 | "//base:logging", | |
78 | "//base:util", | |
79 | "//dictionary:dictionary_token", | |
80 | "//testing:googletest", | |
81 | "//testing:gunit_main", | |
82 | "@com_google_absl//absl/strings", | |
83 | ], | |
84 | ) | |
85 | ||
86 | cc_library_mozc( | |
87 | name = "token_decode_iterator", | |
88 | hdrs = ["token_decode_iterator.h"], | |
89 | visibility = ["//visibility:private"], | |
90 | deps = [ | |
91 | ":codec_interface", | |
92 | ":words_info", | |
93 | "//base:logging", | |
94 | "//base:port", | |
95 | "//base:util", | |
96 | "//dictionary:dictionary_token", | |
97 | "//storage/louds:louds_trie", | |
98 | "@com_google_absl//absl/strings", | |
99 | ], | |
100 | ) | |
101 | ||
102 | cc_library_mozc( | |
103 | name = "system_dictionary", | |
104 | srcs = ["system_dictionary.cc"], | |
105 | hdrs = ["system_dictionary.h"], | |
106 | visibility = ["//:__subpackages__"], | |
107 | deps = [ | |
108 | ":codec", | |
109 | ":key_expansion_table", | |
110 | ":token_decode_iterator", | |
111 | ":words_info", | |
112 | "//base", | |
113 | "//base:logging", | |
114 | "//base:mmap", | |
115 | "//base:port", | |
116 | "//base:status", | |
117 | "//base:util", | |
118 | "//dictionary:dictionary_interface", | |
119 | "//dictionary:dictionary_token", | |
120 | "//dictionary:pos_matcher_lib", | |
121 | "//dictionary/file:codec_factory", | |
122 | "//dictionary/file:codec_interface", | |
123 | "//dictionary/file:dictionary_file", | |
124 | "//storage/louds:bit_vector_based_array", | |
125 | "//storage/louds:louds_trie", | |
126 | "//testing:gunit_prod", | |
127 | "@com_google_absl//absl/memory", | |
128 | "@com_google_absl//absl/strings", | |
129 | ], | |
130 | ) | |
131 | ||
132 | cc_library_mozc( | |
133 | name = "value_dictionary", | |
134 | srcs = [ | |
135 | "value_dictionary.cc", | |
136 | ], | |
137 | hdrs = ["value_dictionary.h"], | |
138 | visibility = ["//:__subpackages__"], | |
139 | deps = [ | |
140 | ":codec", | |
141 | "//base", | |
142 | "//base:logging", | |
143 | "//base:mmap", | |
144 | "//base:port", | |
145 | "//dictionary:dictionary_interface", | |
146 | "//dictionary:dictionary_token", | |
147 | "//dictionary:pos_matcher_lib", | |
148 | "//dictionary/file:codec_factory", | |
149 | "//dictionary/file:dictionary_file", | |
150 | "//storage/louds:louds_trie", | |
151 | "@com_google_absl//absl/strings", | |
152 | ], | |
153 | ) | |
154 | ||
155 | cc_library_mozc( | |
156 | name = "system_dictionary_builder", | |
157 | srcs = [ | |
158 | "system_dictionary_builder.cc", | |
159 | ], | |
160 | hdrs = ["system_dictionary_builder.h"], | |
161 | visibility = ["//:__subpackages__"], | |
162 | deps = [ | |
163 | ":codec", | |
164 | ":words_info", | |
165 | "//base:file_stream", | |
166 | "//base:flags", | |
167 | "//base:logging", | |
168 | "//base:mozc_hash_set", | |
169 | "//base:port", | |
170 | "//base:util", | |
171 | "//dictionary:dictionary_token", | |
172 | "//dictionary:pos_matcher_lib", | |
173 | "//dictionary:text_dictionary_loader", | |
174 | "//dictionary/file:codec", | |
175 | "//dictionary/file:codec_factory", | |
176 | "//dictionary/file:codec_interface", | |
177 | "//storage/louds:bit_vector_based_array_builder", | |
178 | "//storage/louds:louds_trie_builder", | |
179 | ], | |
180 | ) | |
181 | ||
182 | cc_library_mozc( | |
183 | name = "words_info", | |
184 | hdrs = ["words_info.h"], | |
185 | visibility = ["//visibility:private"], | |
186 | ) | |
187 | ||
188 | cc_test_mozc( | |
189 | name = "system_dictionary_test", | |
190 | size = "large", | |
191 | srcs = [ | |
192 | "system_dictionary_test.cc", | |
193 | ], | |
194 | data = ["//data/dictionary_oss:dictionary00.txt"], | |
195 | deps = [ | |
196 | ":codec", | |
197 | ":system_dictionary", | |
198 | ":system_dictionary_builder", | |
199 | "//base:file_util", | |
200 | "//base:logging", | |
201 | "//base:port", | |
202 | "//base:stl_util", | |
203 | "//base:system_util", | |
204 | "//base:util", | |
205 | "//config:config_handler", | |
206 | "//data_manager/testing:mock_data_manager", | |
207 | "//dictionary:dictionary_test_util", | |
208 | "//dictionary:dictionary_token", | |
209 | "//dictionary:pos_matcher_lib", | |
210 | "//dictionary:text_dictionary_loader", | |
211 | "//protocol:commands_proto", | |
212 | "//protocol:config_proto", | |
213 | "//request:conversion_request", | |
214 | "//testing:googletest", | |
215 | "//testing:gunit_main", | |
216 | "//testing:mozctest", | |
217 | "@com_google_absl//absl/strings", | |
218 | ], | |
219 | ) | |
220 | ||
221 | cc_test_mozc( | |
222 | name = "value_dictionary_test", | |
223 | size = "medium", | |
224 | srcs = ["value_dictionary_test.cc"], | |
225 | deps = [ | |
226 | ":codec", | |
227 | ":value_dictionary", | |
228 | "//data_manager/testing:mock_data_manager", | |
229 | "//dictionary:dictionary_test_util", | |
230 | "//dictionary:dictionary_token", | |
231 | "//dictionary:pos_matcher_lib", | |
232 | "//request:conversion_request", | |
233 | "//storage/louds:louds_trie_builder", | |
234 | "//testing:gunit_main", | |
235 | ], | |
236 | ) | |
237 | ||
238 | cc_test_mozc( | |
239 | name = "system_dictionary_benchmark", | |
240 | srcs = [ | |
241 | "system_dictionary_benchmark.cc", | |
242 | ], | |
243 | data = ["//data_manager/google:mozc_dataset_for_google@dictionary"], | |
244 | deps = [ | |
245 | ":system_dictionary", | |
246 | "//base", | |
247 | "//base:file_stream", | |
248 | "//base:flags", | |
249 | "//base:logging", | |
250 | "//base:util", | |
251 | "//dictionary:dictionary_test_util", | |
252 | "//request:conversion_request", | |
253 | "//testing:gunit_main", | |
254 | "//testing/base/public:gunit_main", | |
255 | "@com_google_absl//absl/strings", | |
256 | ], | |
257 | ) | |
258 | ||
259 | cc_library_mozc( | |
260 | name = "key_expansion_table", | |
261 | hdrs = ["key_expansion_table.h"], | |
262 | deps = [ | |
263 | "//base", | |
264 | "//base:port", | |
265 | ], | |
266 | ) | |
267 | ||
268 | cc_test_mozc( | |
269 | name = "key_expansion_table_test", | |
270 | size = "small", | |
271 | srcs = ["key_expansion_table_test.cc"], | |
272 | deps = [ | |
273 | ":key_expansion_table", | |
274 | "//testing:gunit_main", | |
275 | ], | |
276 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | "select_mozc", | |
35 | ) | |
36 | ||
37 | package(default_visibility = [ | |
38 | "//:__subpackages__", | |
39 | ]) | |
40 | ||
41 | test_suite( | |
42 | name = "nacl_test", | |
43 | ) | |
44 | ||
45 | cc_library_mozc( | |
46 | name = "engine_builder_interface", | |
47 | hdrs = ["engine_builder_interface.h"], | |
48 | deps = [ | |
49 | ":engine_interface", | |
50 | "//base:port", | |
51 | "//protocol:engine_builder_proto", | |
52 | "@com_google_absl//absl/strings", | |
53 | ], | |
54 | ) | |
55 | ||
56 | cc_library_mozc( | |
57 | name = "engine_builder", | |
58 | srcs = ["engine_builder.cc"], | |
59 | hdrs = ["engine_builder.h"], | |
60 | deps = [ | |
61 | ":engine", | |
62 | ":engine_builder_interface", | |
63 | ":engine_interface", | |
64 | "//base:file_util", | |
65 | "//base:logging", | |
66 | "//base:port", | |
67 | "//base:thread", | |
68 | "//data_manager", | |
69 | "//protocol:engine_builder_proto", | |
70 | ], | |
71 | ) | |
72 | ||
73 | cc_test_mozc( | |
74 | name = "engine_builder_test", | |
75 | srcs = ["engine_builder_test.cc"], | |
76 | data = [ | |
77 | "engine_builder_test.cc", | |
78 | "//data_manager/testing:mock_mozc.data", | |
79 | ], | |
80 | deps = [ | |
81 | ":engine_builder", | |
82 | "//base:file_util", | |
83 | "//prediction:predictor_interface", | |
84 | "//protocol:engine_builder_proto", | |
85 | "//testing:googletest", | |
86 | "//testing:gunit_main", | |
87 | "//testing:mozctest", | |
88 | ], | |
89 | ) | |
90 | ||
91 | cc_library_mozc( | |
92 | name = "engine_interface", | |
93 | hdrs = ["engine_interface.h"], | |
94 | deps = [ | |
95 | "//base", | |
96 | "//base:port", | |
97 | "//data_manager:data_manager_interface", | |
98 | "//dictionary:suppression_dictionary", | |
99 | "@com_google_absl//absl/strings", | |
100 | ], | |
101 | ) | |
102 | ||
103 | cc_library_mozc( | |
104 | name = "engine", | |
105 | srcs = [ | |
106 | "engine.cc", | |
107 | ], | |
108 | hdrs = ["engine.h"], | |
109 | visibility = [ | |
110 | "//android/jni:__pkg__", | |
111 | "//chrome/nacl:__pkg__", | |
112 | "//converter:__pkg__", | |
113 | "//ios:__pkg__", | |
114 | "//session:__pkg__", | |
115 | "//wasm:__pkg__", | |
116 | ], | |
117 | deps = [ | |
118 | ":engine_interface", | |
119 | ":user_data_manager_interface", | |
120 | "//base", | |
121 | "//base:logging", | |
122 | "//base:port", | |
123 | "//base:status", | |
124 | "//converter", | |
125 | "//converter:connector", | |
126 | "//converter:converter_interface", | |
127 | "//converter:immutable_converter_interface", | |
128 | "//converter:immutable_converter_no_factory", | |
129 | "//converter:segmenter", | |
130 | "//data_manager:data_manager_interface", | |
131 | "//dictionary:dictionary_impl", | |
132 | "//dictionary:dictionary_interface", | |
133 | "//dictionary:pos_group", | |
134 | "//dictionary:pos_matcher_lib", | |
135 | "//dictionary:suffix_dictionary", | |
136 | "//dictionary:suppression_dictionary", | |
137 | "//dictionary:user_dictionary", | |
138 | "//dictionary:user_pos", | |
139 | "//dictionary/system:system_dictionary", | |
140 | "//dictionary/system:value_dictionary", | |
141 | "//prediction:dictionary_predictor", | |
142 | "//prediction:predictor", | |
143 | "//prediction:predictor_interface", | |
144 | "//prediction:suggestion_filter", | |
145 | "//prediction:user_history_predictor", | |
146 | "//rewriter", | |
147 | "//rewriter:rewriter_interface", | |
148 | "@com_google_absl//absl/memory", | |
149 | ], | |
150 | ) | |
151 | ||
152 | cc_library_mozc( | |
153 | name = "mock_converter_engine", | |
154 | testonly = 1, | |
155 | srcs = ["mock_converter_engine.cc"], | |
156 | hdrs = ["mock_converter_engine.h"], | |
157 | visibility = ["//session:__subpackages__"], | |
158 | deps = [ | |
159 | ":engine_interface", | |
160 | ":user_data_manager_mock", | |
161 | "//base", | |
162 | "//base:logging", | |
163 | "//base:port", | |
164 | "//converter:converter_interface", | |
165 | "//converter:converter_mock", | |
166 | ], | |
167 | ) | |
168 | ||
169 | cc_library_mozc( | |
170 | name = "engine_stub", | |
171 | testonly = 1, | |
172 | hdrs = ["engine_stub.h"], | |
173 | visibility = ["//session:__subpackages__"], | |
174 | deps = [":engine_interface"], | |
175 | ) | |
176 | ||
177 | cc_library_mozc( | |
178 | name = "engine_factory", | |
179 | hdrs = ["engine_factory.h"], | |
180 | deps = select_mozc( | |
181 | android = [":android_engine_factory"], | |
182 | default = [":google_engine_factory"], | |
183 | oss = [":oss_engine_factory"], | |
184 | ), | |
185 | ) | |
186 | ||
187 | cc_test_mozc( | |
188 | name = "engine_factory_test", | |
189 | srcs = ["engine_factory_test.cc"], | |
190 | deps = [ | |
191 | ":engine_factory", | |
192 | ":engine_interface", | |
193 | "//base", | |
194 | "//base:logging", | |
195 | "//prediction:predictor_interface", | |
196 | "//testing:gunit_main", | |
197 | ], | |
198 | ) | |
199 | ||
200 | cc_library_mozc( | |
201 | name = "google_engine_factory", | |
202 | hdrs = ["google_engine_factory.h"], | |
203 | visibility = [ | |
204 | "//converter:__pkg__", | |
205 | "//evaluation:__subpackages__", | |
206 | ], | |
207 | deps = [ | |
208 | ":engine", | |
209 | "//base", | |
210 | "//base:logging", | |
211 | "//data_manager/google:google_data_manager", | |
212 | "//prediction:predictor", | |
213 | ], | |
214 | ) | |
215 | ||
216 | cc_library_mozc( | |
217 | name = "android_engine_factory", | |
218 | hdrs = ["android_engine_factory.h"], | |
219 | visibility = [ | |
220 | "//converter:__pkg__", | |
221 | "//evaluation:__subpackages__", | |
222 | ], | |
223 | deps = [ | |
224 | ":engine", | |
225 | "//base:logging", | |
226 | "//data_manager/android:android_data_manager", | |
227 | ], | |
228 | ) | |
229 | ||
230 | cc_library_mozc( | |
231 | name = "chromeos_engine_factory", | |
232 | hdrs = ["chromeos_engine_factory.h"], | |
233 | visibility = ["//evaluation:__subpackages__"], | |
234 | deps = [ | |
235 | ":engine", | |
236 | "//base:logging", | |
237 | "//data_manager/chromeos:chromeos_data_manager", | |
238 | ], | |
239 | ) | |
240 | ||
241 | cc_library_mozc( | |
242 | name = "oss_engine_factory", | |
243 | hdrs = ["oss_engine_factory.h"], | |
244 | visibility = ["//evaluation:__subpackages__"], | |
245 | deps = [ | |
246 | ":engine", | |
247 | "//base:logging", | |
248 | "//data_manager/oss:oss_data_manager", | |
249 | ], | |
250 | ) | |
251 | ||
252 | cc_library_mozc( | |
253 | name = "mock_data_engine_factory", | |
254 | testonly = 1, | |
255 | srcs = ["mock_data_engine_factory.cc"], | |
256 | hdrs = ["mock_data_engine_factory.h"], | |
257 | visibility = [ | |
258 | "//converter:__pkg__", | |
259 | "//evaluation:__pkg__", | |
260 | "//rewriter:__pkg__", | |
261 | "//session:__pkg__", | |
262 | ], | |
263 | deps = [ | |
264 | ":engine", | |
265 | "//base:logging", | |
266 | "//data_manager/testing:mock_data_manager", | |
267 | ], | |
268 | ) | |
269 | ||
270 | cc_library_mozc( | |
271 | name = "small_immutable_converter", | |
272 | srcs = ["small_immutable_converter.cc"], | |
273 | hdrs = ["small_immutable_converter.h"], | |
274 | visibility = ["//visibility:private"], | |
275 | deps = [ | |
276 | "//base", | |
277 | "//base:logging", | |
278 | "//base:port", | |
279 | "//converter:connector", | |
280 | "//converter:immutable_converter_interface", | |
281 | "//converter:immutable_converter_no_factory", | |
282 | "//converter:segmenter", | |
283 | "//converter:segments", | |
284 | "//data_manager/android:android_data_manager", | |
285 | "//dictionary:dictionary_impl", | |
286 | "//dictionary:dictionary_interface", | |
287 | "//dictionary:pos_group", | |
288 | "//dictionary:pos_matcher_lib", | |
289 | "//dictionary:suffix_dictionary", | |
290 | "//dictionary:suppression_dictionary", | |
291 | "//dictionary:user_dictionary_stub", | |
292 | "//dictionary/system:system_dictionary", | |
293 | "//dictionary/system:value_dictionary", | |
294 | "//prediction:suggestion_filter", | |
295 | "@com_google_absl//absl/memory", | |
296 | "@com_google_absl//absl/strings", | |
297 | ], | |
298 | ) | |
299 | ||
300 | cc_library_mozc( | |
301 | name = "large_immutable_converter", | |
302 | srcs = ["large_immutable_converter.cc"], | |
303 | hdrs = ["large_immutable_converter.h"], | |
304 | visibility = [ | |
305 | "//converter:__pkg__", | |
306 | "//rewriter:__pkg__", | |
307 | ], | |
308 | deps = [ | |
309 | "//base", | |
310 | "//base:logging", | |
311 | "//base:port", | |
312 | "//converter:connector", | |
313 | "//converter:immutable_converter_interface", | |
314 | "//converter:immutable_converter_no_factory", | |
315 | "//converter:segmenter", | |
316 | "//converter:segments", | |
317 | "//data_manager:data_manager_interface", | |
318 | "//data_manager/google:google_data_manager", | |
319 | "//dictionary:dictionary_impl", | |
320 | "//dictionary:dictionary_interface", | |
321 | "//dictionary:pos_group", | |
322 | "//dictionary:pos_matcher_lib", | |
323 | "//dictionary:suffix_dictionary", | |
324 | "//dictionary:suppression_dictionary", | |
325 | "//dictionary:user_dictionary_stub", | |
326 | "//dictionary/system:system_dictionary", | |
327 | "//dictionary/system:value_dictionary", | |
328 | "//prediction:suggestion_filter", | |
329 | "@com_google_absl//absl/memory", | |
330 | "@com_google_absl//absl/strings", | |
331 | ], | |
332 | ) | |
333 | ||
334 | cc_library_mozc( | |
335 | name = "user_data_manager_mock", | |
336 | srcs = ["user_data_manager_mock.cc"], | |
337 | hdrs = ["user_data_manager_mock.h"], | |
338 | visibility = [ | |
339 | "//:__subpackages__", | |
340 | ], | |
341 | deps = [ | |
342 | ":user_data_manager_interface", | |
343 | "//base", | |
344 | "//base:port", | |
345 | ], | |
346 | ) | |
347 | ||
348 | cc_library_mozc( | |
349 | name = "user_data_manager_interface", | |
350 | hdrs = ["user_data_manager_interface.h"], | |
351 | visibility = [ | |
352 | # For //session:session_handler_scenario_test. | |
353 | "//session:__pkg__", | |
354 | ], | |
355 | ) | |
356 | ||
357 | cc_library_mozc( | |
358 | name = "minimal_engine", | |
359 | srcs = ["minimal_engine.cc"], | |
360 | hdrs = ["minimal_engine.h"], | |
361 | visibility = [ | |
362 | "//:__subpackages__", | |
363 | ], | |
364 | deps = [ | |
365 | ":engine_interface", | |
366 | ":user_data_manager_interface", | |
367 | "//base:port", | |
368 | "//composer", | |
369 | "//converter:converter_interface", | |
370 | "//converter:segments", | |
371 | "//data_manager", | |
372 | "//dictionary:suppression_dictionary", | |
373 | "//prediction:predictor_interface", | |
374 | "//request:conversion_request", | |
375 | ], | |
376 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//tools/build_defs:qt.bzl", | |
32 | "cc_qt_binary_mozc", | |
33 | "cc_qt_library_mozc", | |
34 | "qt_moc_mozc", | |
35 | "qt_rcc_mozc", | |
36 | "qt_uic_mozc", | |
37 | ) | |
38 | ||
39 | package( | |
40 | default_visibility = ["//gui:__subpackages__"], | |
41 | ) | |
42 | ||
43 | qt_moc_mozc( | |
44 | name = "moc_about_dialog", | |
45 | srcs = ["about_dialog.h"], | |
46 | outs = ["moc_about_dialog.cc"], | |
47 | ) | |
48 | ||
49 | qt_uic_mozc( | |
50 | name = "uic_about_dialog", | |
51 | srcs = ["about_dialog.ui"], | |
52 | outs = ["ui_about_dialog.h"], | |
53 | ) | |
54 | ||
55 | qt_rcc_mozc( | |
56 | name = "qrc_about_dialog", | |
57 | srcs = [ | |
58 | "about_dialog_en.qm", | |
59 | "about_dialog_ja.qm", | |
60 | "//data/images:product_icon_32bpp-128.png", | |
61 | ], | |
62 | outs = ["qrc_about_dialog.cc"], | |
63 | qrc_file = "about_dialog.qrc", | |
64 | qrc_name = "qrc_about_dialog", | |
65 | ) | |
66 | ||
67 | cc_qt_library_mozc( | |
68 | name = "about_dialog", | |
69 | srcs = [ | |
70 | "about_dialog.cc", | |
71 | "about_dialog_libmain.cc", | |
72 | ":moc_about_dialog", | |
73 | ":qrc_about_dialog", | |
74 | ], | |
75 | hdrs = [ | |
76 | "about_dialog.h", | |
77 | ":uic_about_dialog", | |
78 | ], | |
79 | deps = [ | |
80 | "//base:file_util", | |
81 | "//base:port", | |
82 | "//base:process", | |
83 | "//base:run_level", | |
84 | "//base:system_util", | |
85 | "//base:util", | |
86 | "//base:version", | |
87 | "//gui/base:gui_base", | |
88 | "//gui/base:singleton_window_helper", | |
89 | ], | |
90 | ) | |
91 | ||
92 | cc_qt_binary_mozc( | |
93 | name = "about_dialog_main", | |
94 | srcs = ["about_dialog_main.cc"], | |
95 | deps = [ | |
96 | ":about_dialog", | |
97 | "//base:init_mozc", | |
98 | "//gui/base:gui_base", | |
99 | ], | |
100 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//tools/build_defs:qt.bzl", | |
32 | "cc_qt_binary_mozc", | |
33 | "cc_qt_library_mozc", | |
34 | "qt_moc_mozc", | |
35 | "qt_rcc_mozc", | |
36 | "qt_uic_mozc", | |
37 | ) | |
38 | ||
39 | package( | |
40 | default_visibility = ["//gui:__subpackages__"], | |
41 | ) | |
42 | ||
43 | qt_moc_mozc( | |
44 | name = "moc_administration_dialog", | |
45 | srcs = ["administration_dialog.h"], | |
46 | outs = ["moc_administration_dialog.cc"], | |
47 | ) | |
48 | ||
49 | qt_uic_mozc( | |
50 | name = "uic_administration_dialog", | |
51 | srcs = ["administration_dialog.ui"], | |
52 | outs = ["ui_administration_dialog.h"], | |
53 | ) | |
54 | ||
55 | qt_rcc_mozc( | |
56 | name = "qrc_administration_dialog", | |
57 | srcs = [ | |
58 | "administration_dialog_en.qm", | |
59 | "administration_dialog_ja.qm", | |
60 | ], | |
61 | outs = ["qrc_administration_dialog.cc"], | |
62 | qrc_file = "administration_dialog.qrc", | |
63 | qrc_name = "qrc_administration_dialog", | |
64 | ) | |
65 | ||
66 | cc_qt_library_mozc( | |
67 | name = "administration_dialog", | |
68 | srcs = [ | |
69 | "administration_dialog.cc", | |
70 | "administration_dialog_libmain.cc", | |
71 | ":moc_administration_dialog", | |
72 | ":qrc_administration_dialog", | |
73 | ], | |
74 | hdrs = [ | |
75 | "administration_dialog.h", | |
76 | ":uic_administration_dialog", | |
77 | ], | |
78 | deps = [ | |
79 | "//base:file_util", | |
80 | "//base:port", | |
81 | "//base:process", | |
82 | "//base:run_level", | |
83 | "//base:system_util", | |
84 | "//base:util", | |
85 | "//base:version", | |
86 | "//config:stats_config_util", | |
87 | "//gui/base:gui_base", | |
88 | "//gui/base:singleton_window_helper", | |
89 | ], | |
90 | ) | |
91 | ||
92 | cc_qt_binary_mozc( | |
93 | name = "administration_dialog_main", | |
94 | srcs = ["administration_dialog_main.cc"], | |
95 | deps = [ | |
96 | ":administration_dialog", | |
97 | "//base:init_mozc", | |
98 | "//gui/base:gui_base", | |
99 | ], | |
100 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | ) | |
34 | load( | |
35 | "//tools/build_defs:qt.bzl", | |
36 | "cc_qt_library_mozc", | |
37 | "qt_moc_mozc", | |
38 | ) | |
39 | ||
40 | package( | |
41 | default_visibility = ["//gui:__subpackages__"], | |
42 | ) | |
43 | ||
44 | cc_library_mozc( | |
45 | name = "encoding_util", | |
46 | srcs = ["encoding_util.cc"], | |
47 | hdrs = [ | |
48 | "encoding_util.h", | |
49 | "sjis_to_ucs2_table.h", | |
50 | ], | |
51 | deps = [ | |
52 | "//base:port", | |
53 | "//base:util", | |
54 | "@com_google_absl//absl/strings", | |
55 | ], | |
56 | ) | |
57 | ||
58 | qt_moc_mozc( | |
59 | name = "base_files", | |
60 | srcs = ["window_title_modifier.h"], | |
61 | outs = ["moc_window_title_modifier.cc"], | |
62 | ) | |
63 | ||
64 | cc_qt_library_mozc( | |
65 | name = "gui_base", | |
66 | srcs = [ | |
67 | "debug_util.cc", | |
68 | "locale_util.cc", | |
69 | "table_util.cc", | |
70 | "util.cc", | |
71 | "win_util.cc", | |
72 | "window_title_modifier.cc", | |
73 | ":base_files", | |
74 | ], | |
75 | hdrs = [ | |
76 | "debug_util.h", | |
77 | "locale_util.h", | |
78 | "table_util.h", | |
79 | "util.h", | |
80 | "win_util.h", | |
81 | "window_title_modifier.h", | |
82 | ], | |
83 | deps = [ | |
84 | ":encoding_util", | |
85 | "//base", | |
86 | "//base:logging", | |
87 | "//base:port", | |
88 | "//base:singleton", | |
89 | "//base:system_util", | |
90 | "//base:util", | |
91 | "//base:version", | |
92 | "@com_google_absl//absl/strings", | |
93 | ], | |
94 | ) | |
95 | ||
96 | cc_qt_library_mozc( | |
97 | name = "msime_user_dictionary_importer", | |
98 | srcs = [ | |
99 | "msime_user_dictionary_importer.cc", | |
100 | ], | |
101 | hdrs = [ | |
102 | "msime_user_dictionary_importer.h", | |
103 | ], | |
104 | deps = [ | |
105 | "//base:port", | |
106 | "//dictionary:user_dictionary_importer", | |
107 | ], | |
108 | ) | |
109 | ||
110 | cc_library_mozc( | |
111 | name = "setup_util", | |
112 | srcs = [ | |
113 | "setup_util.cc", | |
114 | ], | |
115 | hdrs = [ | |
116 | "setup_util.h", | |
117 | ], | |
118 | deps = [ | |
119 | ":gui_base", | |
120 | ":msime_user_dictionary_importer", | |
121 | "//base:logging", | |
122 | "//base:port", | |
123 | "//dictionary:user_dictionary", | |
124 | "//dictionary:user_dictionary_importer", | |
125 | "//dictionary:user_dictionary_storage", | |
126 | "//dictionary:user_dictionary_util", | |
127 | "//usage_stats", | |
128 | ], | |
129 | ) | |
130 | ||
131 | cc_qt_library_mozc( | |
132 | name = "singleton_window_helper", | |
133 | srcs = [ | |
134 | "singleton_window_helper.cc", | |
135 | ], | |
136 | hdrs = [ | |
137 | "singleton_window_helper.h", | |
138 | ], | |
139 | deps = [ | |
140 | ":gui_base", | |
141 | "//base:file_stream", | |
142 | "//base:logging", | |
143 | "//base:mutex", | |
144 | "//base:port", | |
145 | "//base:process_mutex", | |
146 | "//base:scoped_handle", | |
147 | "//base:util", | |
148 | "//base:version", | |
149 | "//ipc", | |
150 | "//ipc:window_info_proto", | |
151 | ], | |
152 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//tools/build_defs:qt.bzl", | |
32 | "cc_qt_binary_mozc", | |
33 | "cc_qt_library_mozc", | |
34 | "qt_moc_mozc", | |
35 | "qt_rcc_mozc", | |
36 | "qt_uic_mozc", | |
37 | ) | |
38 | ||
39 | package( | |
40 | default_visibility = ["//gui:__subpackages__"], | |
41 | ) | |
42 | ||
43 | qt_moc_mozc( | |
44 | name = "moc_character_form_editor", | |
45 | srcs = [ | |
46 | "character_form_editor.h", | |
47 | ], | |
48 | outs = ["moc_character_form_editor.cc"], | |
49 | ) | |
50 | ||
51 | qt_moc_mozc( | |
52 | name = "moc_combobox_delegate", | |
53 | srcs = [ | |
54 | "combobox_delegate.h", | |
55 | ], | |
56 | outs = ["moc_combobox_delegate.cc"], | |
57 | ) | |
58 | ||
59 | qt_moc_mozc( | |
60 | name = "moc_config_dialog", | |
61 | srcs = [ | |
62 | "config_dialog.h", | |
63 | ], | |
64 | outs = ["moc_config_dialog.cc"], | |
65 | ) | |
66 | ||
67 | qt_moc_mozc( | |
68 | name = "moc_generic_table_editor", | |
69 | srcs = [ | |
70 | "generic_table_editor.h", | |
71 | ], | |
72 | outs = ["moc_generic_table_editor.cc"], | |
73 | ) | |
74 | ||
75 | qt_moc_mozc( | |
76 | name = "moc_keybinding_editor", | |
77 | srcs = [ | |
78 | "keybinding_editor.h", | |
79 | ], | |
80 | outs = ["moc_keybinding_editor.cc"], | |
81 | ) | |
82 | ||
83 | qt_moc_mozc( | |
84 | name = "moc_keybinding_editor_delegate", | |
85 | srcs = [ | |
86 | "keybinding_editor_delegate.h", | |
87 | ], | |
88 | outs = ["moc_keybinding_editor_delegate.cc"], | |
89 | ) | |
90 | ||
91 | qt_moc_mozc( | |
92 | name = "moc_keymap_editor", | |
93 | srcs = [ | |
94 | "keymap_editor.h", | |
95 | ], | |
96 | outs = ["moc_keymap_editor.cc"], | |
97 | ) | |
98 | ||
99 | qt_moc_mozc( | |
100 | name = "moc_roman_table_editor", | |
101 | srcs = [ | |
102 | "roman_table_editor.h", | |
103 | ], | |
104 | outs = ["moc_roman_table_editor.cc"], | |
105 | ) | |
106 | ||
107 | qt_uic_mozc( | |
108 | name = "uic_config_dialog", | |
109 | srcs = [ | |
110 | "config_dialog.ui", | |
111 | ], | |
112 | outs = ["ui_config_dialog.h"], | |
113 | ) | |
114 | ||
115 | qt_uic_mozc( | |
116 | name = "uic_generic_table_editor", | |
117 | srcs = [ | |
118 | "generic_table_editor.ui", | |
119 | ], | |
120 | outs = ["ui_generic_table_editor.h"], | |
121 | ) | |
122 | ||
123 | qt_uic_mozc( | |
124 | name = "uic_keybinding_editor", | |
125 | srcs = [ | |
126 | "keybinding_editor.ui", | |
127 | ], | |
128 | outs = ["ui_keybinding_editor.h"], | |
129 | ) | |
130 | ||
131 | qt_rcc_mozc( | |
132 | name = "qrc_config_dialog", | |
133 | srcs = [ | |
134 | "config_dialog_en.qm", | |
135 | "config_dialog_ja.qm", | |
136 | "keymap_en.qm", | |
137 | "keymap_ja.qm", | |
138 | ], | |
139 | outs = ["qrc_config_dialog.cc"], | |
140 | qrc_file = "config_dialog.qrc", | |
141 | qrc_name = "qrc_config_dialog", | |
142 | ) | |
143 | ||
144 | cc_qt_library_mozc( | |
145 | name = "combobox_delegate", | |
146 | srcs = [ | |
147 | "combobox_delegate.cc", | |
148 | ":moc_combobox_delegate", | |
149 | ], | |
150 | hdrs = [ | |
151 | "combobox_delegate.h", | |
152 | ], | |
153 | ) | |
154 | ||
155 | cc_qt_library_mozc( | |
156 | name = "config_dialog", | |
157 | srcs = [ | |
158 | "character_form_editor.cc", | |
159 | "config_dialog.cc", | |
160 | "config_dialog_libmain.cc", | |
161 | "generic_table_editor.cc", | |
162 | "keybinding_editor.cc", | |
163 | "keybinding_editor_delegate.cc", | |
164 | "keymap_editor.cc", | |
165 | "roman_table_editor.cc", | |
166 | ":moc_character_form_editor", | |
167 | ":moc_config_dialog", | |
168 | ":moc_generic_table_editor", | |
169 | ":moc_keybinding_editor", | |
170 | ":moc_keybinding_editor_delegate", | |
171 | ":moc_keymap_editor", | |
172 | ":moc_roman_table_editor", | |
173 | ":qrc_config_dialog", | |
174 | ], | |
175 | hdrs = [ | |
176 | "character_form_editor.h", | |
177 | "config_dialog.h", | |
178 | "generic_table_editor.h", | |
179 | "keybinding_editor.h", | |
180 | "keybinding_editor_delegate.h", | |
181 | "keymap_editor.h", | |
182 | "roman_table_editor.h", | |
183 | ":uic_config_dialog", | |
184 | ":uic_generic_table_editor", | |
185 | ":uic_keybinding_editor", | |
186 | ], | |
187 | deps = [ | |
188 | ":combobox_delegate", | |
189 | "//base:config_file_stream", | |
190 | "//base:file_stream", | |
191 | "//base:file_util", | |
192 | "//base:logging", | |
193 | "//base:port", | |
194 | "//base:process", | |
195 | "//base:run_level", | |
196 | "//base:singleton", | |
197 | "//base:system_util", | |
198 | "//base:util", | |
199 | "//base:version", | |
200 | "//client", | |
201 | "//composer:key_parser", | |
202 | "//config:config_handler", | |
203 | "//config:stats_config_util", | |
204 | "//gui/base:gui_base", | |
205 | "//gui/base:singleton_window_helper", | |
206 | "//protocol:commands_proto", | |
207 | "//protocol:config_proto", | |
208 | "//session/internal:keymap", | |
209 | ], | |
210 | ) | |
211 | ||
212 | cc_qt_binary_mozc( | |
213 | name = "config_dialog_main", | |
214 | srcs = ["config_dialog_main.cc"], | |
215 | deps = [ | |
216 | ":config_dialog", | |
217 | "//base:init_mozc", | |
218 | "//gui/base:gui_base", | |
219 | ], | |
220 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//tools/build_defs:qt.bzl", | |
32 | "cc_qt_binary_mozc", | |
33 | "cc_qt_library_mozc", | |
34 | "qt_moc_mozc", | |
35 | "qt_rcc_mozc", | |
36 | ) | |
37 | ||
38 | package( | |
39 | default_visibility = ["//gui:__subpackages__"], | |
40 | ) | |
41 | ||
42 | qt_moc_mozc( | |
43 | name = "moc_confirmation_dialog", | |
44 | srcs = ["confirmation_dialog.h"], | |
45 | outs = ["moc_confirmation_dialog.cc"], | |
46 | ) | |
47 | ||
48 | qt_rcc_mozc( | |
49 | name = "qrc_confirmation_dialog", | |
50 | srcs = [ | |
51 | "confirmation_dialog_en.qm", | |
52 | "confirmation_dialog_ja.qm", | |
53 | ], | |
54 | outs = ["qrc_confirmation_dialog.cc"], | |
55 | qrc_file = "confirmation_dialog.qrc", | |
56 | qrc_name = "qrc_confirmation_dialog", | |
57 | ) | |
58 | ||
59 | cc_qt_library_mozc( | |
60 | name = "confirmation_dialog", | |
61 | srcs = [ | |
62 | "confirmation_dialog.cc", | |
63 | "confirmation_dialog_libmain.cc", | |
64 | ":moc_confirmation_dialog", | |
65 | ":qrc_confirmation_dialog", | |
66 | ], | |
67 | hdrs = [ | |
68 | "confirmation_dialog.h", | |
69 | ], | |
70 | deps = [ | |
71 | "//base:file_util", | |
72 | "//base:flags", | |
73 | "//base:logging", | |
74 | "//base:port", | |
75 | "//base:process", | |
76 | "//base:process_mutex", | |
77 | "//base:run_level", | |
78 | "//base:system_util", | |
79 | "//base:util", | |
80 | "//base:version", | |
81 | "//gui/base:gui_base", | |
82 | "//gui/base:singleton_window_helper", | |
83 | ], | |
84 | ) | |
85 | ||
86 | cc_qt_binary_mozc( | |
87 | name = "confirmation_dialog_main", | |
88 | srcs = ["confirmation_dialog_main.cc"], | |
89 | deps = [ | |
90 | ":confirmation_dialog", | |
91 | "//base:init_mozc", | |
92 | "//gui/base:gui_base", | |
93 | ], | |
94 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//tools/build_defs:qt.bzl", | |
32 | "cc_qt_binary_mozc", | |
33 | "cc_qt_library_mozc", | |
34 | "qt_moc_mozc", | |
35 | "qt_rcc_mozc", | |
36 | "qt_uic_mozc", | |
37 | ) | |
38 | ||
39 | package( | |
40 | default_visibility = ["//gui:__subpackages__"], | |
41 | ) | |
42 | ||
43 | qt_moc_mozc( | |
44 | name = "moc_dictionary_content_table_widget", | |
45 | srcs = [ | |
46 | "dictionary_content_table_widget.h", | |
47 | ], | |
48 | outs = ["moc_dictionary_content_table_widget.cc"], | |
49 | ) | |
50 | ||
51 | qt_moc_mozc( | |
52 | name = "moc_dictionary_tool", | |
53 | srcs = [ | |
54 | "dictionary_tool.h", | |
55 | ], | |
56 | outs = ["moc_dictionary_tool.cc"], | |
57 | ) | |
58 | ||
59 | qt_moc_mozc( | |
60 | name = "moc_find_dialog", | |
61 | srcs = [ | |
62 | "find_dialog.h", | |
63 | ], | |
64 | outs = ["moc_find_dialog.cc"], | |
65 | ) | |
66 | ||
67 | qt_moc_mozc( | |
68 | name = "moc_import_dialog", | |
69 | srcs = [ | |
70 | "import_dialog.h", | |
71 | ], | |
72 | outs = ["moc_import_dialog.cc"], | |
73 | ) | |
74 | ||
75 | qt_moc_mozc( | |
76 | name = "moc_zero_width_splitter", | |
77 | srcs = [ | |
78 | "zero_width_splitter.h", | |
79 | ], | |
80 | outs = ["moc_zero_width_splitter.cc"], | |
81 | ) | |
82 | ||
83 | qt_uic_mozc( | |
84 | name = "uic_dictionary_tool", | |
85 | srcs = [ | |
86 | "dictionary_tool.ui", | |
87 | ], | |
88 | outs = ["ui_dictionary_tool.h"], | |
89 | ) | |
90 | ||
91 | qt_uic_mozc( | |
92 | name = "uic_find_dialog", | |
93 | srcs = [ | |
94 | "find_dialog.ui", | |
95 | ], | |
96 | outs = ["ui_find_dialog.h"], | |
97 | ) | |
98 | ||
99 | qt_uic_mozc( | |
100 | name = "uic_import_dialog", | |
101 | srcs = [ | |
102 | "import_dialog.ui", | |
103 | ], | |
104 | outs = ["ui_import_dialog.h"], | |
105 | ) | |
106 | ||
107 | qt_rcc_mozc( | |
108 | name = "qrc_dictionary_tool", | |
109 | srcs = [ | |
110 | "dictionary_tool_en.qm", | |
111 | "dictionary_tool_ja.qm", | |
112 | ], | |
113 | outs = ["qrc_dictionary_tool.cc"], | |
114 | qrc_file = "dictionary_tool.qrc", | |
115 | qrc_name = "qrc_dictionary_tool", | |
116 | ) | |
117 | ||
118 | cc_qt_library_mozc( | |
119 | name = "dictionary_tool", | |
120 | srcs = [ | |
121 | "dictionary_content_table_widget.cc", | |
122 | "dictionary_tool.cc", | |
123 | "dictionary_tool_libmain.cc", | |
124 | "find_dialog.cc", | |
125 | "import_dialog.cc", | |
126 | "zero_width_splitter.cc", | |
127 | ":moc_dictionary_content_table_widget", | |
128 | ":moc_dictionary_tool", | |
129 | ":moc_find_dialog", | |
130 | ":moc_import_dialog", | |
131 | ":moc_zero_width_splitter", | |
132 | ":qrc_dictionary_tool", | |
133 | ], | |
134 | hdrs = [ | |
135 | "dictionary_content_table_widget.h", | |
136 | "dictionary_tool.h", | |
137 | "find_dialog.h", | |
138 | "import_dialog.h", | |
139 | "zero_width_splitter.h", | |
140 | ":uic_dictionary_tool", | |
141 | ":uic_find_dialog", | |
142 | ":uic_import_dialog", | |
143 | ], | |
144 | deps = [ | |
145 | "//base:file_stream", | |
146 | "//base:file_util", | |
147 | "//base:logging", | |
148 | "//base:port", | |
149 | "//base:process", | |
150 | "//base:run_level", | |
151 | "//base:system_util", | |
152 | "//base:util", | |
153 | "//base:version", | |
154 | "//client", | |
155 | "//config:config_handler", | |
156 | "//data_manager:pos_list_provider", | |
157 | "//dictionary:user_dictionary", | |
158 | "//dictionary:user_dictionary_importer", | |
159 | "//dictionary:user_dictionary_session", | |
160 | "//dictionary:user_dictionary_storage", | |
161 | "//dictionary:user_dictionary_util", | |
162 | "//gui/base:encoding_util", | |
163 | "//gui/base:gui_base", | |
164 | "//gui/base:msime_user_dictionary_importer", | |
165 | "//gui/base:singleton_window_helper", | |
166 | "//gui/config_dialog:combobox_delegate", | |
167 | "//protocol:commands_proto", | |
168 | "//protocol:config_proto", | |
169 | "//protocol:user_dictionary_storage_proto", | |
170 | ], | |
171 | ) | |
172 | ||
173 | cc_qt_binary_mozc( | |
174 | name = "dictionary_tool_main", | |
175 | srcs = ["dictionary_tool_main.cc"], | |
176 | deps = [ | |
177 | ":dictionary_tool", | |
178 | "//base:flags", | |
179 | "//base:init_mozc", | |
180 | "//gui/base:gui_base", | |
181 | ], | |
182 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//tools/build_defs:qt.bzl", | |
32 | "cc_qt_binary_mozc", | |
33 | "cc_qt_library_mozc", | |
34 | "qt_moc_mozc", | |
35 | "qt_rcc_mozc", | |
36 | ) | |
37 | ||
38 | package( | |
39 | default_visibility = ["//gui:__subpackages__"], | |
40 | ) | |
41 | ||
42 | qt_moc_mozc( | |
43 | name = "moc_error_message_dialog", | |
44 | srcs = ["error_message_dialog.h"], | |
45 | outs = ["moc_error_message_dialog.cc"], | |
46 | ) | |
47 | ||
48 | qt_rcc_mozc( | |
49 | name = "qrc_error_message_dialog", | |
50 | srcs = [ | |
51 | "error_message_dialog_en.qm", | |
52 | "error_message_dialog_ja.qm", | |
53 | ], | |
54 | outs = ["qrc_error_message_dialog.cc"], | |
55 | qrc_file = "error_message_dialog.qrc", | |
56 | qrc_name = "qrc_error_message_dialog", | |
57 | ) | |
58 | ||
59 | cc_qt_library_mozc( | |
60 | name = "error_message_dialog", | |
61 | srcs = [ | |
62 | "error_message_dialog.cc", | |
63 | "error_message_dialog_libmain.cc", | |
64 | ":moc_error_message_dialog", | |
65 | ":qrc_error_message_dialog", | |
66 | ], | |
67 | hdrs = [ | |
68 | "error_message_dialog.h", | |
69 | ], | |
70 | deps = [ | |
71 | "//base:file_util", | |
72 | "//base:flags", | |
73 | "//base:logging", | |
74 | "//base:port", | |
75 | "//base:process", | |
76 | "//base:process_mutex", | |
77 | "//base:run_level", | |
78 | "//base:system_util", | |
79 | "//base:util", | |
80 | "//base:version", | |
81 | "//gui/base:gui_base", | |
82 | "//gui/base:singleton_window_helper", | |
83 | ], | |
84 | ) | |
85 | ||
86 | cc_qt_binary_mozc( | |
87 | name = "error_message_dialog_main", | |
88 | srcs = ["error_message_dialog_main.cc"], | |
89 | deps = [ | |
90 | ":error_message_dialog", | |
91 | "//base:init_mozc", | |
92 | "//gui/base:gui_base", | |
93 | ], | |
94 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//tools/build_defs:qt.bzl", | |
32 | "cc_qt_binary_mozc", | |
33 | "cc_qt_library_mozc", | |
34 | "qt_moc_mozc", | |
35 | "qt_rcc_mozc", | |
36 | "qt_uic_mozc", | |
37 | ) | |
38 | ||
39 | package( | |
40 | default_visibility = ["//gui:__subpackages__"], | |
41 | ) | |
42 | ||
43 | qt_moc_mozc( | |
44 | name = "moc_post_install_dialog", | |
45 | srcs = ["post_install_dialog.h"], | |
46 | outs = ["moc_post_install_dialog.cc"], | |
47 | ) | |
48 | ||
49 | qt_uic_mozc( | |
50 | name = "uic_post_install_dialog", | |
51 | srcs = ["post_install_dialog.ui"], | |
52 | outs = ["ui_post_install_dialog.h"], | |
53 | ) | |
54 | ||
55 | qt_rcc_mozc( | |
56 | name = "qrc_post_install_dialog", | |
57 | srcs = [ | |
58 | "post_install_dialog_en.qm", | |
59 | "post_install_dialog_ja.qm", | |
60 | ], | |
61 | outs = ["qrc_post_install_dialog.cc"], | |
62 | qrc_file = "post_install_dialog.qrc", | |
63 | qrc_name = "qrc_post_install_dialog", | |
64 | ) | |
65 | ||
66 | cc_qt_library_mozc( | |
67 | name = "post_install_dialog", | |
68 | srcs = [ | |
69 | "post_install_dialog.cc", | |
70 | "post_install_dialog_libmain.cc", | |
71 | ":moc_post_install_dialog", | |
72 | ":qrc_post_install_dialog", | |
73 | ], | |
74 | hdrs = [ | |
75 | "post_install_dialog.h", | |
76 | ":uic_post_install_dialog", | |
77 | ], | |
78 | deps = [ | |
79 | "//base:file_util", | |
80 | "//base:logging", | |
81 | "//base:port", | |
82 | "//base:process", | |
83 | "//base:process_mutex", | |
84 | "//base:run_level", | |
85 | "//base:system_util", | |
86 | "//base:util", | |
87 | "//base:version", | |
88 | "//gui/base:gui_base", | |
89 | "//gui/base:setup_util", | |
90 | "//gui/base:singleton_window_helper", | |
91 | "//usage_stats", | |
92 | ], | |
93 | ) | |
94 | ||
95 | cc_qt_binary_mozc( | |
96 | name = "post_install_dialog_main", | |
97 | srcs = ["post_install_dialog_main.cc"], | |
98 | deps = [ | |
99 | ":post_install_dialog", | |
100 | "//base:init_mozc", | |
101 | "//gui/base:gui_base", | |
102 | ], | |
103 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//tools/build_defs:qt.bzl", | |
32 | "cc_qt_binary_mozc", | |
33 | "cc_qt_library_mozc", | |
34 | "qt_moc_mozc", | |
35 | "qt_rcc_mozc", | |
36 | "qt_uic_mozc", | |
37 | ) | |
38 | ||
39 | package( | |
40 | default_visibility = ["//gui:__subpackages__"], | |
41 | ) | |
42 | ||
43 | qt_moc_mozc( | |
44 | name = "moc_set_default_dialog", | |
45 | srcs = ["set_default_dialog.h"], | |
46 | outs = ["moc_set_default_dialog.cc"], | |
47 | ) | |
48 | ||
49 | qt_uic_mozc( | |
50 | name = "uic_set_default_dialog", | |
51 | srcs = ["set_default_dialog.ui"], | |
52 | outs = ["ui_set_default_dialog.h"], | |
53 | ) | |
54 | ||
55 | qt_rcc_mozc( | |
56 | name = "qrc_set_default_dialog", | |
57 | srcs = [ | |
58 | "set_default_dialog_en.qm", | |
59 | "set_default_dialog_ja.qm", | |
60 | ], | |
61 | outs = ["qrc_set_default_dialog.cc"], | |
62 | qrc_file = "set_default_dialog.qrc", | |
63 | qrc_name = "qrc_set_default_dialog", | |
64 | ) | |
65 | ||
66 | cc_qt_library_mozc( | |
67 | name = "set_default_dialog", | |
68 | srcs = [ | |
69 | "set_default_dialog.cc", | |
70 | "set_default_dialog_libmain.cc", | |
71 | ":moc_set_default_dialog", | |
72 | ":qrc_set_default_dialog", | |
73 | ], | |
74 | hdrs = [ | |
75 | "set_default_dialog.h", | |
76 | ":uic_set_default_dialog", | |
77 | ], | |
78 | deps = [ | |
79 | "//base:file_util", | |
80 | "//base:logging", | |
81 | "//base:port", | |
82 | "//base:process", | |
83 | "//base:process_mutex", | |
84 | "//base:run_level", | |
85 | "//base:system_util", | |
86 | "//base:util", | |
87 | "//base:version", | |
88 | "//client", | |
89 | "//config:config_handler", | |
90 | "//gui/base:gui_base", | |
91 | "//gui/base:singleton_window_helper", | |
92 | "//protocol:config_proto", | |
93 | ], | |
94 | ) | |
95 | ||
96 | cc_qt_binary_mozc( | |
97 | name = "set_default_dialog_main", | |
98 | srcs = ["set_default_dialog_main.cc"], | |
99 | deps = [ | |
100 | ":set_default_dialog", | |
101 | "//base:init_mozc", | |
102 | "//gui/base:gui_base", | |
103 | ], | |
104 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load("//:build_defs.bzl", "cc_library_mozc") | |
31 | load( | |
32 | "//tools/build_defs:qt.bzl", | |
33 | "cc_qt_binary_mozc", | |
34 | "cc_qt_library_mozc", | |
35 | "qt_rcc_mozc", | |
36 | ) | |
37 | ||
38 | package( | |
39 | default_visibility = ["//gui:__subpackages__"], | |
40 | ) | |
41 | ||
42 | cc_library_mozc( | |
43 | name = "prelauncher_lib", | |
44 | srcs = ["prelauncher_libmain.cc"], | |
45 | deps = [ | |
46 | "//base:flags", | |
47 | "//base:mac_util", | |
48 | "//client", | |
49 | "//client:client_interface", | |
50 | "//renderer:renderer_client", | |
51 | ], | |
52 | ) | |
53 | ||
54 | cc_qt_library_mozc( | |
55 | name = "mozc_tool_lib", | |
56 | srcs = [ | |
57 | "mozc_tool_libmain.cc", | |
58 | ], | |
59 | hdrs = [ | |
60 | "mozc_tool_libmain.h", | |
61 | ], | |
62 | deps = [ | |
63 | "//base:crash_report_handler", | |
64 | "//base:file_util", | |
65 | "//base:flags", | |
66 | "//base:init_mozc", | |
67 | "//base:logging", | |
68 | "//base:port", | |
69 | "//base:process", | |
70 | "//base:run_level", | |
71 | "//base:system_util", | |
72 | "//base:util", | |
73 | "//base:version", | |
74 | "//config:stats_config_util", | |
75 | "//gui/about_dialog", | |
76 | "//gui/administration_dialog", | |
77 | "//gui/base:gui_base", | |
78 | "//gui/base:singleton_window_helper", | |
79 | "//gui/config_dialog", | |
80 | "//gui/confirmation_dialog", | |
81 | "//gui/dictionary_tool", | |
82 | "//gui/error_message_dialog", | |
83 | "//gui/post_install_dialog", | |
84 | "//gui/set_default_dialog", | |
85 | "//gui/word_register_dialog", | |
86 | ], | |
87 | ) | |
88 | ||
89 | cc_qt_binary_mozc( | |
90 | name = "mozc_tool", | |
91 | srcs = ["mozc_tool_main.cc"], | |
92 | deps = [ | |
93 | ":mozc_tool_lib", | |
94 | "//base:init_mozc", | |
95 | "//gui/base:gui_base", | |
96 | ], | |
97 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//tools/build_defs:qt.bzl", | |
32 | "cc_qt_binary_mozc", | |
33 | "cc_qt_library_mozc", | |
34 | "qt_moc_mozc", | |
35 | "qt_rcc_mozc", | |
36 | "qt_uic_mozc", | |
37 | ) | |
38 | ||
39 | package( | |
40 | default_visibility = ["//gui:__subpackages__"], | |
41 | ) | |
42 | ||
43 | qt_moc_mozc( | |
44 | name = "moc_word_register_dialog", | |
45 | srcs = ["word_register_dialog.h"], | |
46 | outs = ["moc_word_register_dialog.cc"], | |
47 | ) | |
48 | ||
49 | qt_uic_mozc( | |
50 | name = "uic_word_register_dialog", | |
51 | srcs = ["word_register_dialog.ui"], | |
52 | outs = ["ui_word_register_dialog.h"], | |
53 | ) | |
54 | ||
55 | qt_rcc_mozc( | |
56 | name = "qrc_word_register_dialog", | |
57 | srcs = [ | |
58 | "word_register_dialog_en.qm", | |
59 | "word_register_dialog_ja.qm", | |
60 | ], | |
61 | outs = ["qrc_word_register_dialog.cc"], | |
62 | qrc_file = "word_register_dialog.qrc", | |
63 | qrc_name = "qrc_word_register_dialog", | |
64 | ) | |
65 | ||
66 | cc_qt_library_mozc( | |
67 | name = "word_register_dialog", | |
68 | srcs = [ | |
69 | "word_register_dialog.cc", | |
70 | "word_register_dialog_libmain.cc", | |
71 | ":moc_word_register_dialog", | |
72 | ":qrc_word_register_dialog", | |
73 | ], | |
74 | hdrs = [ | |
75 | "word_register_dialog.h", | |
76 | ":uic_word_register_dialog", | |
77 | ], | |
78 | deps = [ | |
79 | "//base", | |
80 | "//base:logging", | |
81 | "//base:port", | |
82 | "//base:system_util", | |
83 | "//base:util", | |
84 | "//client", | |
85 | "//data_manager:pos_list_provider", | |
86 | "//dictionary:pos_matcher_lib", | |
87 | "//dictionary:user_dictionary", | |
88 | "//dictionary:user_dictionary_session", | |
89 | "//dictionary:user_dictionary_storage", | |
90 | "//dictionary:user_dictionary_util", | |
91 | "//gui/base:gui_base", | |
92 | "//gui/base:singleton_window_helper", | |
93 | "//protocol:commands_proto", | |
94 | "//protocol:user_dictionary_storage_proto", | |
95 | ], | |
96 | ) | |
97 | ||
98 | cc_qt_binary_mozc( | |
99 | name = "word_register_dialog_main", | |
100 | srcs = ["word_register_dialog_main.cc"], | |
101 | deps = [ | |
102 | ":word_register_dialog", | |
103 | "//base:init_mozc", | |
104 | "//gui/base:gui_base", | |
105 | ], | |
106 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | ) | |
35 | ||
36 | cc_library_mozc( | |
37 | name = "ios_engine", | |
38 | srcs = ["ios_engine.cc"], | |
39 | hdrs = ["ios_engine.h"], | |
40 | visibility = [ | |
41 | ], | |
42 | deps = [ | |
43 | "//base", | |
44 | "//base:flags", | |
45 | "//base:logging", | |
46 | "//base:mutex", | |
47 | "//base:port", | |
48 | "//config:config_handler", | |
49 | "//data_manager", | |
50 | "//engine", | |
51 | "//engine:engine_builder", | |
52 | "//engine:minimal_engine", | |
53 | "//protocol:commands_proto", | |
54 | "//protocol:config_proto", | |
55 | "//protocol:user_dictionary_storage_proto", | |
56 | "//session", | |
57 | "//session:session_handler", | |
58 | "//session:session_handler_interface", | |
59 | "@com_google_absl//absl/base:core_headers", | |
60 | ], | |
61 | ) | |
62 | ||
63 | cc_binary_mozc( | |
64 | name = "ios_engine_main", | |
65 | srcs = ["ios_engine_main.cc"], | |
66 | data = ["//data_manager/google:mozc.data"], | |
67 | deps = [ | |
68 | ":ios_engine", | |
69 | "//base:flags", | |
70 | "//base:init_mozc_buildtool", | |
71 | "//base:logging", | |
72 | "//base:util", | |
73 | "//protocol:candidates_proto", | |
74 | ], | |
75 | ) | |
76 | ||
77 | cc_library_mozc( | |
78 | name = "ios_engine_stub", | |
79 | srcs = ["ios_engine_stub.cc"], | |
80 | hdrs = ["ios_engine.h"], | |
81 | deps = [ | |
82 | "//base:mutex", | |
83 | "//base:port", | |
84 | "//protocol:commands_proto", | |
85 | "//protocol:config_proto", | |
86 | "@com_google_absl//absl/base:core_headers", | |
87 | ], | |
88 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | "select_mozc", | |
35 | ) | |
36 | load("//tools/build_defs:stubs.bzl", "portable_proto_library") | |
37 | ||
38 | package(default_visibility = ["//:__subpackages__"]) | |
39 | ||
40 | cc_library_mozc( | |
41 | name = "ipc", | |
42 | srcs = [ | |
43 | "ipc.cc", | |
44 | "mach_ipc.cc", | |
45 | "unix_ipc.cc", | |
46 | "win32_ipc.cc", | |
47 | ], | |
48 | hdrs = ["ipc.h"], | |
49 | deps = [ | |
50 | ":ipc_path_manager", | |
51 | "//base", | |
52 | "//base:cpu_stats", | |
53 | "//base:file_util", | |
54 | "//base:logging", | |
55 | "//base:port", | |
56 | "//base:scoped_handle", | |
57 | "//base:singleton", | |
58 | "//base:system_util", | |
59 | "//base:thread", | |
60 | "//base:util", | |
61 | "//base:win_util", | |
62 | ] + select_mozc( | |
63 | ios = ["//base:mac_util"], | |
64 | ), | |
65 | ) | |
66 | ||
67 | proto_library( | |
68 | name = "ipc_proto_full", | |
69 | srcs = ["ipc.proto"], | |
70 | visibility = ["//visibility:private"], | |
71 | ) | |
72 | ||
73 | portable_proto_library( | |
74 | name = "ipc_proto", | |
75 | config_string = "allow_all: true", | |
76 | header_outs = ["ipc.pb.h"], | |
77 | proto_deps = [":ipc_proto_full"], | |
78 | visibility = ["//visibility:private"], | |
79 | ) | |
80 | ||
81 | cc_library_mozc( | |
82 | name = "ipc_path_manager", | |
83 | srcs = ["ipc_path_manager.cc"], | |
84 | hdrs = ["ipc_path_manager.h"], | |
85 | deps = [ | |
86 | ":ipc_hdr", | |
87 | ":ipc_proto", | |
88 | "//base", | |
89 | "//base:file_stream", | |
90 | "//base:file_util", | |
91 | "//base:logging", | |
92 | "//base:mutex", | |
93 | "//base:obfuscator_support", | |
94 | "//base:port", | |
95 | "//base:process_mutex", | |
96 | "//base:scoped_handle", | |
97 | "//base:singleton", | |
98 | "//base:system_util", | |
99 | "//base:util", | |
100 | "//base:version", | |
101 | "//base:win_util", | |
102 | "//testing:gunit_prod", | |
103 | "@com_google_absl//absl/strings:str_format", | |
104 | ] + select_mozc( | |
105 | ios = ["//base:mac_util"], | |
106 | ), | |
107 | ) | |
108 | ||
109 | ## cc_binary_mozc(name = "ipc_path_manager_main", | |
110 | ## srcs = ["ipc_path_manager_main.cc",], | |
111 | ## deps = [":ipc_path_manager", | |
112 | ## "//base:base",]) | |
113 | ||
114 | cc_test_mozc( | |
115 | name = "ipc_path_manager_test", | |
116 | size = "small", | |
117 | srcs = ["ipc_path_manager_test.cc"], | |
118 | deps = [ | |
119 | ":ipc", | |
120 | ":ipc_path_manager", | |
121 | ":ipc_proto", | |
122 | "//base", | |
123 | "//base:file_stream", | |
124 | "//base:file_util", | |
125 | "//base:port", | |
126 | "//base:process_mutex", | |
127 | "//base:system_util", | |
128 | "//base:thread", | |
129 | "//base:util", | |
130 | "//base:version", | |
131 | "//testing:googletest", | |
132 | "//testing:gunit_main", | |
133 | ], | |
134 | ) | |
135 | ||
136 | cc_library_mozc( | |
137 | name = "ipc_mock", | |
138 | testonly = 1, | |
139 | srcs = ["ipc_mock.cc"], | |
140 | hdrs = ["ipc_mock.h"], | |
141 | deps = [ | |
142 | ":ipc", | |
143 | "//base", | |
144 | "//base:version", | |
145 | ], | |
146 | ) | |
147 | ||
148 | cc_library_mozc( | |
149 | name = "ipc_test_util", | |
150 | srcs = ["ipc_test_util.cc"], | |
151 | hdrs = ["ipc_test_util.h"], | |
152 | deps = [ | |
153 | ":ipc", | |
154 | "//base", | |
155 | "//base:logging", | |
156 | ], | |
157 | ) | |
158 | ||
159 | cc_test_mozc( | |
160 | name = "ipc_test", | |
161 | size = "small", | |
162 | srcs = ["ipc_test.cc"], | |
163 | copts = ["$(STACK_FRAME_UNLIMITED)"], # ipc_test.cc | |
164 | deps = [ | |
165 | ":ipc", | |
166 | ":ipc_test_util", | |
167 | "//base", | |
168 | "//base:flags", | |
169 | "//base:port", | |
170 | "//base:system_util", | |
171 | "//base:thread", | |
172 | "//base:util", | |
173 | "//testing:googletest", | |
174 | "//testing:gunit_main", | |
175 | ], | |
176 | ) | |
177 | ||
178 | ## cc_binary_mozc(name = "ipc_main", | |
179 | ## srcs = ["ipc_main.cc",], | |
180 | ## deps = [":ipc", | |
181 | ## "//base:base",], | |
182 | ## copts = ["$(STACK_FRAME_UNLIMITED)"] # ipc_main.cc | |
183 | ## ) | |
184 | ||
185 | cc_library_mozc( | |
186 | name = "named_event", | |
187 | srcs = ["named_event.cc"], | |
188 | hdrs = ["named_event.h"], | |
189 | deps = [ | |
190 | "//base", | |
191 | "//base:hash", | |
192 | "//base:logging", | |
193 | "//base:port", | |
194 | "//base:system_util", | |
195 | "//base:util", | |
196 | "@com_google_absl//absl/strings:str_format", | |
197 | ], | |
198 | ) | |
199 | ||
200 | ## cc_binary_mozc(name = "named_event_main", | |
201 | ## srcs = ["named_event_main.cc",], | |
202 | ## deps = [":named_event", | |
203 | ## "//base:base",]) | |
204 | ||
205 | cc_test_mozc( | |
206 | name = "named_event_test", | |
207 | size = "small", | |
208 | srcs = ["named_event_test.cc"], | |
209 | deps = [ | |
210 | ":named_event", | |
211 | "//base", | |
212 | "//base:clock", | |
213 | "//base:port", | |
214 | "//base:system_util", | |
215 | "//base:thread", | |
216 | "//base:util", | |
217 | "//testing:googletest", | |
218 | "//testing:gunit_main", | |
219 | ], | |
220 | ) | |
221 | ||
222 | cc_library_mozc( | |
223 | name = "process_watch_dog", | |
224 | srcs = ["process_watch_dog.cc"], | |
225 | hdrs = ["process_watch_dog.h"], | |
226 | deps = [ | |
227 | "//base", | |
228 | "//base:logging", | |
229 | "//base:mutex", | |
230 | "//base:port", | |
231 | "//base:scoped_handle", | |
232 | "//base:thread", | |
233 | "//base:util", | |
234 | ], | |
235 | ) | |
236 | ||
237 | # This header-only library was inserted because the target | |
238 | # //ipc:ipc_path_manager, which includes ipc/ipc.h | |
239 | # cannot depend on the library | |
240 | # //ipc:ipc: Found an inverse include path. | |
241 | cc_library_mozc( | |
242 | name = "ipc_hdr", | |
243 | textual_hdrs = ["ipc.h"], | |
244 | visibility = ["//visibility:private"], | |
245 | deps = [ | |
246 | "//base:port", | |
247 | "//base:scoped_handle", | |
248 | ], | |
249 | ) | |
250 | ||
251 | ## cc_binary_mozc(name = "process_watch_dog_main", | |
252 | ## srcs = ["process_watch_dog_main.cc",], | |
253 | ## deps = [":process_watch_dog", | |
254 | ## "//base:base",]) | |
255 | ||
256 | cc_test_mozc( | |
257 | name = "process_watch_dog_test", | |
258 | size = "small", | |
259 | srcs = ["process_watch_dog_test.cc"], | |
260 | deps = [ | |
261 | ":process_watch_dog", | |
262 | "//base", | |
263 | "//base:clock", | |
264 | "//base:logging", | |
265 | "//base:port", | |
266 | "//base:process", | |
267 | "//base:util", | |
268 | "//testing:gunit_main", | |
269 | ], | |
270 | ) | |
271 | ||
272 | proto_library( | |
273 | name = "window_info_proto_full", | |
274 | srcs = ["window_info.proto"], | |
275 | visibility = ["//visibility:private"], | |
276 | ) | |
277 | ||
278 | portable_proto_library( | |
279 | name = "window_info_proto", | |
280 | config_string = "allow_all: true", | |
281 | header_outs = ["window_info.pb.h"], | |
282 | proto_deps = [":window_info_proto_full"], | |
283 | visibility = ["//:__subpackages__"], | |
284 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | "select_mozc", | |
36 | ) | |
37 | load("//tools/build_defs:stubs.bzl", "portable_proto_library") | |
38 | ||
39 | package_group( | |
40 | name = "self_and_friends", | |
41 | includes = [ | |
42 | "//monitoring/prober_service:internal", | |
43 | ], | |
44 | packages = [ | |
45 | "//...", | |
46 | "//assistant/aog/builtins/intent/utils/...", | |
47 | ], | |
48 | ) | |
49 | ||
50 | test_suite( | |
51 | name = "nacl_test", | |
52 | ) | |
53 | ||
54 | cc_library_mozc( | |
55 | name = "http_client_common_header", | |
56 | hdrs = [ | |
57 | "http_client.h", | |
58 | "http_client_common.h", | |
59 | ], | |
60 | deps = ["//base:port"], | |
61 | ) | |
62 | ||
63 | COMMON_HTTP_CLIENT_SRCS = [ | |
64 | "http_client.cc", | |
65 | "http_client_null.cc", | |
66 | "proxy_manager.cc", | |
67 | ] | |
68 | ||
69 | COMMON_HTTP_CLIENT_HDRS = [ | |
70 | "http_client.h", | |
71 | "http_client_common.h", | |
72 | "http_client_null.h", | |
73 | "proxy_manager.h", | |
74 | ] | |
75 | ||
76 | cc_library_mozc( | |
77 | name = "http_client", | |
78 | srcs = COMMON_HTTP_CLIENT_SRCS, | |
79 | hdrs = COMMON_HTTP_CLIENT_HDRS, | |
80 | visibility = [ | |
81 | "//:__subpackages__", | |
82 | ], | |
83 | deps = select_mozc( | |
84 | client = [], | |
85 | default = ["//third_party/curl"], | |
86 | ) + [ | |
87 | "//base", | |
88 | "//base:stopwatch", | |
89 | ] + select_mozc( | |
90 | ios = ["//base:mac_util"], | |
91 | ) + [ | |
92 | "//base:logging", | |
93 | "//base:mutex", | |
94 | "//base:port", | |
95 | "//base:singleton", | |
96 | "//base:util", | |
97 | ], | |
98 | ) | |
99 | ||
100 | cc_binary_mozc( | |
101 | name = "http_client_main", | |
102 | srcs = ["http_client_main.cc"], | |
103 | deps = [ | |
104 | ":http_client", | |
105 | "//base", | |
106 | "//base:file_stream", | |
107 | "//base:flags", | |
108 | "//base:init_mozc", | |
109 | "//base:port", | |
110 | ], | |
111 | ) | |
112 | ||
113 | cc_library_mozc( | |
114 | name = "http_client_mock", | |
115 | testonly = 1, | |
116 | srcs = ["http_client_mock.cc"], | |
117 | hdrs = ["http_client_mock.h"], | |
118 | deps = [ | |
119 | ":http_client", | |
120 | "//base", | |
121 | "//base:logging", | |
122 | "//base:util", | |
123 | ], | |
124 | ) | |
125 | ||
126 | cc_test_mozc( | |
127 | name = "http_client_mock_test", | |
128 | srcs = ["http_client_mock_test.cc"], | |
129 | deps = [ | |
130 | ":http_client", | |
131 | ":http_client_mock", | |
132 | "//testing:googletest", | |
133 | "//testing:gunit_main", | |
134 | ], | |
135 | ) | |
136 | ||
137 | cc_library_mozc( | |
138 | name = "jsoncpp", | |
139 | hdrs = ["jsoncpp.h"], | |
140 | visibility = [ | |
141 | "//:__subpackages__", | |
142 | ], | |
143 | deps = [ | |
144 | "//third_party/jsoncpp:json", | |
145 | ], | |
146 | ) | |
147 | ||
148 | cc_library_mozc( | |
149 | name = "jsonpath", | |
150 | srcs = ["jsonpath.cc"], | |
151 | hdrs = ["jsonpath.h"], | |
152 | visibility = [":self_and_friends"], | |
153 | deps = [ | |
154 | ":jsoncpp", | |
155 | "//base", | |
156 | "//base:logging", | |
157 | "//base:number_util", | |
158 | "//base:port", | |
159 | "//base:util", | |
160 | ], | |
161 | ) | |
162 | ||
163 | cc_test_mozc( | |
164 | name = "jsonpath_test", | |
165 | srcs = ["jsonpath_test.cc"], | |
166 | deps = [ | |
167 | ":jsonpath", | |
168 | "//testing:gunit_main", | |
169 | ], | |
170 | ) | |
171 | ||
172 | cc_library_mozc( | |
173 | name = "json_util", | |
174 | srcs = ["json_util.cc"], | |
175 | hdrs = ["json_util.h"], | |
176 | visibility = [ | |
177 | "//:__subpackages__", | |
178 | ], | |
179 | deps = [ | |
180 | ":jsoncpp", | |
181 | "//base", | |
182 | "//base:logging", | |
183 | "//base:number_util", | |
184 | "//base:port", | |
185 | "//base/protobuf", | |
186 | "//base/protobuf:descriptor", | |
187 | "//base/protobuf:message", | |
188 | ], | |
189 | ) | |
190 | ||
191 | portable_proto_library( | |
192 | name = "json_util_test_proto", | |
193 | testonly = 1, | |
194 | config = "//protocol:portable_proto.pbtxt", | |
195 | header_outs = ["json_util_test.pb.h"], | |
196 | proto_deps = [":json_util_test_proto_full"], | |
197 | visibility = ["//visibility:private"], | |
198 | ) | |
199 | ||
200 | proto_library( | |
201 | name = "json_util_test_proto_full", | |
202 | testonly = 1, | |
203 | srcs = ["json_util_test.proto"], | |
204 | visibility = ["//visibility:private"], | |
205 | ) | |
206 | ||
207 | cc_proto_library( | |
208 | name = "json_util_test_proto_full_cc_proto", | |
209 | testonly = 1, | |
210 | visibility = ["//visibility:private"], | |
211 | deps = [":json_util_test_proto_full"], | |
212 | ) | |
213 | ||
214 | cc_test_mozc( | |
215 | name = "json_util_test", | |
216 | srcs = ["json_util_test.cc"], | |
217 | deps = [ | |
218 | ":json_util", | |
219 | ":json_util_test_proto", | |
220 | ":jsoncpp", | |
221 | "//base:logging", | |
222 | "//base:port", | |
223 | "//base:util", | |
224 | "//testing:gunit_main", | |
225 | "//testing:testing_util", | |
226 | ], | |
227 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | "py_binary_mozc", | |
36 | "py_library_mozc", | |
37 | ) | |
38 | load("//tools/build_defs:stubs.bzl", "portable_proto_library") | |
39 | ||
40 | package(default_visibility = ["//:__subpackages__"]) | |
41 | ||
42 | test_suite( | |
43 | name = "nacl_test", | |
44 | ) | |
45 | ||
46 | # c.f., //protocol:portable_proto | |
47 | portable_proto_library( | |
48 | name = "user_history_predictor_proto", | |
49 | config = "//protocol:portable_proto.pbtxt", | |
50 | header_outs = [ | |
51 | "user_history_predictor.pb.h", | |
52 | ], | |
53 | proto_deps = [ | |
54 | ":user_history_predictor_proto_full", | |
55 | ], | |
56 | visibility = ["//visibility:private"], | |
57 | ) | |
58 | ||
59 | proto_library( | |
60 | name = "user_history_predictor_proto_full", | |
61 | srcs = ["user_history_predictor.proto"], | |
62 | visibility = ["//visibility:private"], | |
63 | ) | |
64 | ||
65 | cc_library_mozc( | |
66 | name = "predictor_interface", | |
67 | hdrs = ["predictor_interface.h"], | |
68 | ) | |
69 | ||
70 | cc_library_mozc( | |
71 | name = "user_history_predictor", | |
72 | srcs = ["user_history_predictor.cc"], | |
73 | hdrs = ["user_history_predictor.h"], | |
74 | deps = [ | |
75 | ":predictor_interface", | |
76 | ":user_history_predictor_proto", | |
77 | "//base", | |
78 | "//base:clock", | |
79 | "//base:config_file_stream", | |
80 | "//base:flags", | |
81 | "//base:freelist", | |
82 | "//base:hash", | |
83 | "//base:logging", | |
84 | "//base:mozc_hash_set", | |
85 | "//base:thread", | |
86 | "//base:trie", | |
87 | "//base:util", | |
88 | "//composer", | |
89 | "//config:config_handler", | |
90 | "//converter:segments", | |
91 | "//dictionary:dictionary_interface", | |
92 | "//dictionary:pos_matcher_lib", | |
93 | "//dictionary:suppression_dictionary", | |
94 | "//protocol:commands_proto", | |
95 | "//protocol:config_proto", | |
96 | "//request:conversion_request", | |
97 | "//rewriter:variants_rewriter", | |
98 | "//storage:encrypted_string_storage", | |
99 | "//storage:lru_cache", | |
100 | "//testing:gunit_prod", | |
101 | "//usage_stats", | |
102 | "@com_google_absl//absl/strings", | |
103 | ], | |
104 | alwayslink = 1, | |
105 | ) | |
106 | ||
107 | cc_test_mozc( | |
108 | name = "user_history_predictor_test", | |
109 | size = "small", | |
110 | timeout = "moderate", | |
111 | srcs = ["user_history_predictor_test.cc"], | |
112 | deps = [ | |
113 | ":user_history_predictor", | |
114 | "//base", | |
115 | "//base:clock_mock", | |
116 | "//base:encryptor", | |
117 | "//base:file_util", | |
118 | "//base:logging", | |
119 | "//base:port", | |
120 | "//base:system_util", | |
121 | "//base:util", | |
122 | "//composer", | |
123 | "//composer:table", | |
124 | "//config:config_handler", | |
125 | "//converter:segments", | |
126 | "//data_manager/testing:mock_data_manager", | |
127 | "//dictionary:dictionary_mock", | |
128 | "//dictionary:suppression_dictionary", | |
129 | "//protocol:commands_proto", | |
130 | "//protocol:config_proto", | |
131 | "//request:conversion_request", | |
132 | "//session:request_test_util", | |
133 | "//storage:encrypted_string_storage", | |
134 | "//testing:googletest", | |
135 | "//testing:gunit_main", | |
136 | "//usage_stats", | |
137 | "//usage_stats:usage_stats_testing_util", | |
138 | "@com_google_absl//absl/strings", | |
139 | ], | |
140 | ) | |
141 | ||
142 | cc_library_mozc( | |
143 | name = "dictionary_predictor", | |
144 | srcs = [ | |
145 | "dictionary_predictor.cc", | |
146 | ], | |
147 | hdrs = ["dictionary_predictor.h"], | |
148 | nocopts = select({ | |
149 | "//tools/cc_target_os:nacl": "-fPIC", | |
150 | "//conditions:default": "", | |
151 | }), | |
152 | deps = [ | |
153 | ":predictor_interface", | |
154 | ":suggestion_filter", | |
155 | ":zero_query_dict", | |
156 | "//base", | |
157 | "//base:flags", | |
158 | "//base:logging", | |
159 | "//base:mozc_hash_map", | |
160 | "//base:number_util", | |
161 | "//base:util", | |
162 | "//composer", | |
163 | "//composer/internal:typing_corrector", | |
164 | "//config:config_handler", | |
165 | "//converter:connector", | |
166 | "//converter:converter_interface", | |
167 | "//converter:immutable_converter_interface", | |
168 | "//converter:node_list_builder", | |
169 | "//converter:segmenter", | |
170 | "//converter:segments", | |
171 | "//data_manager:data_manager_interface", | |
172 | "//dictionary:dictionary_interface", | |
173 | "//dictionary:dictionary_token", | |
174 | "//dictionary:pos_matcher_lib", | |
175 | "//protocol:commands_proto", | |
176 | "//protocol:config_proto", | |
177 | "//request:conversion_request", | |
178 | "//testing:gunit_prod", | |
179 | "//usage_stats", | |
180 | "@com_google_absl//absl/strings", | |
181 | ], | |
182 | alwayslink = 1, | |
183 | ) | |
184 | ||
185 | cc_test_mozc( | |
186 | name = "dictionary_predictor_test", | |
187 | size = "small", | |
188 | timeout = "moderate", | |
189 | srcs = [ | |
190 | "dictionary_predictor_test.cc", | |
191 | ], | |
192 | deps = [ | |
193 | ":dictionary_predictor", | |
194 | ":suggestion_filter", | |
195 | ":zero_query_dict", | |
196 | "//base", | |
197 | "//base:flags", | |
198 | "//base:logging", | |
199 | "//base:port", | |
200 | "//base:serialized_string_array", | |
201 | "//base:system_util", | |
202 | "//base:util", | |
203 | "//composer", | |
204 | "//composer:table", | |
205 | "//composer/internal:typing_model", | |
206 | "//config:config_handler", | |
207 | "//converter:connector", | |
208 | "//converter:converter_interface", | |
209 | "//converter:converter_mock", | |
210 | "//converter:immutable_converter_interface", | |
211 | "//converter:immutable_converter_no_factory", | |
212 | "//converter:node_allocator", | |
213 | "//converter:segmenter", | |
214 | "//converter:segments", | |
215 | "//data_manager:data_manager_interface", | |
216 | "//data_manager/testing:mock_data_manager", | |
217 | "//dictionary:dictionary_interface", | |
218 | "//dictionary:dictionary_mock", | |
219 | "//dictionary:pos_group", | |
220 | "//dictionary:pos_matcher_lib", | |
221 | "//dictionary:suffix_dictionary", | |
222 | "//dictionary:suppression_dictionary", | |
223 | "//dictionary/system:system_dictionary", | |
224 | "//dictionary/system:value_dictionary", | |
225 | "//protocol:commands_proto", | |
226 | "//protocol:config_proto", | |
227 | "//request:conversion_request", | |
228 | "//session:request_test_util", | |
229 | "//testing:gmock", | |
230 | "//testing:googletest", | |
231 | "//testing:gunit_main", | |
232 | "//transliteration", | |
233 | "//usage_stats", | |
234 | "//usage_stats:usage_stats_testing_util", | |
235 | "@com_google_absl//absl/strings", | |
236 | ], | |
237 | ) | |
238 | ||
239 | cc_library_mozc( | |
240 | name = "predictor", | |
241 | srcs = ["predictor.cc"], | |
242 | hdrs = ["predictor.h"], | |
243 | deps = [ | |
244 | ":predictor_interface", | |
245 | "//base", | |
246 | "//base:flags", | |
247 | "//base:logging", | |
248 | "//config:config_handler", | |
249 | "//converter:segments", | |
250 | "//protocol:commands_proto", | |
251 | "//protocol:config_proto", | |
252 | "//request:conversion_request", | |
253 | "@com_google_absl//absl/memory", | |
254 | ], | |
255 | alwayslink = 1, | |
256 | ) | |
257 | ||
258 | cc_test_mozc( | |
259 | name = "predictor_test", | |
260 | srcs = ["predictor_test.cc"], | |
261 | deps = [ | |
262 | ":dictionary_predictor", | |
263 | ":predictor", | |
264 | ":predictor_interface", | |
265 | ":user_history_predictor", | |
266 | "//base", | |
267 | "//base:logging", | |
268 | "//base:singleton", | |
269 | "//base:system_util", | |
270 | "//composer", | |
271 | "//config:config_handler", | |
272 | "//converter:segments", | |
273 | "//data_manager/testing:mock_data_manager", | |
274 | "//dictionary:dictionary_mock", | |
275 | "//dictionary:pos_matcher_lib", | |
276 | "//dictionary:suppression_dictionary", | |
277 | "//protocol:commands_proto", | |
278 | "//protocol:config_proto", | |
279 | "//request:conversion_request", | |
280 | "//session:request_test_util", | |
281 | "//testing:gmock", | |
282 | "//testing:googletest", | |
283 | "//testing:gunit_main", | |
284 | "@com_google_absl//absl/memory", | |
285 | ], | |
286 | ) | |
287 | ||
288 | cc_library_mozc( | |
289 | name = "suggestion_filter", | |
290 | srcs = ["suggestion_filter.cc"], | |
291 | hdrs = ["suggestion_filter.h"], | |
292 | deps = [ | |
293 | "//base", | |
294 | "//base:hash", | |
295 | "//base:logging", | |
296 | "//base:port", | |
297 | "//base:util", | |
298 | "//storage:existence_filter", | |
299 | ], | |
300 | ) | |
301 | ||
302 | cc_library_mozc( | |
303 | name = "zero_query_dict", | |
304 | hdrs = ["zero_query_dict.h"], | |
305 | visibility = ["//visibility:private"], | |
306 | deps = [ | |
307 | "//base:port", | |
308 | "//base:serialized_string_array", | |
309 | "@com_google_absl//absl/strings", | |
310 | ], | |
311 | ) | |
312 | ||
313 | cc_test_mozc( | |
314 | name = "zero_query_dict_test", | |
315 | srcs = ["zero_query_dict_test.cc"], | |
316 | visibility = ["//visibility:private"], | |
317 | deps = [ | |
318 | ":zero_query_dict", | |
319 | "//base", | |
320 | "//base:port", | |
321 | "//base:serialized_string_array", | |
322 | "//testing:gunit_main", | |
323 | "@com_google_absl//absl/strings", | |
324 | ], | |
325 | ) | |
326 | ||
327 | cc_binary_mozc( | |
328 | name = "gen_suggestion_filter_main", | |
329 | srcs = ["gen_suggestion_filter_main.cc"], | |
330 | deps = [ | |
331 | "//base", | |
332 | "//base:codegen_bytearray_stream", | |
333 | "//base:file_stream", | |
334 | "//base:flags", | |
335 | "//base:hash", | |
336 | "//base:init_mozc_buildtool", | |
337 | "//base:logging", | |
338 | "//base:util", | |
339 | "//storage:existence_filter", | |
340 | ], | |
341 | ) | |
342 | ||
343 | py_library_mozc( | |
344 | name = "gen_zero_query_util", | |
345 | srcs = ["gen_zero_query_util.py"], | |
346 | deps = [ | |
347 | "//build_tools:code_generator_util", | |
348 | "//build_tools:serialized_string_array_builder", | |
349 | ], | |
350 | ) | |
351 | ||
352 | py_library_mozc( | |
353 | name = "gen_zero_query_number_data_lib", | |
354 | srcs = ["gen_zero_query_number_data.py"], | |
355 | deps = [":gen_zero_query_util"], | |
356 | ) | |
357 | ||
358 | py_binary_mozc( | |
359 | name = "gen_zero_query_number_data", | |
360 | srcs = ["gen_zero_query_number_data.py"], | |
361 | deps = [ | |
362 | ":gen_zero_query_number_data_lib", | |
363 | ":gen_zero_query_util", | |
364 | ], | |
365 | ) | |
366 | ||
367 | py_library_mozc( | |
368 | name = "gen_zero_query_data_lib", | |
369 | srcs = ["gen_zero_query_data.py"], | |
370 | deps = [ | |
371 | ":gen_zero_query_util", | |
372 | "//build_tools:code_generator_util", | |
373 | ], | |
374 | ) | |
375 | ||
376 | py_binary_mozc( | |
377 | name = "gen_zero_query_data", | |
378 | srcs = ["gen_zero_query_data.py"], | |
379 | deps = [ | |
380 | ":gen_zero_query_data_lib", | |
381 | ":gen_zero_query_util", | |
382 | "//build_tools:code_generator_util", | |
383 | ], | |
384 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load("//tools/build_defs:stubs.bzl", "portable_proto_library") | |
31 | ||
32 | package(default_visibility = [ | |
33 | "//:__subpackages__", | |
34 | ]) | |
35 | ||
36 | exports_files(["portable_proto.pbtxt"]) | |
37 | ||
38 | # Generates proto library for Android. | |
39 | # proto_library() depends on //base, which doesn't build on Android config. | |
40 | # portable_proto_library() generates proto library which is independent | |
41 | # from //base by using protoc in third_party. | |
42 | portable_proto_library( | |
43 | name = "user_dictionary_storage_proto", | |
44 | config_string = "optimize_mode: SPEED allow_all: true", | |
45 | header_outs = [ | |
46 | "user_dictionary_storage.pb.h", | |
47 | ], | |
48 | proto_deps = [ | |
49 | ":user_dictionary_storage_proto_full", | |
50 | ], | |
51 | ) | |
52 | ||
53 | portable_proto_library( | |
54 | name = "candidates_proto", | |
55 | config_string = "optimize_mode: SPEED allow_all: true", | |
56 | header_outs = [ | |
57 | "candidates.pb.h", | |
58 | ], | |
59 | proto_deps = [ | |
60 | ":candidates_proto_full", | |
61 | ], | |
62 | ) | |
63 | ||
64 | portable_proto_library( | |
65 | name = "config_proto", | |
66 | config_string = "optimize_mode: SPEED allow_all: true", | |
67 | header_outs = [ | |
68 | "config.pb.h", | |
69 | ], | |
70 | proto_deps = [ | |
71 | ":config_proto_full", | |
72 | ], | |
73 | ) | |
74 | ||
75 | portable_proto_library( | |
76 | name = "engine_builder_proto", | |
77 | config_string = "optimize_mode: SPEED allow_all: true", | |
78 | header_outs = [ | |
79 | "engine_builder.pb.h", | |
80 | ], | |
81 | proto_deps = [ | |
82 | ":engine_builder_proto_full", | |
83 | ], | |
84 | ) | |
85 | ||
86 | portable_proto_library( | |
87 | name = "commands_proto", | |
88 | config_string = "optimize_mode: SPEED allow_all: true", | |
89 | header_outs = [ | |
90 | "commands.pb.h", | |
91 | ], | |
92 | portable_deps = [ | |
93 | ":candidates_proto", | |
94 | ":config_proto", | |
95 | ":engine_builder_proto", | |
96 | ":user_dictionary_storage_proto", | |
97 | ], | |
98 | proto_deps = ["commands_proto_full"], | |
99 | ) | |
100 | ||
101 | portable_proto_library( | |
102 | name = "state_proto", | |
103 | config_string = "optimize_mode: SPEED allow_all: true", | |
104 | header_outs = [ | |
105 | "state.pb.h", | |
106 | ], | |
107 | portable_deps = [ | |
108 | ":candidates_proto", | |
109 | ":commands_proto", | |
110 | ], | |
111 | proto_deps = ["state_proto_full"], | |
112 | ) | |
113 | ||
114 | proto_library( | |
115 | name = "commands_proto_full", | |
116 | srcs = [ | |
117 | "commands.proto", | |
118 | ], | |
119 | deps = [ | |
120 | ":candidates_proto_full", | |
121 | ":config_proto_full", | |
122 | ":engine_builder_proto_full", | |
123 | ":user_dictionary_storage_proto_full", | |
124 | ], | |
125 | ) | |
126 | ||
127 | # Proto library for Android Java. | |
128 | java_lite_proto_library( | |
129 | name = "commands_proto_android_java", | |
130 | deps = [ | |
131 | ":candidates_proto_full", | |
132 | ":commands_proto_full", | |
133 | ":config_proto_full", | |
134 | ":engine_builder_proto_full", | |
135 | ":user_dictionary_storage_proto_full", | |
136 | ], | |
137 | ) | |
138 | ||
139 | proto_library( | |
140 | name = "config_proto_full", | |
141 | srcs = ["config.proto"], | |
142 | visibility = [], | |
143 | ) | |
144 | ||
145 | java_lite_proto_library( | |
146 | name = "config_proto_lite", | |
147 | deps = [":config_proto_full"], | |
148 | ) | |
149 | ||
150 | proto_library( | |
151 | name = "renderer_proto_full", | |
152 | srcs = ["renderer_command.proto"], | |
153 | visibility = ["//visibility:private"], | |
154 | deps = [":commands_proto_full"], | |
155 | ) | |
156 | ||
157 | portable_proto_library( | |
158 | name = "renderer_proto", | |
159 | config_string = "optimize_mode: SPEED allow_all: true", | |
160 | header_outs = ["renderer_command.pb.h"], | |
161 | portable_deps = [":commands_proto"], | |
162 | proto_deps = [":renderer_proto_full"], | |
163 | ) | |
164 | ||
165 | proto_library( | |
166 | name = "candidates_proto_full", | |
167 | srcs = [ | |
168 | "candidates.proto", | |
169 | ], | |
170 | ) | |
171 | ||
172 | proto_library( | |
173 | name = "state_proto_full", | |
174 | srcs = ["state.proto"], | |
175 | visibility = ["//visibility:private"], | |
176 | deps = [ | |
177 | ":candidates_proto_full", | |
178 | ":commands_proto_full", | |
179 | ], | |
180 | ) | |
181 | ||
182 | proto_library( | |
183 | name = "user_dictionary_storage_proto_full", | |
184 | srcs = ["user_dictionary_storage.proto"], | |
185 | visibility = [], | |
186 | ) | |
187 | ||
188 | java_lite_proto_library( | |
189 | name = "user_dictionary_storage_proto_lite", | |
190 | deps = [":user_dictionary_storage_proto_full"], | |
191 | ) | |
192 | ||
193 | proto_library( | |
194 | name = "segmenter_data_proto_full", | |
195 | srcs = ["segmenter_data.proto"], | |
196 | visibility = ["//visibility:private"], | |
197 | ) | |
198 | ||
199 | portable_proto_library( | |
200 | name = "segmenter_data_proto", | |
201 | config_string = "optimize_mode: SPEED allow_all: true", | |
202 | header_outs = ["segmenter_data.pb.h"], | |
203 | proto_deps = [":segmenter_data_proto_full"], | |
204 | ) | |
205 | ||
206 | proto_library( | |
207 | name = "engine_builder_proto_full", | |
208 | srcs = ["engine_builder.proto"], | |
209 | visibility = ["//visibility:private"], | |
210 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | "select_mozc", | |
35 | ) | |
36 | ||
37 | package(default_visibility = ["//:__subpackages__"]) | |
38 | ||
39 | cc_library_mozc( | |
40 | name = "renderer_client", | |
41 | srcs = ["renderer_client.cc"], | |
42 | hdrs = ["renderer_client.h"], | |
43 | deps = [ | |
44 | ":renderer_interface", | |
45 | "//base", | |
46 | "//base:clock", | |
47 | "//base:logging", | |
48 | "//base:mutex", | |
49 | "//base:port", | |
50 | "//base:process", | |
51 | "//base:run_level", | |
52 | "//base:system_util", | |
53 | "//base:thread", | |
54 | "//base:util", | |
55 | "//base:version", | |
56 | "//ipc", | |
57 | "//ipc:named_event", | |
58 | "//protocol:renderer_proto", | |
59 | ] + select_mozc( | |
60 | ios = ["//base:mac_util"], | |
61 | ), | |
62 | ) | |
63 | ||
64 | cc_test_mozc( | |
65 | name = "renderer_client_test", | |
66 | size = "medium", | |
67 | srcs = ["renderer_client_test.cc"], | |
68 | tags = [ | |
69 | "disable_on_nacl_test", | |
70 | "no_android", | |
71 | ], | |
72 | deps = [ | |
73 | ":renderer_client", | |
74 | ":renderer_interface", | |
75 | "//base", | |
76 | "//base:logging", | |
77 | "//base:number_util", | |
78 | "//base:port", | |
79 | "//base:util", | |
80 | "//base:version", | |
81 | "//ipc", | |
82 | "//protocol:renderer_proto", | |
83 | "//testing:gunit_main", | |
84 | "@com_google_absl//absl/strings:str_format", | |
85 | ], | |
86 | ) | |
87 | ||
88 | cc_library_mozc( | |
89 | name = "renderer_server", | |
90 | srcs = ["renderer_server.cc"], | |
91 | hdrs = ["renderer_server.h"], | |
92 | deps = [ | |
93 | ":renderer_interface", | |
94 | "//base", | |
95 | "//base:flags", | |
96 | "//base:logging", | |
97 | "//base:port", | |
98 | "//base:system_util", | |
99 | "//client", | |
100 | "//client:client_interface", | |
101 | "//config:config_handler", | |
102 | "//ipc", | |
103 | "//ipc:named_event", | |
104 | "//ipc:process_watch_dog", | |
105 | "//protocol:config_proto", | |
106 | "//protocol:renderer_proto", | |
107 | ], | |
108 | ) | |
109 | ||
110 | cc_test_mozc( | |
111 | name = "renderer_server_test", | |
112 | size = "medium", | |
113 | srcs = ["renderer_server_test.cc"], | |
114 | tags = [ | |
115 | "disable_on_nacl_test", | |
116 | "no_android", | |
117 | ], | |
118 | deps = [ | |
119 | ":renderer_client", | |
120 | ":renderer_interface", | |
121 | ":renderer_server", | |
122 | "//base", | |
123 | "//base:logging", | |
124 | "//base:port", | |
125 | "//base:system_util", | |
126 | "//base:util", | |
127 | "//ipc:ipc_test_util", | |
128 | "//protocol:renderer_proto", | |
129 | "//testing:googletest", | |
130 | "//testing:gunit_main", | |
131 | ], | |
132 | ) | |
133 | ||
134 | cc_library_mozc( | |
135 | name = "table_layout", | |
136 | srcs = [ | |
137 | "table_layout.cc", | |
138 | "table_layout_interface.h", | |
139 | ], | |
140 | hdrs = ["table_layout.h"], | |
141 | deps = [ | |
142 | "//base", | |
143 | "//base:coordinates", | |
144 | "//base:logging", | |
145 | "//base:port", | |
146 | ], | |
147 | ) | |
148 | ||
149 | cc_test_mozc( | |
150 | name = "table_layout_test", | |
151 | size = "small", | |
152 | srcs = [ | |
153 | "table_layout_interface.h", | |
154 | "table_layout_test.cc", | |
155 | ], | |
156 | tags = [ | |
157 | "disable_on_nacl_test", | |
158 | "no_android", | |
159 | ], | |
160 | deps = [ | |
161 | ":table_layout", | |
162 | "//base", | |
163 | "//testing:gunit_main", | |
164 | ], | |
165 | ) | |
166 | ||
167 | cc_library_mozc( | |
168 | name = "window_util", | |
169 | srcs = ["window_util.cc"], | |
170 | hdrs = ["window_util.h"], | |
171 | deps = [ | |
172 | "//base", | |
173 | "//base:coordinates", | |
174 | ], | |
175 | ) | |
176 | ||
177 | cc_library_mozc( | |
178 | name = "renderer_interface", | |
179 | hdrs = ["renderer_interface.h"], | |
180 | visibility = ["//visibility:private"], | |
181 | ) | |
182 | ||
183 | cc_library_mozc( | |
184 | name = "unix_const", | |
185 | hdrs = ["unix/const.h"], | |
186 | visibility = ["//visibility:private"], | |
187 | deps = ["//base:port"], | |
188 | ) | |
189 | ||
190 | cc_library_mozc( | |
191 | name = "renderer_mock", | |
192 | testonly = 1, | |
193 | hdrs = ["renderer_mock.h"], | |
194 | visibility = ["//visibility:private"], | |
195 | deps = [ | |
196 | ":renderer_interface", | |
197 | "//testing:gmock", | |
198 | ], | |
199 | ) | |
200 | ||
201 | cc_test_mozc( | |
202 | name = "window_util_test", | |
203 | size = "small", | |
204 | srcs = ["window_util_test.cc"], | |
205 | tags = [ | |
206 | "disable_on_nacl_test", | |
207 | "no_android", | |
208 | ], | |
209 | deps = [ | |
210 | ":window_util", | |
211 | "//base", | |
212 | "//base:coordinates", | |
213 | "//testing:gunit_main", | |
214 | ], | |
215 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | ) | |
34 | ||
35 | package(default_visibility = [ | |
36 | "//:__subpackages__", | |
37 | ]) | |
38 | ||
39 | cc_library_mozc( | |
40 | name = "conversion_request", | |
41 | srcs = ["conversion_request.cc"], | |
42 | hdrs = ["conversion_request.h"], | |
43 | deps = [ | |
44 | "//base", | |
45 | "//base:logging", | |
46 | "//base:port", | |
47 | "//config:config_handler", | |
48 | "//protocol:commands_proto", | |
49 | ], | |
50 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | "py_binary_mozc", | |
36 | "py_library_mozc", | |
37 | ) | |
38 | ||
39 | package(default_visibility = ["//:__subpackages__"]) | |
40 | ||
41 | test_suite( | |
42 | name = "nacl_test", | |
43 | ) | |
44 | ||
45 | cc_library_mozc( | |
46 | name = "rewriter_interface", | |
47 | textual_hdrs = ["rewriter_interface.h"], | |
48 | deps = [ | |
49 | "//converter:segments", | |
50 | "//request:conversion_request", | |
51 | ], | |
52 | ) | |
53 | ||
54 | cc_test_mozc( | |
55 | name = "merger_rewriter_test", | |
56 | size = "small", | |
57 | srcs = ["merger_rewriter_test.cc"], | |
58 | visibility = ["//visibility:private"], | |
59 | deps = [ | |
60 | ":merger_rewriter", | |
61 | "//base", | |
62 | "//base:stl_util", | |
63 | "//base:system_util", | |
64 | "//config:config_handler", | |
65 | "//converter:segments", | |
66 | "//protocol:commands_proto", | |
67 | "//protocol:config_proto", | |
68 | "//request:conversion_request", | |
69 | "//testing:googletest", | |
70 | "//testing:gunit_main", | |
71 | ], | |
72 | ) | |
73 | ||
74 | cc_library_mozc( | |
75 | name = "collocation_rewriter", | |
76 | srcs = [ | |
77 | "collocation_rewriter.cc", | |
78 | ], | |
79 | hdrs = ["collocation_rewriter.h"], | |
80 | deps = [ | |
81 | ":collocation_util", | |
82 | ":rewriter_interface", | |
83 | "//base", | |
84 | "//base:flags", | |
85 | "//base:hash", | |
86 | "//base:logging", | |
87 | "//base:port", | |
88 | "//base:util", | |
89 | "//converter:segments", | |
90 | "//data_manager:data_manager_interface", | |
91 | "//dictionary:pos_matcher_lib", | |
92 | "//protocol:commands_proto", | |
93 | "//request:conversion_request", | |
94 | "//storage:existence_filter", | |
95 | "@com_google_absl//absl/strings", | |
96 | ], | |
97 | alwayslink = 1, | |
98 | ) | |
99 | ||
100 | cc_test_mozc( | |
101 | name = "collocation_rewriter_test", | |
102 | srcs = ["collocation_rewriter_test.cc"], | |
103 | deps = [ | |
104 | ":collocation_rewriter", | |
105 | "//base", | |
106 | "//base:logging", | |
107 | "//base:system_util", | |
108 | "//config:config_handler", | |
109 | "//data_manager/testing:mock_data_manager", | |
110 | "//dictionary:pos_matcher_lib", | |
111 | "//request:conversion_request", | |
112 | "//testing:googletest", | |
113 | "//testing:gunit_main", | |
114 | ], | |
115 | ) | |
116 | ||
117 | cc_library_mozc( | |
118 | name = "user_segment_history_rewriter", | |
119 | srcs = ["user_segment_history_rewriter.cc"], | |
120 | hdrs = ["user_segment_history_rewriter.h"], | |
121 | deps = [ | |
122 | ":rewriter_interface", | |
123 | ":variants_rewriter", | |
124 | "//base", | |
125 | "//base:config_file_stream", | |
126 | "//base:file_util", | |
127 | "//base:logging", | |
128 | "//base:number_util", | |
129 | "//base:util", | |
130 | "//config:character_form_manager", | |
131 | "//config:config_handler", | |
132 | "//converter:segments", | |
133 | "//dictionary:pos_group", | |
134 | "//dictionary:pos_matcher_lib", | |
135 | "//protocol:commands_proto", | |
136 | "//protocol:config_proto", | |
137 | "//request:conversion_request", | |
138 | "//storage:lru_storage", | |
139 | "//transliteration", | |
140 | "//usage_stats", | |
141 | "@com_google_absl//absl/strings", | |
142 | ], | |
143 | alwayslink = 1, | |
144 | ) | |
145 | ||
146 | cc_test_mozc( | |
147 | name = "user_segment_history_rewriter_test", | |
148 | size = "small", | |
149 | timeout = "moderate", | |
150 | srcs = ["user_segment_history_rewriter_test.cc"], | |
151 | deps = [ | |
152 | ":number_rewriter", | |
153 | ":user_segment_history_rewriter", | |
154 | ":variants_rewriter", | |
155 | "//base", | |
156 | "//base:clock", | |
157 | "//base:clock_mock", | |
158 | "//base:file_util", | |
159 | "//base:logging", | |
160 | "//base:number_util", | |
161 | "//base:system_util", | |
162 | "//base:util", | |
163 | "//config:character_form_manager", | |
164 | "//config:config_handler", | |
165 | "//converter:converter_mock", | |
166 | "//converter:segments", | |
167 | "//data_manager/testing:mock_data_manager", | |
168 | "//dictionary:pos_group", | |
169 | "//dictionary:pos_matcher_lib", | |
170 | "//protocol:config_proto", | |
171 | "//request:conversion_request", | |
172 | "//testing:googletest", | |
173 | "//testing:gunit_main", | |
174 | ], | |
175 | ) | |
176 | ||
177 | cc_library_mozc( | |
178 | name = "user_boundary_history_rewriter", | |
179 | srcs = ["user_boundary_history_rewriter.cc"], | |
180 | hdrs = ["user_boundary_history_rewriter.h"], | |
181 | deps = [ | |
182 | ":rewriter_interface", | |
183 | "//base", | |
184 | "//base:config_file_stream", | |
185 | "//base:file_util", | |
186 | "//base:logging", | |
187 | "//base:port", | |
188 | "//base:util", | |
189 | "//config:config_handler", | |
190 | "//converter:converter_interface", | |
191 | "//converter:segments", | |
192 | "//protocol:commands_proto", | |
193 | "//protocol:config_proto", | |
194 | "//request:conversion_request", | |
195 | "//storage:lru_storage", | |
196 | "//usage_stats", | |
197 | ], | |
198 | alwayslink = 1, | |
199 | ) | |
200 | ||
201 | cc_test_mozc( | |
202 | name = "user_boundary_history_rewriter_test", | |
203 | size = "small", | |
204 | srcs = ["user_boundary_history_rewriter_test.cc"], | |
205 | deps = [ | |
206 | ":user_boundary_history_rewriter", | |
207 | "//base", | |
208 | "//base:file_util", | |
209 | "//base:system_util", | |
210 | "//config:config_handler", | |
211 | "//converter:converter_mock", | |
212 | "//converter:segments", | |
213 | "//protocol:config_proto", | |
214 | "//request:conversion_request", | |
215 | "//testing:googletest", | |
216 | "//testing:gunit_main", | |
217 | ], | |
218 | ) | |
219 | ||
220 | cc_library_mozc( | |
221 | name = "date_rewriter", | |
222 | srcs = ["date_rewriter.cc"], | |
223 | hdrs = ["date_rewriter.h"], | |
224 | deps = [ | |
225 | ":rewriter_interface", | |
226 | "//base", | |
227 | "//base:clock", | |
228 | "//base:logging", | |
229 | "//base:number_util", | |
230 | "//base:port", | |
231 | "//base:util", | |
232 | "//composer", | |
233 | "//composer:table", | |
234 | "//config:config_handler", | |
235 | "//converter:segments", | |
236 | "//dictionary:dictionary_interface", | |
237 | "//protocol:commands_proto", | |
238 | "//protocol:config_proto", | |
239 | "//request:conversion_request", | |
240 | "//testing:gunit_prod", | |
241 | "@com_google_absl//absl/strings", | |
242 | ], | |
243 | alwayslink = 1, | |
244 | ) | |
245 | ||
246 | cc_test_mozc( | |
247 | name = "date_rewriter_test", | |
248 | size = "small", | |
249 | srcs = ["date_rewriter_test.cc"], | |
250 | deps = [ | |
251 | ":date_rewriter", | |
252 | "//base", | |
253 | "//base:clock", | |
254 | "//base:clock_mock", | |
255 | "//base:port", | |
256 | "//base:system_util", | |
257 | "//base:util", | |
258 | "//composer", | |
259 | "//composer:table", | |
260 | "//config:config_handler", | |
261 | "//converter:segments", | |
262 | "//dictionary:dictionary_mock", | |
263 | "//protocol:commands_proto", | |
264 | "//protocol:config_proto", | |
265 | "//request:conversion_request", | |
266 | "//testing:gunit_main", | |
267 | "//testing:mozctest", | |
268 | ], | |
269 | ) | |
270 | ||
271 | cc_library_mozc( | |
272 | name = "number_rewriter", | |
273 | srcs = [ | |
274 | "number_rewriter.cc", | |
275 | ], | |
276 | hdrs = ["number_rewriter.h"], | |
277 | deps = [ | |
278 | ":number_compound_util", | |
279 | ":rewriter_interface", | |
280 | "//base", | |
281 | "//base:logging", | |
282 | "//base:number_util", | |
283 | "//base:port", | |
284 | "//base:serialized_string_array", | |
285 | "//base:util", | |
286 | "//config:config_handler", | |
287 | "//converter:segments", | |
288 | "//data_manager:data_manager_interface", | |
289 | "//dictionary:pos_matcher_lib", | |
290 | "//protocol:commands_proto", | |
291 | "//protocol:config_proto", | |
292 | "//request:conversion_request", | |
293 | "@com_google_absl//absl/strings", | |
294 | ], | |
295 | alwayslink = 1, | |
296 | ) | |
297 | ||
298 | cc_test_mozc( | |
299 | name = "number_rewriter_test", | |
300 | size = "small", | |
301 | srcs = ["number_rewriter_test.cc"], | |
302 | deps = [ | |
303 | ":number_rewriter", | |
304 | "//base", | |
305 | "//base:logging", | |
306 | "//base:port", | |
307 | "//base:util", | |
308 | "//config:config_handler", | |
309 | "//converter:segments", | |
310 | "//data_manager/testing:mock_data_manager", | |
311 | "//dictionary:pos_matcher_lib", | |
312 | "//protocol:commands_proto", | |
313 | "//request:conversion_request", | |
314 | "//testing:gunit_main", | |
315 | "//testing:mozctest", | |
316 | ], | |
317 | ) | |
318 | ||
319 | cc_library_mozc( | |
320 | name = "transliteration_rewriter", | |
321 | srcs = [ | |
322 | "transliteration_rewriter.cc", | |
323 | ], | |
324 | hdrs = ["transliteration_rewriter.h"], | |
325 | deps = [ | |
326 | ":rewriter_interface", | |
327 | "//base", | |
328 | "//base:logging", | |
329 | "//base:number_util", | |
330 | "//base:port", | |
331 | "//base:text_normalizer", | |
332 | "//base:util", | |
333 | "//composer", | |
334 | "//converter:segments", | |
335 | "//dictionary:pos_matcher_lib", | |
336 | "//protocol:commands_proto", | |
337 | "//request:conversion_request", | |
338 | "//transliteration", | |
339 | "//usage_stats", | |
340 | ], | |
341 | alwayslink = 1, | |
342 | ) | |
343 | ||
344 | cc_test_mozc( | |
345 | name = "transliteration_rewriter_test", | |
346 | size = "small", | |
347 | timeout = "moderate", | |
348 | srcs = ["transliteration_rewriter_test.cc"], | |
349 | deps = [ | |
350 | ":transliteration_rewriter", | |
351 | "//base", | |
352 | "//base:logging", | |
353 | "//base:util", | |
354 | "//composer", | |
355 | "//composer:table", | |
356 | "//config:config_handler", | |
357 | "//converter:segments", | |
358 | "//data_manager/testing:mock_data_manager", | |
359 | "//dictionary:pos_matcher_lib", | |
360 | "//protocol:commands_proto", | |
361 | "//protocol:config_proto", | |
362 | "//request:conversion_request", | |
363 | "//session:request_test_util", | |
364 | "//testing:gunit_main", | |
365 | "//testing:mozctest", | |
366 | "//transliteration", | |
367 | "//usage_stats", | |
368 | "//usage_stats:usage_stats_testing_util", | |
369 | ], | |
370 | ) | |
371 | ||
372 | cc_library_mozc( | |
373 | name = "language_aware_rewriter", | |
374 | srcs = [ | |
375 | "language_aware_rewriter.cc", | |
376 | ], | |
377 | hdrs = ["language_aware_rewriter.h"], | |
378 | deps = [ | |
379 | ":rewriter_interface", | |
380 | "//base", | |
381 | "//base:logging", | |
382 | "//base:port", | |
383 | "//base:util", | |
384 | "//composer", | |
385 | "//config:config_handler", | |
386 | "//converter:segments", | |
387 | "//dictionary:dictionary_interface", | |
388 | "//dictionary:pos_matcher_lib", | |
389 | "//protocol:commands_proto", | |
390 | "//protocol:config_proto", | |
391 | "//request:conversion_request", | |
392 | "//transliteration", | |
393 | "//usage_stats", | |
394 | ], | |
395 | ) | |
396 | ||
397 | cc_test_mozc( | |
398 | name = "language_aware_rewriter_test", | |
399 | size = "small", | |
400 | srcs = ["language_aware_rewriter_test.cc"], | |
401 | deps = [ | |
402 | ":language_aware_rewriter", | |
403 | "//base", | |
404 | "//base:logging", | |
405 | "//base:util", | |
406 | "//composer", | |
407 | "//composer:table", | |
408 | "//config:config_handler", | |
409 | "//converter:segments", | |
410 | "//data_manager/testing:mock_data_manager", | |
411 | "//dictionary:dictionary_mock", | |
412 | "//dictionary:pos_matcher_lib", | |
413 | "//protocol:commands_proto", | |
414 | "//protocol:config_proto", | |
415 | "//request:conversion_request", | |
416 | "//session:request_test_util", | |
417 | "//testing:gunit_main", | |
418 | "//testing:mozctest", | |
419 | "//usage_stats", | |
420 | "//usage_stats:usage_stats_testing_util", | |
421 | ], | |
422 | ) | |
423 | ||
424 | cc_library_mozc( | |
425 | name = "version_rewriter", | |
426 | srcs = ["version_rewriter.cc"], | |
427 | hdrs = ["version_rewriter.h"], | |
428 | deps = [ | |
429 | ":rewriter_interface", | |
430 | "//base", | |
431 | "//base:logging", | |
432 | "//base:singleton", | |
433 | "//base:version", | |
434 | "//converter:segments", | |
435 | "//protocol:commands_proto", | |
436 | "//request:conversion_request", | |
437 | "@com_google_absl//absl/strings", | |
438 | ], | |
439 | alwayslink = 1, | |
440 | ) | |
441 | ||
442 | cc_test_mozc( | |
443 | name = "version_rewriter_test", | |
444 | size = "small", | |
445 | srcs = ["version_rewriter_test.cc"], | |
446 | deps = [ | |
447 | ":version_rewriter", | |
448 | "//base:system_util", | |
449 | "//base:util", | |
450 | "//config:config_handler", | |
451 | "//converter:segments", | |
452 | "//protocol:commands_proto", | |
453 | "//request:conversion_request", | |
454 | "//testing:googletest", | |
455 | "//testing:gunit_main", | |
456 | ], | |
457 | ) | |
458 | ||
459 | cc_library_mozc( | |
460 | name = "symbol_rewriter", | |
461 | srcs = ["symbol_rewriter.cc"], | |
462 | hdrs = ["symbol_rewriter.h"], | |
463 | deps = [ | |
464 | ":rewriter_interface", | |
465 | "//base", | |
466 | "//base:logging", | |
467 | "//base:singleton", | |
468 | "//base:util", | |
469 | "//config:character_form_manager", | |
470 | "//config:config_handler", | |
471 | "//converter:converter_interface", | |
472 | "//converter:segments", | |
473 | "//data_manager:data_manager_interface", | |
474 | "//data_manager:serialized_dictionary", | |
475 | "//protocol:commands_proto", | |
476 | "//protocol:config_proto", | |
477 | "//request:conversion_request", | |
478 | "//testing:gunit_prod", | |
479 | "@com_google_absl//absl/strings", | |
480 | ], | |
481 | alwayslink = 1, | |
482 | ) | |
483 | ||
484 | cc_test_mozc( | |
485 | name = "symbol_rewriter_test", | |
486 | size = "small", | |
487 | timeout = "moderate", | |
488 | srcs = ["symbol_rewriter_test.cc"], | |
489 | deps = [ | |
490 | ":symbol_rewriter", | |
491 | "//base", | |
492 | "//base:logging", | |
493 | "//base:system_util", | |
494 | "//base:util", | |
495 | "//config:config_handler", | |
496 | "//converter:segments", | |
497 | "//data_manager/testing:mock_data_manager", | |
498 | "//engine:engine_interface", | |
499 | "//engine:mock_data_engine_factory", | |
500 | "//protocol:commands_proto", | |
501 | "//request:conversion_request", | |
502 | "//session:request_test_util", | |
503 | "//testing:googletest", | |
504 | "//testing:gunit_main", | |
505 | ], | |
506 | ) | |
507 | ||
508 | cc_library_mozc( | |
509 | name = "emoticon_rewriter", | |
510 | srcs = ["emoticon_rewriter.cc"], | |
511 | hdrs = ["emoticon_rewriter.h"], | |
512 | deps = [ | |
513 | ":rewriter_interface", | |
514 | "//base", | |
515 | "//base:logging", | |
516 | "//base:singleton", | |
517 | "//base:util", | |
518 | "//config:config_handler", | |
519 | "//converter:segments", | |
520 | "//data_manager:data_manager_interface", | |
521 | "//data_manager:serialized_dictionary", | |
522 | "//protocol:commands_proto", | |
523 | "//protocol:config_proto", | |
524 | "//request:conversion_request", | |
525 | "@com_google_absl//absl/strings", | |
526 | ], | |
527 | alwayslink = 1, | |
528 | ) | |
529 | ||
530 | cc_test_mozc( | |
531 | name = "emoticon_rewriter_test", | |
532 | size = "small", | |
533 | srcs = ["emoticon_rewriter_test.cc"], | |
534 | deps = [ | |
535 | ":emoticon_rewriter", | |
536 | "//base", | |
537 | "//base:logging", | |
538 | "//base:system_util", | |
539 | "//base:util", | |
540 | "//config:config_handler", | |
541 | "//converter:segments", | |
542 | "//data_manager/testing:mock_data_manager", | |
543 | "//protocol:commands_proto", | |
544 | "//protocol:config_proto", | |
545 | "//request:conversion_request", | |
546 | "//testing:googletest", | |
547 | "//testing:gunit_main", | |
548 | "//testing:mozctest", | |
549 | ], | |
550 | ) | |
551 | ||
552 | cc_library_mozc( | |
553 | name = "variants_rewriter", | |
554 | srcs = ["variants_rewriter.cc"], | |
555 | hdrs = ["variants_rewriter.h"], | |
556 | deps = [ | |
557 | ":rewriter_interface", | |
558 | "//base", | |
559 | "//base:logging", | |
560 | "//base:number_util", | |
561 | "//base:port", | |
562 | "//base:util", | |
563 | "//config:character_form_manager", | |
564 | "//converter:segments", | |
565 | "//dictionary:pos_matcher_lib", | |
566 | "//protocol:commands_proto", | |
567 | "//request:conversion_request", | |
568 | "@com_google_absl//absl/strings", | |
569 | ], | |
570 | alwayslink = 1, | |
571 | ) | |
572 | ||
573 | cc_test_mozc( | |
574 | name = "variants_rewriter_test", | |
575 | size = "small", | |
576 | srcs = ["variants_rewriter_test.cc"], | |
577 | deps = [ | |
578 | ":variants_rewriter", | |
579 | "//base", | |
580 | "//base:logging", | |
581 | "//base:util", | |
582 | "//config:character_form_manager", | |
583 | "//converter:segments", | |
584 | "//data_manager/testing:mock_data_manager", | |
585 | "//dictionary:pos_matcher_lib", | |
586 | "//protocol:commands_proto", | |
587 | "//protocol:config_proto", | |
588 | "//request:conversion_request", | |
589 | "//testing:gunit_main", | |
590 | "//testing:mozctest", | |
591 | ], | |
592 | ) | |
593 | ||
594 | cc_library_mozc( | |
595 | name = "english_variants_rewriter", | |
596 | srcs = ["english_variants_rewriter.cc"], | |
597 | hdrs = ["english_variants_rewriter.h"], | |
598 | deps = [ | |
599 | ":rewriter_interface", | |
600 | "//base", | |
601 | "//base:logging", | |
602 | "//base:mozc_hash_set", | |
603 | "//base:util", | |
604 | "//converter:segments", | |
605 | "//protocol:commands_proto", | |
606 | "//request:conversion_request", | |
607 | "//testing:gunit_prod", | |
608 | ], | |
609 | alwayslink = 1, | |
610 | ) | |
611 | ||
612 | cc_test_mozc( | |
613 | name = "english_variants_rewriter_test", | |
614 | size = "small", | |
615 | srcs = ["english_variants_rewriter_test.cc"], | |
616 | deps = [ | |
617 | ":english_variants_rewriter", | |
618 | "//base", | |
619 | "//base:system_util", | |
620 | "//converter:segments", | |
621 | "//protocol:commands_proto", | |
622 | "//request:conversion_request", | |
623 | "//testing:googletest", | |
624 | "//testing:gunit_main", | |
625 | ], | |
626 | ) | |
627 | ||
628 | cc_library_mozc( | |
629 | name = "fortune_rewriter", | |
630 | srcs = ["fortune_rewriter.cc"], | |
631 | hdrs = ["fortune_rewriter.h"], | |
632 | deps = [ | |
633 | ":rewriter_interface", | |
634 | "//base", | |
635 | "//base:clock", | |
636 | "//base:logging", | |
637 | "//base:singleton", | |
638 | "//base:util", | |
639 | "//converter:segments", | |
640 | "//protocol:commands_proto", | |
641 | "//request:conversion_request", | |
642 | ], | |
643 | alwayslink = 1, | |
644 | ) | |
645 | ||
646 | cc_test_mozc( | |
647 | name = "fortune_rewriter_test", | |
648 | size = "small", | |
649 | srcs = ["fortune_rewriter_test.cc"], | |
650 | deps = [ | |
651 | ":fortune_rewriter", | |
652 | "//base", | |
653 | "//base:logging", | |
654 | "//base:system_util", | |
655 | "//converter:segments", | |
656 | "//request:conversion_request", | |
657 | "//testing:googletest", | |
658 | "//testing:gunit_main", | |
659 | ], | |
660 | ) | |
661 | ||
662 | cc_library_mozc( | |
663 | name = "dice_rewriter", | |
664 | srcs = ["dice_rewriter.cc"], | |
665 | hdrs = ["dice_rewriter.h"], | |
666 | deps = [ | |
667 | ":rewriter_interface", | |
668 | "//base", | |
669 | "//base:logging", | |
670 | "//base:util", | |
671 | "//converter:segments", | |
672 | "//protocol:commands_proto", | |
673 | "//request:conversion_request", | |
674 | ], | |
675 | alwayslink = 1, | |
676 | ) | |
677 | ||
678 | cc_test_mozc( | |
679 | name = "dice_rewriter_test", | |
680 | size = "small", | |
681 | srcs = ["dice_rewriter_test.cc"], | |
682 | deps = [ | |
683 | ":dice_rewriter", | |
684 | "//base", | |
685 | "//base:system_util", | |
686 | "//converter:segments", | |
687 | "//request:conversion_request", | |
688 | "//testing:googletest", | |
689 | "//testing:gunit_main", | |
690 | ], | |
691 | ) | |
692 | ||
693 | cc_library_mozc( | |
694 | name = "calculator_rewriter", | |
695 | srcs = ["calculator_rewriter.cc"], | |
696 | hdrs = ["calculator_rewriter.h"], | |
697 | deps = [ | |
698 | ":rewriter_interface", | |
699 | "//base", | |
700 | "//base:logging", | |
701 | "//base:util", | |
702 | "//config:config_handler", | |
703 | "//converter:converter_interface", | |
704 | "//converter:segments", | |
705 | "//protocol:commands_proto", | |
706 | "//protocol:config_proto", | |
707 | "//request:conversion_request", | |
708 | "//rewriter/calculator", | |
709 | ], | |
710 | alwayslink = 1, | |
711 | ) | |
712 | ||
713 | cc_test_mozc( | |
714 | name = "calculator_rewriter_test", | |
715 | size = "small", | |
716 | timeout = "moderate", | |
717 | srcs = ["calculator_rewriter_test.cc"], | |
718 | deps = [ | |
719 | ":calculator_rewriter", | |
720 | "//base", | |
721 | "//base:logging", | |
722 | "//base:system_util", | |
723 | "//config:config_handler", | |
724 | "//converter:converter_interface", | |
725 | "//converter:converter_mock", | |
726 | "//converter:segments", | |
727 | "//engine:engine_interface", | |
728 | "//engine:mock_data_engine_factory", | |
729 | "//protocol:commands_proto", | |
730 | "//protocol:config_proto", | |
731 | "//request:conversion_request", | |
732 | "//rewriter/calculator", | |
733 | "//rewriter/calculator:calculator_mock", | |
734 | "//testing:googletest", | |
735 | "//testing:gunit_main", | |
736 | ], | |
737 | ) | |
738 | ||
739 | cc_library_mozc( | |
740 | name = "unicode_rewriter", | |
741 | srcs = ["unicode_rewriter.cc"], | |
742 | hdrs = ["unicode_rewriter.h"], | |
743 | deps = [ | |
744 | ":rewriter_interface", | |
745 | "//base", | |
746 | "//base:logging", | |
747 | "//base:number_util", | |
748 | "//base:util", | |
749 | "//composer", | |
750 | "//converter:converter_interface", | |
751 | "//converter:segments", | |
752 | "//request:conversion_request", | |
753 | "//testing:gunit_prod", | |
754 | ], | |
755 | alwayslink = 1, | |
756 | ) | |
757 | ||
758 | cc_test_mozc( | |
759 | name = "unicode_rewriter_test", | |
760 | size = "small", | |
761 | timeout = "moderate", | |
762 | srcs = ["unicode_rewriter_test.cc"], | |
763 | deps = [ | |
764 | ":unicode_rewriter", | |
765 | "//base", | |
766 | "//base:port", | |
767 | "//base:system_util", | |
768 | "//base:util", | |
769 | "//composer", | |
770 | "//config:config_handler", | |
771 | "//converter:segments", | |
772 | "//engine:engine_interface", | |
773 | "//engine:mock_data_engine_factory", | |
774 | "//protocol:commands_proto", | |
775 | "//protocol:config_proto", | |
776 | "//request:conversion_request", | |
777 | "//testing:googletest", | |
778 | "//testing:gunit_main", | |
779 | ], | |
780 | ) | |
781 | ||
782 | cc_library_mozc( | |
783 | name = "user_dictionary_rewriter", | |
784 | srcs = ["user_dictionary_rewriter.cc"], | |
785 | hdrs = ["user_dictionary_rewriter.h"], | |
786 | deps = [ | |
787 | ":rewriter_interface", | |
788 | "//base", | |
789 | "//base:logging", | |
790 | "//base:util", | |
791 | "//converter:segments", | |
792 | "//protocol:commands_proto", | |
793 | "//request:conversion_request", | |
794 | "//testing:gunit_prod", | |
795 | ], | |
796 | alwayslink = 1, | |
797 | ) | |
798 | ||
799 | cc_test_mozc( | |
800 | name = "user_dictionary_rewriter_test", | |
801 | size = "small", | |
802 | srcs = ["user_dictionary_rewriter_test.cc"], | |
803 | deps = [ | |
804 | ":user_dictionary_rewriter", | |
805 | "//base", | |
806 | "//base:logging", | |
807 | "//base:system_util", | |
808 | "//base:util", | |
809 | "//converter:segments", | |
810 | "//request:conversion_request", | |
811 | "//testing:googletest", | |
812 | "//testing:gunit_main", | |
813 | ], | |
814 | ) | |
815 | ||
816 | cc_library_mozc( | |
817 | name = "dictionary_generator", | |
818 | srcs = [ | |
819 | "dictionary_generator.cc", | |
820 | ], | |
821 | hdrs = ["dictionary_generator.h"], | |
822 | deps = [ | |
823 | "//base", | |
824 | "//base:file_stream", | |
825 | "//base:freelist", | |
826 | "//base:hash", | |
827 | "//base:logging", | |
828 | "//base:port", | |
829 | "//data_manager:data_manager_interface", | |
830 | "//dictionary:pos_matcher_lib", | |
831 | "//dictionary:user_pos", | |
832 | ], | |
833 | ) | |
834 | ||
835 | cc_test_mozc( | |
836 | name = "dictionary_generator_test", | |
837 | size = "small", | |
838 | srcs = ["dictionary_generator_test.cc"], | |
839 | deps = [ | |
840 | ":dictionary_generator", | |
841 | "//base", | |
842 | "//testing:gunit_main", | |
843 | ], | |
844 | ) | |
845 | ||
846 | cc_binary_mozc( | |
847 | name = "gen_symbol_rewriter_dictionary_main", | |
848 | srcs = ["gen_symbol_rewriter_dictionary_main.cc"], | |
849 | deps = [ | |
850 | ":dictionary_generator", | |
851 | "//base", | |
852 | "//base:file_stream", | |
853 | "//base:file_util", | |
854 | "//base:flags", | |
855 | "//base:init_mozc_buildtool", | |
856 | "//base:logging", | |
857 | "//base:util", | |
858 | "//data_manager", | |
859 | "//data_manager:serialized_dictionary", | |
860 | ], | |
861 | ) | |
862 | ||
863 | cc_binary_mozc( | |
864 | name = "gen_emoticon_rewriter_data", | |
865 | srcs = ["gen_emoticon_rewriter_data.cc"], | |
866 | deps = [ | |
867 | ":rewriter_interface", | |
868 | "//base:file_stream", | |
869 | "//base:flags", | |
870 | "//base:init_mozc_buildtool", | |
871 | "//base:logging", | |
872 | "//base:mozc_hash_map", | |
873 | "//base:util", | |
874 | "//data_manager:serialized_dictionary", | |
875 | "@com_google_absl//absl/strings", | |
876 | ], | |
877 | ) | |
878 | ||
879 | py_library_mozc( | |
880 | name = "gen_emoji_rewriter_data_lib", | |
881 | srcs = ["gen_emoji_rewriter_data.py"], | |
882 | deps = [ | |
883 | "//build_tools:code_generator_util", | |
884 | "//build_tools:serialized_string_array_builder", | |
885 | ], | |
886 | ) | |
887 | ||
888 | py_binary_mozc( | |
889 | name = "gen_emoji_rewriter_data", | |
890 | srcs = ["gen_emoji_rewriter_data.py"], | |
891 | deps = [ | |
892 | ":gen_emoji_rewriter_data_lib", | |
893 | "//build_tools:code_generator_util", | |
894 | "//build_tools:serialized_string_array_builder", | |
895 | ], | |
896 | ) | |
897 | ||
898 | cc_library_mozc( | |
899 | name = "emoji_rewriter", | |
900 | srcs = ["emoji_rewriter.cc"], | |
901 | hdrs = ["emoji_rewriter.h"], | |
902 | deps = [ | |
903 | ":rewriter_interface", | |
904 | "//base", | |
905 | "//base:iterator_adapter", | |
906 | "//base:logging", | |
907 | "//base:serialized_string_array", | |
908 | "//base:util", | |
909 | "//config:config_handler", | |
910 | "//converter:segments", | |
911 | "//data_manager:data_manager_interface", | |
912 | "//protocol:commands_proto", | |
913 | "//protocol:config_proto", | |
914 | "//request:conversion_request", | |
915 | "//usage_stats", | |
916 | "@com_google_absl//absl/strings", | |
917 | ], | |
918 | alwayslink = 1, | |
919 | ) | |
920 | ||
921 | cc_test_mozc( | |
922 | name = "emoji_rewriter_test", | |
923 | size = "small", | |
924 | srcs = ["emoji_rewriter_test.cc"], | |
925 | deps = [ | |
926 | ":emoji_rewriter", | |
927 | ":variants_rewriter", | |
928 | "//base", | |
929 | "//base:logging", | |
930 | "//base:serialized_string_array", | |
931 | "//base:util", | |
932 | "//config:character_form_manager", | |
933 | "//config:config_handler", | |
934 | "//converter:segments", | |
935 | "//data_manager/testing:mock_data_manager", | |
936 | "//dictionary:pos_matcher_lib", | |
937 | "//protocol:commands_proto", | |
938 | "//protocol:config_proto", | |
939 | "//request:conversion_request", | |
940 | "//storage:registry", | |
941 | "//testing:gunit_main", | |
942 | "//testing:mozctest", | |
943 | "//usage_stats", | |
944 | "//usage_stats:usage_stats_testing_util", | |
945 | "@com_google_absl//absl/strings", | |
946 | ], | |
947 | ) | |
948 | ||
949 | cc_library_mozc( | |
950 | name = "single_kanji_rewriter", | |
951 | srcs = ["single_kanji_rewriter.cc"], | |
952 | hdrs = ["single_kanji_rewriter.h"], | |
953 | deps = [ | |
954 | ":rewriter_interface", | |
955 | "//base", | |
956 | "//base:logging", | |
957 | "//base:port", | |
958 | "//base:serialized_string_array", | |
959 | "//base:util", | |
960 | "//config:config_handler", | |
961 | "//converter:segments", | |
962 | "//data_manager:data_manager_interface", | |
963 | "//data_manager:serialized_dictionary", | |
964 | "//dictionary:pos_matcher_lib", | |
965 | "//protocol:commands_proto", | |
966 | "//protocol:config_proto", | |
967 | "//request:conversion_request", | |
968 | "@com_google_absl//absl/strings", | |
969 | ], | |
970 | alwayslink = 1, | |
971 | ) | |
972 | ||
973 | py_library_mozc( | |
974 | name = "gen_single_kanji_rewriter_data_lib", | |
975 | srcs = ["gen_single_kanji_rewriter_data.py"], | |
976 | deps = [ | |
977 | "//build_tools:code_generator_util", | |
978 | "//build_tools:serialized_string_array_builder", | |
979 | ], | |
980 | ) | |
981 | ||
982 | py_binary_mozc( | |
983 | name = "gen_single_kanji_rewriter_data", | |
984 | srcs = ["gen_single_kanji_rewriter_data.py"], | |
985 | deps = [ | |
986 | ":gen_single_kanji_rewriter_data_lib", | |
987 | "//build_tools:code_generator_util", | |
988 | "//build_tools:serialized_string_array_builder", | |
989 | ], | |
990 | ) | |
991 | ||
992 | cc_binary_mozc( | |
993 | name = "gen_single_kanji_noun_prefix_data", | |
994 | srcs = ["gen_single_kanji_noun_prefix_data.cc"], | |
995 | deps = [ | |
996 | "//base:flags", | |
997 | "//base:init_mozc_buildtool", | |
998 | "//base:port", | |
999 | "//data_manager:serialized_dictionary", | |
1000 | ], | |
1001 | ) | |
1002 | ||
1003 | cc_test_mozc( | |
1004 | name = "single_kanji_rewriter_test", | |
1005 | size = "small", | |
1006 | srcs = ["single_kanji_rewriter_test.cc"], | |
1007 | deps = [ | |
1008 | ":single_kanji_rewriter", | |
1009 | "//base:system_util", | |
1010 | "//base:util", | |
1011 | "//config:config_handler", | |
1012 | "//converter:segments", | |
1013 | "//data_manager/testing:mock_data_manager", | |
1014 | "//dictionary:pos_matcher_lib", | |
1015 | "//protocol:commands_proto", | |
1016 | "//request:conversion_request", | |
1017 | "//session:request_test_util", | |
1018 | "//testing:googletest", | |
1019 | "//testing:gunit_main", | |
1020 | ], | |
1021 | ) | |
1022 | ||
1023 | py_library_mozc( | |
1024 | name = "gen_counter_suffix_array_lib", | |
1025 | srcs = ["gen_counter_suffix_array.py"], | |
1026 | deps = [ | |
1027 | "//build_tools:code_generator_util", | |
1028 | "//build_tools:serialized_string_array_builder", | |
1029 | ], | |
1030 | ) | |
1031 | ||
1032 | py_binary_mozc( | |
1033 | name = "gen_counter_suffix_array", | |
1034 | srcs = ["gen_counter_suffix_array.py"], | |
1035 | deps = [ | |
1036 | ":gen_counter_suffix_array_lib", | |
1037 | "//build_tools:code_generator_util", | |
1038 | "//build_tools:serialized_string_array_builder", | |
1039 | ], | |
1040 | ) | |
1041 | ||
1042 | cc_library_mozc( | |
1043 | name = "focus_candidate_rewriter", | |
1044 | srcs = [ | |
1045 | "focus_candidate_rewriter.cc", | |
1046 | ], | |
1047 | hdrs = ["focus_candidate_rewriter.h"], | |
1048 | deps = [ | |
1049 | ":number_compound_util", | |
1050 | ":rewriter_interface", | |
1051 | "//base", | |
1052 | "//base:logging", | |
1053 | "//base:number_util", | |
1054 | "//base:port", | |
1055 | "//base:serialized_string_array", | |
1056 | "//base:util", | |
1057 | "//converter:segments", | |
1058 | "//data_manager:data_manager_interface", | |
1059 | "//dictionary:pos_matcher_lib", | |
1060 | "//request:conversion_request", | |
1061 | "@com_google_absl//absl/strings", | |
1062 | ], | |
1063 | ) | |
1064 | ||
1065 | cc_test_mozc( | |
1066 | name = "focus_candidate_rewriter_test", | |
1067 | size = "small", | |
1068 | srcs = ["focus_candidate_rewriter_test.cc"], | |
1069 | deps = [ | |
1070 | ":focus_candidate_rewriter", | |
1071 | "//base", | |
1072 | "//base:number_util", | |
1073 | "//base:system_util", | |
1074 | "//config:config_handler", | |
1075 | "//converter:segments", | |
1076 | "//data_manager/testing:mock_data_manager", | |
1077 | "//testing:googletest", | |
1078 | "//testing:gunit_main", | |
1079 | "//transliteration", | |
1080 | ], | |
1081 | ) | |
1082 | ||
1083 | cc_library_mozc( | |
1084 | name = "zipcode_rewriter", | |
1085 | srcs = [ | |
1086 | "zipcode_rewriter.cc", | |
1087 | ], | |
1088 | hdrs = ["zipcode_rewriter.h"], | |
1089 | deps = [ | |
1090 | ":rewriter_interface", | |
1091 | "//base", | |
1092 | "//base:logging", | |
1093 | "//base:port", | |
1094 | "//config:config_handler", | |
1095 | "//converter:segments", | |
1096 | "//dictionary:pos_matcher_lib", | |
1097 | "//protocol:commands_proto", | |
1098 | "//protocol:config_proto", | |
1099 | "//request:conversion_request", | |
1100 | ], | |
1101 | alwayslink = 1, | |
1102 | ) | |
1103 | ||
1104 | cc_test_mozc( | |
1105 | name = "zipcode_rewriter_test", | |
1106 | size = "small", | |
1107 | srcs = [ | |
1108 | "zipcode_rewriter_test.cc", | |
1109 | ], | |
1110 | deps = [ | |
1111 | ":zipcode_rewriter", | |
1112 | "//base", | |
1113 | "//base:logging", | |
1114 | "//config:config_handler", | |
1115 | "//converter:segments", | |
1116 | "//data_manager/testing:mock_data_manager", | |
1117 | "//dictionary:pos_matcher_lib", | |
1118 | "//protocol:commands_proto", | |
1119 | "//protocol:config_proto", | |
1120 | "//request:conversion_request", | |
1121 | "//testing:gunit_main", | |
1122 | "//testing:mozctest", | |
1123 | ], | |
1124 | ) | |
1125 | ||
1126 | cc_library_mozc( | |
1127 | name = "katakana_promotion_rewriter", | |
1128 | srcs = ["katakana_promotion_rewriter.cc"], | |
1129 | hdrs = ["katakana_promotion_rewriter.h"], | |
1130 | deps = [ | |
1131 | ":rewriter_interface", | |
1132 | "//base", | |
1133 | "//base:util", | |
1134 | "//converter:segments", | |
1135 | "//protocol:commands_proto", | |
1136 | "//request:conversion_request", | |
1137 | "//transliteration", | |
1138 | ], | |
1139 | alwayslink = 1, | |
1140 | ) | |
1141 | ||
1142 | cc_test_mozc( | |
1143 | name = "katakana_promotion_rewriter_test", | |
1144 | size = "small", | |
1145 | srcs = ["katakana_promotion_rewriter_test.cc"], | |
1146 | deps = [ | |
1147 | ":katakana_promotion_rewriter", | |
1148 | ":transliteration_rewriter", | |
1149 | "//base", | |
1150 | "//converter:segments", | |
1151 | "//data_manager/testing:mock_data_manager", | |
1152 | "//dictionary:pos_matcher_lib", | |
1153 | "//protocol:commands_proto", | |
1154 | "//request:conversion_request", | |
1155 | "//testing:gunit_main", | |
1156 | "//testing:mozctest", | |
1157 | ], | |
1158 | ) | |
1159 | ||
1160 | cc_library_mozc( | |
1161 | name = "command_rewriter", | |
1162 | srcs = ["command_rewriter.cc"], | |
1163 | hdrs = ["command_rewriter.h"], | |
1164 | deps = [ | |
1165 | ":rewriter_interface", | |
1166 | "//base", | |
1167 | "//base:config_file_stream", | |
1168 | "//base:logging", | |
1169 | "//config:config_handler", | |
1170 | "//converter:segments", | |
1171 | "//protocol:commands_proto", | |
1172 | "//protocol:config_proto", | |
1173 | "//request:conversion_request", | |
1174 | ], | |
1175 | ) | |
1176 | ||
1177 | cc_test_mozc( | |
1178 | name = "command_rewriter_test", | |
1179 | size = "small", | |
1180 | srcs = ["command_rewriter_test.cc"], | |
1181 | deps = [ | |
1182 | ":command_rewriter", | |
1183 | "//base", | |
1184 | "//base:system_util", | |
1185 | "//config:config_handler", | |
1186 | "//converter:segments", | |
1187 | "//protocol:commands_proto", | |
1188 | "//protocol:config_proto", | |
1189 | "//request:conversion_request", | |
1190 | "//testing:googletest", | |
1191 | "//testing:gunit_main", | |
1192 | ], | |
1193 | ) | |
1194 | ||
1195 | cc_library_mozc( | |
1196 | name = "normalization_rewriter", | |
1197 | srcs = ["normalization_rewriter.cc"], | |
1198 | hdrs = ["normalization_rewriter.h"], | |
1199 | deps = [ | |
1200 | ":rewriter_interface", | |
1201 | "//base", | |
1202 | "//base:logging", | |
1203 | "//base:text_normalizer", | |
1204 | "//base:util", | |
1205 | "//converter:segments", | |
1206 | "//protocol:commands_proto", | |
1207 | "//request:conversion_request", | |
1208 | ], | |
1209 | ) | |
1210 | ||
1211 | cc_test_mozc( | |
1212 | name = "normalization_rewriter_test", | |
1213 | size = "small", | |
1214 | srcs = ["normalization_rewriter_test.cc"], | |
1215 | deps = [ | |
1216 | ":normalization_rewriter", | |
1217 | "//base", | |
1218 | "//base:system_util", | |
1219 | "//converter:segments", | |
1220 | "//request:conversion_request", | |
1221 | "//testing:googletest", | |
1222 | "//testing:gunit_main", | |
1223 | ], | |
1224 | ) | |
1225 | ||
1226 | cc_library_mozc( | |
1227 | name = "remove_redundant_candidate_rewriter", | |
1228 | srcs = ["remove_redundant_candidate_rewriter.cc"], | |
1229 | hdrs = ["remove_redundant_candidate_rewriter.h"], | |
1230 | deps = [ | |
1231 | ":rewriter_interface", | |
1232 | "//base", | |
1233 | "//converter:segments", | |
1234 | "//protocol:commands_proto", | |
1235 | "//request:conversion_request", | |
1236 | ], | |
1237 | ) | |
1238 | ||
1239 | cc_test_mozc( | |
1240 | name = "remove_redundant_candidate_rewriter_test", | |
1241 | size = "small", | |
1242 | srcs = ["remove_redundant_candidate_rewriter_test.cc"], | |
1243 | deps = [ | |
1244 | ":remove_redundant_candidate_rewriter", | |
1245 | "//base", | |
1246 | "//converter:segments", | |
1247 | "//protocol:commands_proto", | |
1248 | "//request:conversion_request", | |
1249 | "//testing:gunit_main", | |
1250 | ], | |
1251 | ) | |
1252 | ||
1253 | cc_binary_mozc( | |
1254 | name = "gen_usage_rewriter_dictionary_main", | |
1255 | srcs = ["gen_usage_rewriter_dictionary_main.cc"], | |
1256 | deps = [ | |
1257 | "//base", | |
1258 | "//base:file_stream", | |
1259 | "//base:flags", | |
1260 | "//base:init_mozc_buildtool", | |
1261 | "//base:logging", | |
1262 | "//base:serialized_string_array", | |
1263 | "//base:util", | |
1264 | "@com_google_absl//absl/strings", | |
1265 | ], | |
1266 | ) | |
1267 | ||
1268 | cc_library_mozc( | |
1269 | name = "usage_rewriter", | |
1270 | srcs = [ | |
1271 | "usage_rewriter.cc", | |
1272 | ], | |
1273 | hdrs = ["usage_rewriter.h"], | |
1274 | deps = [ | |
1275 | ":rewriter_interface", | |
1276 | "//base", | |
1277 | "//base:logging", | |
1278 | "//base:port", | |
1279 | "//base:serialized_string_array", | |
1280 | "//base:util", | |
1281 | "//config:config_handler", | |
1282 | "//converter:segments", | |
1283 | "//data_manager:data_manager_interface", | |
1284 | "//dictionary:dictionary_interface", | |
1285 | "//dictionary:pos_matcher_lib", | |
1286 | "//dictionary:user_dictionary", | |
1287 | "//protocol:commands_proto", | |
1288 | "//protocol:config_proto", | |
1289 | "//request:conversion_request", | |
1290 | "//testing:gunit_prod", | |
1291 | "@com_google_absl//absl/strings", | |
1292 | ], | |
1293 | ) | |
1294 | ||
1295 | cc_test_mozc( | |
1296 | name = "usage_rewriter_test", | |
1297 | size = "small", | |
1298 | srcs = ["usage_rewriter_test.cc"], | |
1299 | deps = [ | |
1300 | ":rewriter_interface", | |
1301 | ":usage_rewriter", | |
1302 | "//base", | |
1303 | "//base:system_util", | |
1304 | "//config:config_handler", | |
1305 | "//converter:segments", | |
1306 | "//data_manager/testing:mock_data_manager", | |
1307 | "//dictionary:pos_matcher_lib", | |
1308 | "//dictionary:suppression_dictionary", | |
1309 | "//dictionary:user_dictionary", | |
1310 | "//dictionary:user_dictionary_storage", | |
1311 | "//dictionary:user_pos", | |
1312 | "//protocol:commands_proto", | |
1313 | "//protocol:config_proto", | |
1314 | "//request:conversion_request", | |
1315 | "//testing:googletest", | |
1316 | "//testing:gunit_main", | |
1317 | ], | |
1318 | ) | |
1319 | ||
1320 | py_library_mozc( | |
1321 | name = "gen_reading_correction_data_lib", | |
1322 | srcs = ["gen_reading_correction_data.py"], | |
1323 | deps = [ | |
1324 | "//build_tools:code_generator_util", | |
1325 | "//build_tools:serialized_string_array_builder", | |
1326 | ], | |
1327 | ) | |
1328 | ||
1329 | py_binary_mozc( | |
1330 | name = "gen_reading_correction_data", | |
1331 | srcs = ["gen_reading_correction_data.py"], | |
1332 | deps = [ | |
1333 | ":gen_reading_correction_data_lib", | |
1334 | "//build_tools:code_generator_util", | |
1335 | "//build_tools:serialized_string_array_builder", | |
1336 | ], | |
1337 | ) | |
1338 | ||
1339 | cc_library_mozc( | |
1340 | name = "correction_rewriter", | |
1341 | srcs = ["correction_rewriter.cc"], | |
1342 | hdrs = ["correction_rewriter.h"], | |
1343 | deps = [ | |
1344 | ":rewriter_interface", | |
1345 | "//base", | |
1346 | "//base:logging", | |
1347 | "//base:serialized_string_array", | |
1348 | "//base:util", | |
1349 | "//config:config_handler", | |
1350 | "//converter:segments", | |
1351 | "//data_manager:data_manager_interface", | |
1352 | "//protocol:commands_proto", | |
1353 | "//protocol:config_proto", | |
1354 | "//request:conversion_request", | |
1355 | "@com_google_absl//absl/strings", | |
1356 | ], | |
1357 | ) | |
1358 | ||
1359 | cc_test_mozc( | |
1360 | name = "correction_rewriter_test", | |
1361 | size = "small", | |
1362 | srcs = ["correction_rewriter_test.cc"], | |
1363 | deps = [ | |
1364 | ":correction_rewriter", | |
1365 | "//base", | |
1366 | "//base:port", | |
1367 | "//base:serialized_string_array", | |
1368 | "//config:config_handler", | |
1369 | "//converter:segments", | |
1370 | "//protocol:commands_proto", | |
1371 | "//protocol:config_proto", | |
1372 | "//request:conversion_request", | |
1373 | "//testing:gunit_main", | |
1374 | "@com_google_absl//absl/strings", | |
1375 | ], | |
1376 | ) | |
1377 | ||
1378 | cc_library_mozc( | |
1379 | name = "rewriter", | |
1380 | srcs = [ | |
1381 | "rewriter.cc", | |
1382 | ], | |
1383 | hdrs = ["rewriter.h"], | |
1384 | deps = [ | |
1385 | ":calculator_rewriter", | |
1386 | ":collocation_rewriter", | |
1387 | ":command_rewriter", | |
1388 | ":correction_rewriter", | |
1389 | ":date_rewriter", | |
1390 | ":dice_rewriter", | |
1391 | ":emoji_rewriter", | |
1392 | ":emoticon_rewriter", | |
1393 | ":english_variants_rewriter", | |
1394 | ":focus_candidate_rewriter", | |
1395 | ":fortune_rewriter", | |
1396 | ":katakana_promotion_rewriter", | |
1397 | ":language_aware_rewriter", | |
1398 | ":merger_rewriter", | |
1399 | ":normalization_rewriter", | |
1400 | ":number_rewriter", | |
1401 | ":remove_redundant_candidate_rewriter", | |
1402 | ":rewriter_interface", | |
1403 | ":single_kanji_rewriter", | |
1404 | ":symbol_rewriter", | |
1405 | ":transliteration_rewriter", | |
1406 | ":unicode_rewriter", | |
1407 | ":usage_rewriter", | |
1408 | ":user_boundary_history_rewriter", | |
1409 | ":user_dictionary_rewriter", | |
1410 | ":user_segment_history_rewriter", | |
1411 | ":variants_rewriter", | |
1412 | ":version_rewriter", | |
1413 | ":zipcode_rewriter", | |
1414 | "//base", | |
1415 | "//base:flags", | |
1416 | "//base:logging", | |
1417 | "//base:port", | |
1418 | "//converter:converter_interface", | |
1419 | "//data_manager:data_manager_interface", | |
1420 | "//dictionary:dictionary_interface", | |
1421 | "//dictionary:pos_group", | |
1422 | "//dictionary:pos_matcher_lib", | |
1423 | ], | |
1424 | alwayslink = 1, | |
1425 | ) | |
1426 | ||
1427 | cc_library_mozc( | |
1428 | name = "rewriter_factory", | |
1429 | srcs = ["rewriter_factory.cc"], | |
1430 | hdrs = ["rewriter_factory.h"], | |
1431 | visibility = [], | |
1432 | deps = [ | |
1433 | ":rewriter", | |
1434 | ":rewriter_interface", | |
1435 | "//base", | |
1436 | "//base:logging", | |
1437 | "//base:singleton", | |
1438 | "//converter", | |
1439 | "//converter:converter_interface", | |
1440 | "//converter:segments", | |
1441 | "//dictionary:pos_group", | |
1442 | "//dictionary:pos_matcher_lib", | |
1443 | "//dictionary:suffix_dictionary", | |
1444 | "//engine:large_immutable_converter", | |
1445 | "//prediction:dictionary_predictor", | |
1446 | "//prediction:predictor", | |
1447 | "//prediction:user_history_predictor", | |
1448 | "//request:conversion_request", | |
1449 | "@com_google_absl//absl/memory", | |
1450 | ], | |
1451 | ) | |
1452 | ||
1453 | cc_test_mozc( | |
1454 | name = "rewriter_test", | |
1455 | size = "small", | |
1456 | timeout = "moderate", | |
1457 | srcs = ["rewriter_test.cc"], | |
1458 | deps = [ | |
1459 | "rewriter", | |
1460 | ":rewriter_interface", | |
1461 | "//base", | |
1462 | "//base:system_util", | |
1463 | "//config:config_handler", | |
1464 | "//converter:converter_mock", | |
1465 | "//converter:segments", | |
1466 | "//data_manager/testing:mock_data_manager", | |
1467 | "//dictionary:pos_group", | |
1468 | "//request:conversion_request", | |
1469 | "//testing:googletest", | |
1470 | "//testing:gunit_main", | |
1471 | ], | |
1472 | ) | |
1473 | ||
1474 | cc_library_mozc( | |
1475 | name = "collocation_util", | |
1476 | srcs = ["collocation_util.cc"], | |
1477 | hdrs = ["collocation_util.h"], | |
1478 | deps = [ | |
1479 | "//base", | |
1480 | "//base:port", | |
1481 | "//base:util", | |
1482 | "@com_google_absl//absl/strings", | |
1483 | ], | |
1484 | ) | |
1485 | ||
1486 | cc_test_mozc( | |
1487 | name = "collocation_util_test", | |
1488 | size = "small", | |
1489 | srcs = ["collocation_util_test.cc"], | |
1490 | deps = [ | |
1491 | ":collocation_util", | |
1492 | "//base", | |
1493 | "//testing:gunit_main", | |
1494 | ], | |
1495 | ) | |
1496 | ||
1497 | cc_library_mozc( | |
1498 | name = "gen_existence_data", | |
1499 | srcs = ["gen_existence_data.cc"], | |
1500 | hdrs = ["gen_existence_data.h"], | |
1501 | deps = [ | |
1502 | "//base:codegen_bytearray_stream", | |
1503 | "//base:hash", | |
1504 | "//base:logging", | |
1505 | "//storage:existence_filter", | |
1506 | ], | |
1507 | ) | |
1508 | ||
1509 | cc_binary_mozc( | |
1510 | name = "gen_collocation_data_main", | |
1511 | srcs = ["gen_collocation_data_main.cc"], | |
1512 | deps = [ | |
1513 | ":gen_existence_data", | |
1514 | "//base:file_stream", | |
1515 | "//base:flags", | |
1516 | "//base:init_mozc_buildtool", | |
1517 | "//base:logging", | |
1518 | ], | |
1519 | ) | |
1520 | ||
1521 | cc_binary_mozc( | |
1522 | name = "gen_collocation_suppression_data_main", | |
1523 | srcs = ["gen_collocation_suppression_data_main.cc"], | |
1524 | deps = [ | |
1525 | ":gen_existence_data", | |
1526 | "//base:file_stream", | |
1527 | "//base:flags", | |
1528 | "//base:init_mozc_buildtool", | |
1529 | "//base:logging", | |
1530 | "//base:util", | |
1531 | ], | |
1532 | ) | |
1533 | ||
1534 | cc_library_mozc( | |
1535 | name = "number_compound_util", | |
1536 | srcs = [ | |
1537 | "number_compound_util.cc", | |
1538 | ], | |
1539 | hdrs = ["number_compound_util.h"], | |
1540 | deps = [ | |
1541 | "//base", | |
1542 | "//base:port", | |
1543 | "//base:serialized_string_array", | |
1544 | "//base:util", | |
1545 | "//converter:segments", | |
1546 | "//dictionary:pos_matcher_lib", | |
1547 | "@com_google_absl//absl/strings", | |
1548 | ], | |
1549 | ) | |
1550 | ||
1551 | cc_library_mozc( | |
1552 | name = "merger_rewriter", | |
1553 | hdrs = ["merger_rewriter.h"], | |
1554 | visibility = ["//visibility:private"], | |
1555 | deps = [ | |
1556 | ":rewriter_interface", | |
1557 | "//base:stl_util", | |
1558 | "//config:config_handler", | |
1559 | "//converter", | |
1560 | "//converter:segments", | |
1561 | "//protocol:commands_proto", | |
1562 | "//protocol:config_proto", | |
1563 | "//request:conversion_request", | |
1564 | ], | |
1565 | ) | |
1566 | ||
1567 | cc_test_mozc( | |
1568 | name = "number_compound_util_test", | |
1569 | srcs = ["number_compound_util_test.cc"], | |
1570 | deps = [ | |
1571 | ":number_compound_util", | |
1572 | "//base:port", | |
1573 | "//base:serialized_string_array", | |
1574 | "//data_manager/testing:mock_data_manager", | |
1575 | "//dictionary:pos_matcher_lib", | |
1576 | "//testing:gunit_main", | |
1577 | "@com_google_absl//absl/strings", | |
1578 | ], | |
1579 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | ) | |
35 | ||
36 | package(default_visibility = ["//:__subpackages__"]) | |
37 | ||
38 | cc_library_mozc( | |
39 | name = "calculator", | |
40 | srcs = ["calculator.cc"], | |
41 | hdrs = [ | |
42 | "calculator_interface.h", | |
43 | "parser.c", | |
44 | ], | |
45 | deps = [ | |
46 | "//base", | |
47 | "//base:logging", | |
48 | "//base:number_util", | |
49 | "//base:singleton", | |
50 | "//base:util", | |
51 | "@com_google_absl//absl/strings", | |
52 | "@com_google_absl//absl/strings:str_format", | |
53 | ], | |
54 | alwayslink = 1, | |
55 | ) | |
56 | ||
57 | cc_library_mozc( | |
58 | name = "calculator_mock", | |
59 | testonly = 1, | |
60 | srcs = ["calculator_mock.cc"], | |
61 | hdrs = ["calculator_mock.h"], | |
62 | deps = [ | |
63 | ":calculator", | |
64 | "//base", | |
65 | "//base:logging", | |
66 | ], | |
67 | ) | |
68 | ||
69 | cc_test_mozc( | |
70 | name = "calculator_test", | |
71 | size = "small", | |
72 | srcs = ["calculator_test.cc"], | |
73 | data = ["//data/test/calculator:testset.txt"], | |
74 | deps = [ | |
75 | ":calculator", | |
76 | "//base", | |
77 | "//base:file_util", | |
78 | "//base:logging", | |
79 | "//testing:gunit_main", | |
80 | "//testing:mozctest", | |
81 | ], | |
82 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | ) | |
34 | ||
35 | package(default_visibility = ["//:__subpackages__"]) | |
36 | ||
37 | # -*- mode: python; -*- | |
38 | cc_binary_mozc( | |
39 | name = "mozc_server", | |
40 | srcs = [ | |
41 | "mozc_server.cc", | |
42 | "mozc_server.h", | |
43 | "mozc_server_main.cc", | |
44 | ], | |
45 | copts = ["$(STACK_FRAME_UNLIMITED)"], # mozc_server.cc | |
46 | deps = [ | |
47 | "//base", | |
48 | "//base:crash_report_handler", | |
49 | "//base:flags", | |
50 | "//base:init_mozc", | |
51 | "//base:logging", | |
52 | "//base:port", | |
53 | "//base:process_mutex", | |
54 | "//base:run_level", | |
55 | "//base:singleton", | |
56 | "//base:system_util", | |
57 | "//base:util", | |
58 | "//base:winmain", | |
59 | "//config:stats_config_util", | |
60 | "//session", | |
61 | "//session:session_server", | |
62 | ], | |
63 | ) | |
64 | ||
65 | cc_binary_mozc( | |
66 | name = "mozc_rpc_server_main", | |
67 | srcs = ["mozc_rpc_server_main.cc"], | |
68 | deps = [ | |
69 | "//base", | |
70 | "//base:flags", | |
71 | "//base:init_mozc", | |
72 | "//base:singleton", | |
73 | "//base:system_util", | |
74 | "//engine:engine_factory", | |
75 | "//protocol:commands_proto", | |
76 | "//session", | |
77 | "//session:random_keyevents_generator", | |
78 | "//session:session_handler", | |
79 | "//session:session_usage_observer", | |
80 | ], | |
81 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | "select_mozc", | |
36 | ) | |
37 | ||
38 | package(default_visibility = [ | |
39 | "//:__subpackages__", | |
40 | ]) | |
41 | ||
42 | test_suite( | |
43 | name = "nacl_test", | |
44 | tags = ["-disable_on_nacl_test"], | |
45 | ) | |
46 | ||
47 | test_suite( | |
48 | name = "android_test", | |
49 | tests = [ | |
50 | ":generic_storage_manager_test_android", | |
51 | ":ime_switch_util_test_android", | |
52 | ":key_info_util_test_android", | |
53 | ":output_util_test_android", | |
54 | ":random_keyevents_generator_test_android", | |
55 | ":request_test_util_test_android", | |
56 | ":session_converter_stress_test_android", | |
57 | ":session_converter_test_android", | |
58 | ":session_handler_stress_test_android", | |
59 | ":session_handler_test_android", | |
60 | ":session_observer_handler_test_android", | |
61 | ":session_regression_test_android", | |
62 | ":session_test_android", | |
63 | ":session_usage_stats_util_test_android", | |
64 | # Disabled tests due to errors. | |
65 | # ":session_handler_scenario_test_android", | |
66 | # ":session_usage_observer_test_android", | |
67 | ], | |
68 | ) | |
69 | ||
70 | cc_library_mozc( | |
71 | name = "session_converter", | |
72 | srcs = ["session_converter.cc"], | |
73 | hdrs = ["session_converter.h"], | |
74 | deps = [ | |
75 | ":session_converter_interface", | |
76 | ":session_usage_stats_util", | |
77 | "//base", | |
78 | "//base:flags", | |
79 | "//base:logging", | |
80 | "//base:port", | |
81 | "//base:text_normalizer", | |
82 | "//base:util", | |
83 | "//composer", | |
84 | "//config:config_handler", | |
85 | "//converter:converter_interface", | |
86 | "//converter:converter_util", | |
87 | "//converter:segments", | |
88 | "//protocol:commands_proto", | |
89 | "//protocol:config_proto", | |
90 | "//request:conversion_request", | |
91 | "//session/internal:candidate_list", | |
92 | "//session/internal:session_output", | |
93 | "//transliteration", | |
94 | "//usage_stats", | |
95 | ], | |
96 | ) | |
97 | ||
98 | cc_test_mozc( | |
99 | name = "session_converter_test", | |
100 | size = "small", | |
101 | timeout = "moderate", | |
102 | srcs = ["session_converter_test.cc"], | |
103 | deps = [ | |
104 | ":request_test_util", | |
105 | ":session_converter", | |
106 | "//base", | |
107 | "//base:logging", | |
108 | "//base:system_util", | |
109 | "//base:util", | |
110 | "//composer", | |
111 | "//composer:table", | |
112 | "//config:config_handler", | |
113 | "//converter:converter_mock", | |
114 | "//converter:segments", | |
115 | "//data_manager/testing:mock_data_manager", | |
116 | "//protocol:candidates_proto", | |
117 | "//protocol:commands_proto", | |
118 | "//protocol:config_proto", | |
119 | "//session/internal:candidate_list", | |
120 | "//session/internal:keymap", | |
121 | "//testing:googletest", | |
122 | "//testing:gunit_main", | |
123 | "//testing:testing_util", | |
124 | "//transliteration", | |
125 | "//usage_stats", | |
126 | "//usage_stats:usage_stats_testing_util", | |
127 | ], | |
128 | ) | |
129 | ||
130 | cc_test_mozc( | |
131 | name = "session_converter_stress_test", | |
132 | size = "large", | |
133 | srcs = ["session_converter_stress_test.cc"], | |
134 | deps = [ | |
135 | ":session_converter", | |
136 | "//base", | |
137 | "//base:clock", | |
138 | "//base:port", | |
139 | "//base:system_util", | |
140 | "//base:util", | |
141 | "//composer", | |
142 | "//composer:table", | |
143 | "//config:config_handler", | |
144 | "//engine:engine_interface", | |
145 | "//engine:mock_data_engine_factory", | |
146 | "//protocol:commands_proto", | |
147 | "//protocol:config_proto", | |
148 | "//testing:googletest", | |
149 | "//testing:gunit_main", | |
150 | ], | |
151 | ) | |
152 | ||
153 | cc_library_mozc( | |
154 | name = "session", | |
155 | srcs = [ | |
156 | "session.cc", | |
157 | "session_interface.h", | |
158 | ], | |
159 | hdrs = ["session.h"], | |
160 | visibility = [ | |
161 | "//:__subpackages__", | |
162 | ], | |
163 | deps = [ | |
164 | ":session_converter", | |
165 | ":session_usage_stats_util", | |
166 | "//base", | |
167 | "//base:clock", | |
168 | "//base:logging", | |
169 | "//base:port", | |
170 | "//base:singleton", | |
171 | "//base:url", | |
172 | "//base:util", | |
173 | "//base:version", | |
174 | "//composer", | |
175 | "//composer:key_event_util", | |
176 | "//composer:table", | |
177 | "//config:config_handler", | |
178 | "//engine:engine_interface", | |
179 | "//engine:user_data_manager_interface", | |
180 | "//protocol:commands_proto", | |
181 | "//protocol:config_proto", | |
182 | "//session/internal:ime_context", | |
183 | "//session/internal:key_event_transformer", | |
184 | "//session/internal:keymap", | |
185 | "//session/internal:keymap_factory", | |
186 | "//session/internal:session_output", | |
187 | "//testing:gunit_prod", | |
188 | "//transliteration", | |
189 | "//usage_stats", | |
190 | ], | |
191 | ) | |
192 | ||
193 | cc_test_mozc( | |
194 | name = "session_test", | |
195 | size = "large", | |
196 | srcs = [ | |
197 | "session_interface.h", | |
198 | "session_test.cc", | |
199 | ], | |
200 | deps = [ | |
201 | ":request_test_util", | |
202 | ":session", | |
203 | ":session_converter_interface", | |
204 | "//base", | |
205 | "//base:logging", | |
206 | "//base:port", | |
207 | "//base:util", | |
208 | "//composer", | |
209 | "//composer:key_parser", | |
210 | "//composer:table", | |
211 | "//config:config_handler", | |
212 | "//converter:converter_mock", | |
213 | "//converter:segments", | |
214 | "//data_manager/testing:mock_data_manager", | |
215 | "//dictionary:pos_matcher_lib", | |
216 | "//engine", | |
217 | "//engine:mock_converter_engine", | |
218 | "//engine:mock_data_engine_factory", | |
219 | "//engine:user_data_manager_mock", | |
220 | "//protocol:candidates_proto", | |
221 | "//protocol:commands_proto", | |
222 | "//protocol:config_proto", | |
223 | "//request:conversion_request", | |
224 | "//rewriter:transliteration_rewriter", | |
225 | "//session/internal:ime_context", | |
226 | "//session/internal:keymap", | |
227 | "//testing:gunit_main", | |
228 | "//testing:mozctest", | |
229 | "//usage_stats", | |
230 | "//usage_stats:usage_stats_testing_util", | |
231 | ], | |
232 | ) | |
233 | ||
234 | cc_test_mozc( | |
235 | name = "session_regression_test", | |
236 | size = "large", | |
237 | srcs = [ | |
238 | "common.h", | |
239 | "session_interface.h", | |
240 | "session_regression_test.cc", | |
241 | ], | |
242 | deps = [ | |
243 | ":request_test_util", | |
244 | ":session", | |
245 | ":session_converter_interface", | |
246 | ":session_handler", | |
247 | "//base", | |
248 | "//base:file_util", | |
249 | "//base:logging", | |
250 | "//base:port", | |
251 | "//base:system_util", | |
252 | "//composer:key_parser", | |
253 | "//composer:table", | |
254 | "//config:config_handler", | |
255 | "//converter:segments", | |
256 | "//data_manager/testing:mock_data_manager", | |
257 | "//engine:mock_data_engine_factory", | |
258 | "//engine:user_data_manager_interface", | |
259 | "//protocol:candidates_proto", | |
260 | "//protocol:commands_proto", | |
261 | "//protocol:config_proto", | |
262 | "//rewriter:rewriter_interface", | |
263 | "//session/internal:ime_context", | |
264 | "//session/internal:keymap", | |
265 | "//testing:googletest", | |
266 | "//testing:gunit_main", | |
267 | ], | |
268 | ) | |
269 | ||
270 | cc_library_mozc( | |
271 | name = "session_observer_handler", | |
272 | srcs = ["session_observer_handler.cc"], | |
273 | hdrs = ["session_observer_handler.h"], | |
274 | deps = [ | |
275 | ":session_observer_interface", | |
276 | "//base", | |
277 | "//base:port", | |
278 | "//protocol:commands_proto", | |
279 | "//protocol:config_proto", | |
280 | ], | |
281 | ) | |
282 | ||
283 | cc_test_mozc( | |
284 | name = "session_observer_handler_test", | |
285 | size = "small", | |
286 | srcs = ["session_observer_handler_test.cc"], | |
287 | deps = [ | |
288 | ":session_observer_handler", | |
289 | ":session_observer_interface", | |
290 | "//protocol:commands_proto", | |
291 | "//testing:gunit_main", | |
292 | ], | |
293 | ) | |
294 | ||
295 | cc_library_mozc( | |
296 | name = "session_handler", | |
297 | srcs = [ | |
298 | "common.h", | |
299 | "session_handler.cc", | |
300 | "session_interface.h", | |
301 | ], | |
302 | hdrs = ["session_handler.h"], | |
303 | deps = select_mozc( | |
304 | client = [], | |
305 | default = [ | |
306 | ":session_watch_dog", | |
307 | "//base:process", | |
308 | ], | |
309 | linux = [ | |
310 | ":session_watch_dog", | |
311 | "//base:process", | |
312 | ], | |
313 | ) + [ | |
314 | ":generic_storage_manager", | |
315 | ":session", | |
316 | ":session_handler_interface", | |
317 | ":session_observer_handler", | |
318 | "//base", | |
319 | "//base:clock", | |
320 | "//base:stopwatch", | |
321 | "//base:version", | |
322 | "//composer", | |
323 | "//config:character_form_manager", | |
324 | "//config:config_handler", | |
325 | "//converter:converter_interface", | |
326 | "//dictionary:user_dictionary_session_handler", | |
327 | "//engine:engine_builder_interface", | |
328 | "//engine:user_data_manager_interface", | |
329 | "//engine:engine_interface", | |
330 | "//storage:lru_cache", | |
331 | "//usage_stats", | |
332 | ] + [ | |
333 | "//base:flags", | |
334 | "//base:logging", | |
335 | "//base:port", | |
336 | "//base:singleton", | |
337 | "//base:util", | |
338 | "//composer:table", | |
339 | "//protocol:commands_proto", | |
340 | "//protocol:config_proto", | |
341 | "//protocol:user_dictionary_storage_proto", | |
342 | "//testing:gunit_prod", | |
343 | ], | |
344 | ) | |
345 | ||
346 | cc_library_mozc( | |
347 | name = "session_handler_test_util", | |
348 | testonly = 1, | |
349 | srcs = [ | |
350 | "common.h", | |
351 | "session_handler.h", | |
352 | "session_handler_test_util.cc", | |
353 | ], | |
354 | hdrs = ["session_handler_test_util.h"], | |
355 | deps = [ | |
356 | ":session", | |
357 | ":session_handler", | |
358 | ":session_handler_interface", | |
359 | ":session_usage_observer", | |
360 | "//base", | |
361 | "//base:config_file_stream", | |
362 | "//base:file_util", | |
363 | "//base:logging", | |
364 | "//base:port", | |
365 | "//base:system_util", | |
366 | "//composer:table", | |
367 | "//config:character_form_manager", | |
368 | "//config:config_handler", | |
369 | "//converter:converter_interface", | |
370 | "//engine:engine_builder_interface", | |
371 | "//engine:engine_interface", | |
372 | "//prediction:user_history_predictor", | |
373 | "//protocol:commands_proto", | |
374 | "//protocol:config_proto", | |
375 | "//storage:lru_cache", | |
376 | "//storage:registry", | |
377 | "//testing", | |
378 | "//testing:googletest", | |
379 | "//testing:gunit_prod", | |
380 | "//usage_stats:usage_stats_testing_util", | |
381 | ], | |
382 | ) | |
383 | ||
384 | cc_test_mozc( | |
385 | name = "session_handler_test", | |
386 | size = "large", | |
387 | srcs = [ | |
388 | "common.h", | |
389 | "session_handler_test.cc", | |
390 | ], | |
391 | deps = [ | |
392 | ":generic_storage_manager", | |
393 | ":session_handler", | |
394 | ":session_handler_test_util", | |
395 | "//base", | |
396 | "//base:clock_mock", | |
397 | "//base:port", | |
398 | "//base:stopwatch", | |
399 | "//base:util", | |
400 | "//config:config_handler", | |
401 | "//converter:converter_mock", | |
402 | "//engine:engine_builder_interface", | |
403 | "//engine:engine_stub", | |
404 | "//engine:mock_converter_engine", | |
405 | "//engine:mock_data_engine_factory", | |
406 | "//engine:user_data_manager_mock", | |
407 | "//protocol:commands_proto", | |
408 | "//protocol:config_proto", | |
409 | "//testing:googletest", | |
410 | "//testing:gunit_main", | |
411 | "//usage_stats", | |
412 | "//usage_stats:usage_stats_testing_util", | |
413 | ], | |
414 | ) | |
415 | ||
416 | cc_library_mozc( | |
417 | name = "session_server", | |
418 | srcs = [ | |
419 | "common.h", | |
420 | "session_server.cc", | |
421 | ], | |
422 | hdrs = ["session_server.h"], | |
423 | deps = [ | |
424 | ":session_handler", | |
425 | ":session_usage_observer", | |
426 | "//base", | |
427 | "//base:logging", | |
428 | "//base:port", | |
429 | "//base:scheduler", | |
430 | "//engine:engine_factory", | |
431 | "//ipc", | |
432 | "//ipc:named_event", | |
433 | "//protocol:commands_proto", | |
434 | "//usage_stats:usage_stats_uploader", | |
435 | ], | |
436 | ) | |
437 | ||
438 | cc_test_mozc( | |
439 | name = "session_server_test", | |
440 | size = "small", | |
441 | srcs = ["session_server_test.cc"], | |
442 | tags = [ | |
443 | "disable_on_nacl_test", | |
444 | "no_android", | |
445 | ], | |
446 | deps = [ | |
447 | ":session_server", | |
448 | "//base", | |
449 | "//base:scheduler", | |
450 | "//base:system_util", | |
451 | "//testing:googletest", | |
452 | "//testing:gunit_main", | |
453 | ], | |
454 | ) | |
455 | ||
456 | cc_library_mozc( | |
457 | name = "request_test_util", | |
458 | srcs = ["request_test_util.cc"], | |
459 | hdrs = ["request_test_util.h"], | |
460 | deps = [ | |
461 | "//base", | |
462 | "//base:port", | |
463 | "//composer:table", | |
464 | "//protocol:commands_proto", | |
465 | ], | |
466 | # TODO(team): Ideally this target is testonly but evaluation/ shares | |
467 | # this target to change the request object in a scoped way. We can | |
468 | # again make this testonly after removing the global request object. | |
469 | # testonly = 1 | |
470 | ) | |
471 | ||
472 | cc_test_mozc( | |
473 | name = "request_test_util_test", | |
474 | size = "small", | |
475 | srcs = ["request_test_util_test.cc"], | |
476 | deps = [ | |
477 | ":request_test_util", | |
478 | "//protocol:commands_proto", | |
479 | "//testing:gunit_main", | |
480 | ], | |
481 | ) | |
482 | ||
483 | cc_binary_mozc( | |
484 | name = "session_client_main", | |
485 | srcs = [ | |
486 | "session_client_main.cc", | |
487 | "session_interface.h", | |
488 | ], | |
489 | copts = ["$(STACK_FRAME_UNLIMITED)"], # session_client_main.cc | |
490 | deps = [ | |
491 | ":session", | |
492 | "//base", | |
493 | "//base:file_stream", | |
494 | "//base:file_util", | |
495 | "//base:flags", | |
496 | "//base:init_mozc", | |
497 | "//base:logging", | |
498 | "//base:port", | |
499 | "//base:system_util", | |
500 | "//base:util", | |
501 | "//composer:key_parser", | |
502 | "//engine:engine_factory", | |
503 | "//engine:engine_interface", | |
504 | "//protocol:commands_proto", | |
505 | "//protocol:config_proto", | |
506 | ], | |
507 | ) | |
508 | ||
509 | cc_binary_mozc( | |
510 | name = "session_server_main", | |
511 | srcs = ["session_server_main.cc"], | |
512 | copts = ["$(STACK_FRAME_UNLIMITED)"], # session_server_main.cc | |
513 | deps = [ | |
514 | ":session_server", | |
515 | "//base:flags", | |
516 | "//base:init_mozc", | |
517 | "//protocol:commands_proto", | |
518 | "@com_google_absl//absl/strings:str_format", | |
519 | ], | |
520 | ) | |
521 | ||
522 | cc_library_mozc( | |
523 | name = "session_watch_dog", | |
524 | srcs = ["session_watch_dog.cc"], | |
525 | hdrs = ["session_watch_dog.h"], | |
526 | deps = [ | |
527 | "//base", | |
528 | "//base:clock", | |
529 | "//base:cpu_stats", | |
530 | "//base:logging", | |
531 | "//base:port", | |
532 | "//base:system_util", | |
533 | "//base:thread", | |
534 | "//base:unnamed_event", | |
535 | "//client", | |
536 | "//client:client_interface", | |
537 | ], | |
538 | ) | |
539 | ||
540 | cc_test_mozc( | |
541 | name = "session_watch_dog_test", | |
542 | size = "large", | |
543 | srcs = ["session_watch_dog_test.cc"], | |
544 | tags = [ | |
545 | "disable_on_nacl_test", | |
546 | "no_android", | |
547 | ], | |
548 | deps = [ | |
549 | ":session_watch_dog", | |
550 | "//base", | |
551 | "//base:cpu_stats", | |
552 | "//base:logging", | |
553 | "//base:mutex", | |
554 | "//base:port", | |
555 | "//base:util", | |
556 | "//client:client_mock", | |
557 | "//testing:googletest", | |
558 | "//testing:gunit_main", | |
559 | ], | |
560 | ) | |
561 | ||
562 | cc_library_mozc( | |
563 | name = "session_usage_observer", | |
564 | srcs = ["session_usage_observer.cc"], | |
565 | hdrs = ["session_usage_observer.h"], | |
566 | deps = [ | |
567 | ":session_observer_interface", | |
568 | "//base", | |
569 | "//base:clock", | |
570 | "//base:logging", | |
571 | "//base:mutex", | |
572 | "//base:number_util", | |
573 | "//base:port", | |
574 | "//base:scheduler", | |
575 | "//config:stats_config_util", | |
576 | "//protocol:commands_proto", | |
577 | "//protocol:state_proto", | |
578 | "//usage_stats", | |
579 | "//usage_stats:usage_stats_proto", | |
580 | ], | |
581 | ) | |
582 | ||
583 | cc_test_mozc( | |
584 | name = "session_usage_observer_test", | |
585 | size = "small", | |
586 | srcs = ["session_usage_observer_test.cc"], | |
587 | deps = [ | |
588 | ":session_usage_observer", | |
589 | "//base", | |
590 | "//base:clock_mock", | |
591 | "//base:logging", | |
592 | "//base:scheduler", | |
593 | "//base:scheduler_stub", | |
594 | "//base:system_util", | |
595 | "//base:util", | |
596 | "//config:stats_config_util", | |
597 | "//config:stats_config_util_mock", | |
598 | "//protocol:commands_proto", | |
599 | "//testing:googletest", | |
600 | "//testing:gunit_main", | |
601 | "//usage_stats", | |
602 | "//usage_stats:usage_stats_proto", | |
603 | "//usage_stats:usage_stats_testing_util", | |
604 | ], | |
605 | ) | |
606 | ||
607 | cc_library_mozc( | |
608 | name = "ime_switch_util", | |
609 | srcs = ["ime_switch_util.cc"], | |
610 | hdrs = ["ime_switch_util.h"], | |
611 | deps = [ | |
612 | ":key_info_util", | |
613 | "//base:port", | |
614 | "//base:singleton", | |
615 | "//config:config_handler", | |
616 | "//protocol:config_proto", | |
617 | ], | |
618 | ) | |
619 | ||
620 | cc_test_mozc( | |
621 | name = "ime_switch_util_test", | |
622 | size = "small", | |
623 | srcs = ["ime_switch_util_test.cc"], | |
624 | deps = [ | |
625 | ":ime_switch_util", | |
626 | "//base", | |
627 | "//base:system_util", | |
628 | "//composer:key_parser", | |
629 | "//config:config_handler", | |
630 | "//protocol:commands_proto", | |
631 | "//protocol:config_proto", | |
632 | "//session/internal:keymap", | |
633 | "//testing:googletest", | |
634 | "//testing:gunit_main", | |
635 | ], | |
636 | ) | |
637 | ||
638 | cc_library_mozc( | |
639 | name = "key_info_util", | |
640 | srcs = ["key_info_util.cc"], | |
641 | hdrs = ["key_info_util.h"], | |
642 | deps = [ | |
643 | "//base", | |
644 | "//base:config_file_stream", | |
645 | "//base:logging", | |
646 | "//base:port", | |
647 | "//base:util", | |
648 | "//composer:key_event_util", | |
649 | "//composer:key_parser", | |
650 | "//config:config_handler", | |
651 | "//protocol:commands_proto", | |
652 | "//protocol:config_proto", | |
653 | "//session/internal:keymap", | |
654 | ], | |
655 | ) | |
656 | ||
657 | cc_test_mozc( | |
658 | name = "key_info_util_test", | |
659 | size = "small", | |
660 | srcs = ["key_info_util_test.cc"], | |
661 | deps = [ | |
662 | ":key_info_util", | |
663 | "//base", | |
664 | "//composer:key_parser", | |
665 | "//config:config_handler", | |
666 | "//protocol:commands_proto", | |
667 | "//protocol:config_proto", | |
668 | "//testing:googletest", | |
669 | "//testing:gunit_main", | |
670 | ], | |
671 | ) | |
672 | ||
673 | cc_library_mozc( | |
674 | name = "output_util", | |
675 | srcs = ["output_util.cc"], | |
676 | hdrs = ["output_util.h"], | |
677 | deps = [ | |
678 | "//base", | |
679 | "//base:logging", | |
680 | "//base:port", | |
681 | "//protocol:commands_proto", | |
682 | ], | |
683 | ) | |
684 | ||
685 | cc_test_mozc( | |
686 | name = "output_util_test", | |
687 | size = "small", | |
688 | srcs = ["output_util_test.cc"], | |
689 | deps = [ | |
690 | ":output_util", | |
691 | "//base", | |
692 | "//base:port", | |
693 | "//protocol:commands_proto", | |
694 | "//testing:googletest", | |
695 | "//testing:gunit_main", | |
696 | ], | |
697 | ) | |
698 | ||
699 | cc_library_mozc( | |
700 | name = "session_usage_stats_util", | |
701 | srcs = ["session_usage_stats_util.cc"], | |
702 | hdrs = ["session_usage_stats_util.h"], | |
703 | deps = [ | |
704 | "//base", | |
705 | "//base:logging", | |
706 | "//base:port", | |
707 | "//base:util", | |
708 | "//base/protobuf", | |
709 | "//base/protobuf:descriptor", | |
710 | "//base/protobuf:message", | |
711 | "//protocol:commands_proto", | |
712 | "//usage_stats", | |
713 | ], | |
714 | ) | |
715 | ||
716 | cc_test_mozc( | |
717 | name = "session_usage_stats_util_test", | |
718 | size = "small", | |
719 | srcs = ["session_usage_stats_util_test.cc"], | |
720 | deps = [ | |
721 | ":session_usage_stats_util", | |
722 | "//base", | |
723 | "//composer:key_parser", | |
724 | "//protocol:commands_proto", | |
725 | "//testing:gunit_main", | |
726 | "//usage_stats", | |
727 | "//usage_stats:usage_stats_testing_util", | |
728 | ], | |
729 | ) | |
730 | ||
731 | cc_test_mozc( | |
732 | name = "session_handler_scenario_test", | |
733 | size = "medium", | |
734 | srcs = ["session_handler_scenario_test.cc"], | |
735 | data = [ | |
736 | "//data/test/session/scenario:scenario_files", | |
737 | "//data/test/session/scenario/usage_stats:usage_stats_scenario_files", | |
738 | ], | |
739 | deps = [ | |
740 | ":request_test_util", | |
741 | ":session_handler", | |
742 | ":session_handler_test_util", | |
743 | "//base:file_stream", | |
744 | "//base:file_util", | |
745 | "//base:number_util", | |
746 | "//base:util", | |
747 | "//base/protobuf:descriptor", | |
748 | "//base/protobuf:message", | |
749 | "//base/protobuf:text_format", | |
750 | "//composer:key_parser", | |
751 | "//config:config_handler", | |
752 | "//converter:converter_interface", | |
753 | "//engine:mock_data_engine_factory", | |
754 | "//engine:user_data_manager_interface", | |
755 | "//engine:user_data_manager_mock", | |
756 | "//protocol:commands_proto", | |
757 | "//protocol:config_proto", | |
758 | "//testing:gunit_main", | |
759 | "//testing:mozctest", | |
760 | "//usage_stats", | |
761 | "//usage_stats:usage_stats_testing_util", | |
762 | "@com_google_absl//absl/strings", | |
763 | ], | |
764 | ) | |
765 | ||
766 | cc_library_mozc( | |
767 | name = "generic_storage_manager", | |
768 | srcs = ["generic_storage_manager.cc"], | |
769 | hdrs = ["generic_storage_manager.h"], | |
770 | deps = [ | |
771 | "//base", | |
772 | "//base:config_file_stream", | |
773 | "//base:logging", | |
774 | "//base:mutex", | |
775 | "//base:port", | |
776 | "//base:singleton", | |
777 | "//protocol:commands_proto", | |
778 | "//storage:lru_storage", | |
779 | ], | |
780 | ) | |
781 | ||
782 | cc_library_mozc( | |
783 | name = "session_handler_interface", | |
784 | hdrs = ["session_handler_interface.h"], | |
785 | visibility = [ | |
786 | "//:__subpackages__", | |
787 | ], | |
788 | deps = [ | |
789 | "//base:port", | |
790 | "@com_google_absl//absl/strings", | |
791 | ], | |
792 | ) | |
793 | ||
794 | cc_library_mozc( | |
795 | name = "session_converter_interface", | |
796 | hdrs = ["session_converter_interface.h"], | |
797 | visibility = ["//session/internal:__pkg__"], | |
798 | deps = [ | |
799 | "//base:port", | |
800 | "//converter", | |
801 | "//converter:segments", | |
802 | "//protocol:config_proto", | |
803 | "//transliteration", | |
804 | ], | |
805 | ) | |
806 | ||
807 | cc_library_mozc( | |
808 | name = "session_observer_interface", | |
809 | hdrs = ["session_observer_interface.h"], | |
810 | visibility = ["//visibility:private"], | |
811 | deps = ["//base:port"], | |
812 | ) | |
813 | ||
814 | cc_test_mozc( | |
815 | name = "generic_storage_manager_test", | |
816 | size = "small", | |
817 | srcs = ["generic_storage_manager_test.cc"], | |
818 | deps = [ | |
819 | ":generic_storage_manager", | |
820 | "//base:file_util", | |
821 | "//base:util", | |
822 | "//testing:googletest", | |
823 | "//testing:gunit_main", | |
824 | ], | |
825 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | ) | |
35 | ||
36 | package(default_visibility = ["//:__subpackages__"]) | |
37 | ||
38 | test_suite( | |
39 | name = "nacl_test", | |
40 | ) | |
41 | ||
42 | cc_library_mozc( | |
43 | name = "ime_context", | |
44 | srcs = ["ime_context.cc"], | |
45 | hdrs = ["ime_context.h"], | |
46 | deps = [ | |
47 | ":key_event_transformer", | |
48 | ":keymap", | |
49 | ":keymap_factory", | |
50 | "//base", | |
51 | "//base:logging", | |
52 | "//base:port", | |
53 | "//composer", | |
54 | "//config:config_handler", | |
55 | "//protocol:commands_proto", | |
56 | "//protocol:config_proto", | |
57 | "//session:session_converter_interface", | |
58 | ], | |
59 | ) | |
60 | ||
61 | cc_library_mozc( | |
62 | name = "keymap", | |
63 | srcs = [ | |
64 | "keymap.cc", | |
65 | ], | |
66 | hdrs = [ | |
67 | "keymap.h", | |
68 | "keymap-inl.h", | |
69 | ], | |
70 | deps = [ | |
71 | ":keymap_interface", | |
72 | "//base", | |
73 | "//base:config_file_stream", | |
74 | "//base:file_stream", | |
75 | "//base:logging", | |
76 | "//base:port", | |
77 | "//base:util", | |
78 | "//composer:key_event_util", | |
79 | "//composer:key_parser", | |
80 | "//config:config_handler", | |
81 | "//protocol:commands_proto", | |
82 | "//protocol:config_proto", | |
83 | ], | |
84 | ) | |
85 | ||
86 | cc_library_mozc( | |
87 | name = "keymap_factory", | |
88 | srcs = [ | |
89 | "keymap_factory.cc", | |
90 | ], | |
91 | hdrs = ["keymap_factory.h"], | |
92 | deps = [ | |
93 | ":keymap", | |
94 | "//base", | |
95 | "//base:freelist", | |
96 | "//base:port", | |
97 | "//config:config_handler", | |
98 | "//protocol:config_proto", | |
99 | ], | |
100 | ) | |
101 | ||
102 | cc_library_mozc( | |
103 | name = "key_event_transformer", | |
104 | srcs = ["key_event_transformer.cc"], | |
105 | hdrs = ["key_event_transformer.h"], | |
106 | deps = [ | |
107 | "//base", | |
108 | "//base:logging", | |
109 | "//base:port", | |
110 | "//base:singleton", | |
111 | "//base:util", | |
112 | "//composer:key_event_util", | |
113 | "//config:config_handler", | |
114 | "//protocol:commands_proto", | |
115 | "//protocol:config_proto", | |
116 | ], | |
117 | ) | |
118 | ||
119 | cc_library_mozc( | |
120 | name = "candidate_list", | |
121 | srcs = ["candidate_list.cc"], | |
122 | hdrs = ["candidate_list.h"], | |
123 | deps = [ | |
124 | "//base:freelist", | |
125 | "//base:hash", | |
126 | "//base:logging", | |
127 | "//base:port", | |
128 | ], | |
129 | ) | |
130 | ||
131 | cc_library_mozc( | |
132 | name = "session_output", | |
133 | srcs = ["session_output.cc"], | |
134 | hdrs = ["session_output.h"], | |
135 | deps = [ | |
136 | ":candidate_list", | |
137 | "//base", | |
138 | "//base:logging", | |
139 | "//base:port", | |
140 | "//base:text_normalizer", | |
141 | "//base:util", | |
142 | "//base:version", | |
143 | "//composer", | |
144 | "//converter:segments", | |
145 | "//protocol:commands_proto", | |
146 | ], | |
147 | ) | |
148 | ||
149 | cc_test_mozc( | |
150 | name = "ime_context_test", | |
151 | size = "small", | |
152 | timeout = "moderate", | |
153 | srcs = ["ime_context_test.cc"], | |
154 | deps = [ | |
155 | ":ime_context", | |
156 | ":keymap", | |
157 | ":keymap_factory", | |
158 | ":keymap_interface", | |
159 | "//composer", | |
160 | "//composer:key_parser", | |
161 | "//composer:table", | |
162 | "//converter:converter_interface", | |
163 | "//converter:converter_mock", | |
164 | "//engine:mock_converter_engine", | |
165 | "//protocol:commands_proto", | |
166 | "//protocol:config_proto", | |
167 | "//session:session_converter", | |
168 | "//testing:googletest", | |
169 | "//testing:gunit_main", | |
170 | "//testing:testing_util", | |
171 | ], | |
172 | ) | |
173 | ||
174 | cc_library_mozc( | |
175 | name = "keymap_interface", | |
176 | hdrs = ["keymap_interface.h"], | |
177 | visibility = ["//visibility:private"], | |
178 | deps = ["//base:port"], | |
179 | ) | |
180 | ||
181 | cc_test_mozc( | |
182 | name = "keymap_test", | |
183 | size = "small", | |
184 | srcs = [ | |
185 | "keymap_test.cc", | |
186 | ], | |
187 | deps = [ | |
188 | ":keymap", | |
189 | ":keymap_factory", | |
190 | "//base:config_file_stream", | |
191 | "//base:system_util", | |
192 | "//composer:key_parser", | |
193 | "//config:config_handler", | |
194 | "//protocol:commands_proto", | |
195 | "//protocol:config_proto", | |
196 | "//testing:googletest", | |
197 | "//testing:gunit_main", | |
198 | ], | |
199 | ) | |
200 | ||
201 | cc_test_mozc( | |
202 | name = "keymap_factory_test", | |
203 | size = "small", | |
204 | srcs = [ | |
205 | "keymap_factory_test.cc", | |
206 | ], | |
207 | deps = [ | |
208 | ":keymap", | |
209 | ":keymap_factory", | |
210 | "//composer:key_parser", | |
211 | "//config:config_handler", | |
212 | "//protocol:commands_proto", | |
213 | "//protocol:config_proto", | |
214 | "//testing:googletest", | |
215 | "//testing:gunit_main", | |
216 | ], | |
217 | ) | |
218 | ||
219 | cc_test_mozc( | |
220 | name = "key_event_transformer_test", | |
221 | size = "small", | |
222 | srcs = ["key_event_transformer_test.cc"], | |
223 | deps = [ | |
224 | ":key_event_transformer", | |
225 | "//base", | |
226 | "//base:port", | |
227 | "//base:singleton", | |
228 | "//protocol:commands_proto", | |
229 | "//protocol:config_proto", | |
230 | "//testing:gunit_main", | |
231 | ], | |
232 | ) | |
233 | ||
234 | cc_test_mozc( | |
235 | name = "candidate_list_test", | |
236 | size = "small", | |
237 | srcs = ["candidate_list_test.cc"], | |
238 | deps = [ | |
239 | ":candidate_list", | |
240 | "//testing:gunit_main", | |
241 | ], | |
242 | ) | |
243 | ||
244 | cc_test_mozc( | |
245 | name = "session_output_test", | |
246 | size = "small", | |
247 | timeout = "moderate", | |
248 | srcs = ["session_output_test.cc"], | |
249 | deps = [ | |
250 | ":candidate_list", | |
251 | ":session_output", | |
252 | "//base:port", | |
253 | "//base:text_normalizer", | |
254 | "//base:util", | |
255 | "//converter:segments", | |
256 | "//protocol:commands_proto", | |
257 | "//testing:gunit_main", | |
258 | ], | |
259 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | ) | |
35 | ||
36 | package(default_visibility = ["//:__subpackages__"]) | |
37 | ||
38 | test_suite( | |
39 | name = "nacl_test", | |
40 | ) | |
41 | ||
42 | cc_library_mozc( | |
43 | name = "lru_storage", | |
44 | srcs = ["lru_storage.cc"], | |
45 | hdrs = ["lru_storage.h"], | |
46 | deps = [ | |
47 | "//base", | |
48 | "//base:clock", | |
49 | "//base:file_stream", | |
50 | "//base:file_util", | |
51 | "//base:hash", | |
52 | "//base:logging", | |
53 | "//base:mmap", | |
54 | "//base:mozc_hash_map", | |
55 | "//base:mozc_hash_set", | |
56 | "//base:port", | |
57 | "//base:util", | |
58 | "@com_google_absl//absl/strings", | |
59 | ], | |
60 | ) | |
61 | ||
62 | ## cc_binary_mozc(name = "lru_storage_main", | |
63 | ## srcs = [ "lru_storage_main.cc" ], | |
64 | ## deps = [ ":lru_storage", | |
65 | ## "//base:base",]) | |
66 | ||
67 | cc_library_mozc( | |
68 | name = "lru_cache", | |
69 | hdrs = ["lru_cache.h"], | |
70 | deps = [ | |
71 | "//base:logging", | |
72 | "//base:port", | |
73 | ], | |
74 | ) | |
75 | ||
76 | ## cc_binary_mozc(name = "lru_cache_main", | |
77 | ## srcs = ["lru_cache_main.cc", ], | |
78 | ## deps = [ "//base:base" ]); | |
79 | ||
80 | cc_library_mozc( | |
81 | name = "existence_filter", | |
82 | srcs = ["existence_filter.cc"], | |
83 | hdrs = ["existence_filter.h"], | |
84 | deps = [ | |
85 | "//base", | |
86 | "//base:logging", | |
87 | "//base:port", | |
88 | ], | |
89 | ) | |
90 | ||
91 | ## cc_binary_mozc(name = "existence_filter_main", | |
92 | ## srcs = [ "existence_filter_main.cc" ], | |
93 | ## deps = [ ":existence_filter", | |
94 | ## "//base:base",]) | |
95 | ||
96 | cc_test_mozc( | |
97 | name = "lru_storage_test", | |
98 | size = "small", | |
99 | srcs = ["lru_storage_test.cc"], | |
100 | deps = [ | |
101 | ":lru_cache", | |
102 | ":lru_storage", | |
103 | "//base", | |
104 | "//base:clock_mock", | |
105 | "//base:file_stream", | |
106 | "//base:file_util", | |
107 | "//base:logging", | |
108 | "//base:port", | |
109 | "//base:util", | |
110 | "//testing:googletest", | |
111 | "//testing:gunit_main", | |
112 | ], | |
113 | ) | |
114 | ||
115 | cc_test_mozc( | |
116 | name = "existence_filter_test", | |
117 | size = "small", | |
118 | srcs = ["existence_filter_test.cc"], | |
119 | deps = [ | |
120 | ":existence_filter", | |
121 | "//base", | |
122 | "//base:hash", | |
123 | "//base:logging", | |
124 | "//base:port", | |
125 | "//testing:googletest", | |
126 | "//testing:gunit_main", | |
127 | ], | |
128 | ) | |
129 | ||
130 | cc_library_mozc( | |
131 | name = "storage_interaface", | |
132 | hdrs = ["storage_interface.h"], | |
133 | deps = ["//base:port"], | |
134 | ) | |
135 | ||
136 | cc_library_mozc( | |
137 | name = "tiny_storage", | |
138 | srcs = ["tiny_storage.cc"], | |
139 | hdrs = ["tiny_storage.h"], | |
140 | deps = [ | |
141 | ":storage_interaface", | |
142 | "//base", | |
143 | "//base:file_stream", | |
144 | "//base:file_util", | |
145 | "//base:logging", | |
146 | "//base:mmap", | |
147 | "//base:port", | |
148 | ], | |
149 | ) | |
150 | ||
151 | cc_test_mozc( | |
152 | name = "tiny_storage_test", | |
153 | size = "small", | |
154 | srcs = ["tiny_storage_test.cc"], | |
155 | deps = [ | |
156 | ":storage_interaface", | |
157 | ":tiny_storage", | |
158 | "//base", | |
159 | "//base:file_util", | |
160 | "//base:port", | |
161 | "//testing:googletest", | |
162 | "//testing:gunit_main", | |
163 | "@com_google_absl//absl/strings:str_format", | |
164 | ], | |
165 | ) | |
166 | ||
167 | cc_library_mozc( | |
168 | name = "memory_storage", | |
169 | srcs = ["memory_storage.cc"], | |
170 | hdrs = ["memory_storage.h"], | |
171 | deps = [ | |
172 | ":storage_interaface", | |
173 | "//base", | |
174 | "//base:logging", | |
175 | ], | |
176 | ) | |
177 | ||
178 | cc_test_mozc( | |
179 | name = "memory_storage_test", | |
180 | size = "small", | |
181 | srcs = ["memory_storage_test.cc"], | |
182 | deps = [ | |
183 | ":memory_storage", | |
184 | "//base", | |
185 | "//base:port", | |
186 | "//testing:googletest", | |
187 | "//testing:gunit_main", | |
188 | "@com_google_absl//absl/strings:str_format", | |
189 | ], | |
190 | ) | |
191 | ||
192 | cc_library_mozc( | |
193 | name = "registry", | |
194 | srcs = ["registry.cc"], | |
195 | hdrs = ["registry.h"], | |
196 | deps = [ | |
197 | ":storage_interaface", | |
198 | ":tiny_storage", | |
199 | "//base", | |
200 | "//base:file_util", | |
201 | "//base:logging", | |
202 | "//base:mutex", | |
203 | "//base:port", | |
204 | "//base:singleton", | |
205 | "//base:system_util", | |
206 | ], | |
207 | ) | |
208 | ||
209 | cc_test_mozc( | |
210 | name = "registry_test", | |
211 | size = "small", | |
212 | srcs = ["registry_test.cc"], | |
213 | deps = [ | |
214 | ":registry", | |
215 | "//base", | |
216 | "//base:system_util", | |
217 | "//testing:googletest", | |
218 | "//testing:gunit_main", | |
219 | ], | |
220 | ) | |
221 | ||
222 | cc_library_mozc( | |
223 | name = "encrypted_string_storage", | |
224 | srcs = ["encrypted_string_storage.cc"], | |
225 | hdrs = ["encrypted_string_storage.h"], | |
226 | deps = [ | |
227 | "//base", | |
228 | "//base:encryptor", | |
229 | "//base:file_stream", | |
230 | "//base:file_util", | |
231 | "//base:logging", | |
232 | "//base:mmap", | |
233 | "//base:port", | |
234 | "//base:util", | |
235 | ], | |
236 | ) | |
237 | ||
238 | cc_test_mozc( | |
239 | name = "encrypted_string_storage_test", | |
240 | size = "small", | |
241 | srcs = ["encrypted_string_storage_test.cc"], | |
242 | deps = [ | |
243 | ":encrypted_string_storage", | |
244 | "//base:file_stream", | |
245 | "//base:file_util", | |
246 | "//base:logging", | |
247 | "//base:system_util", | |
248 | "//testing:googletest", | |
249 | "//testing:gunit_main", | |
250 | ], | |
251 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | # Description: | |
31 | # The C++ louds implementation. | |
32 | ||
33 | load( | |
34 | "//:build_defs.bzl", | |
35 | "cc_library_mozc", | |
36 | "cc_test_mozc", | |
37 | ) | |
38 | ||
39 | test_suite( | |
40 | name = "nacl_test", | |
41 | ) | |
42 | ||
43 | cc_library_mozc( | |
44 | name = "louds", | |
45 | srcs = ["louds.cc"], | |
46 | hdrs = ["louds.h"], | |
47 | deps = [ | |
48 | ":simple_succinct_bit_vector_index", | |
49 | "//base", | |
50 | "//base:port", | |
51 | ], | |
52 | ) | |
53 | ||
54 | cc_test_mozc( | |
55 | name = "louds_test", | |
56 | srcs = ["louds_test.cc"], | |
57 | deps = [ | |
58 | ":louds", | |
59 | "//base", | |
60 | "//base:port", | |
61 | "//testing:gunit_main", | |
62 | "@com_google_absl//absl/strings", | |
63 | ], | |
64 | ) | |
65 | ||
66 | cc_library_mozc( | |
67 | name = "louds_trie", | |
68 | srcs = ["louds_trie.cc"], | |
69 | hdrs = ["louds_trie.h"], | |
70 | visibility = ["//:__subpackages__"], | |
71 | deps = [ | |
72 | ":louds", | |
73 | ":simple_succinct_bit_vector_index", | |
74 | "//base", | |
75 | "//base:logging", | |
76 | "//base:port", | |
77 | "@com_google_absl//absl/strings", | |
78 | ], | |
79 | ) | |
80 | ||
81 | cc_library_mozc( | |
82 | name = "louds_trie_builder", | |
83 | srcs = ["louds_trie_builder.cc"], | |
84 | hdrs = ["louds_trie_builder.h"], | |
85 | visibility = ["//:__subpackages__"], | |
86 | deps = [ | |
87 | ":bit_stream", | |
88 | "//base", | |
89 | "//base:logging", | |
90 | "//base:port", | |
91 | ], | |
92 | ) | |
93 | ||
94 | cc_test_mozc( | |
95 | name = "louds_trie_test", | |
96 | size = "small", | |
97 | srcs = ["louds_trie_test.cc"], | |
98 | deps = [ | |
99 | ":louds_trie", | |
100 | ":louds_trie_builder", | |
101 | "//base:port", | |
102 | "//testing:gunit_main", | |
103 | "@com_google_absl//absl/strings", | |
104 | ], | |
105 | ) | |
106 | ||
107 | cc_library_mozc( | |
108 | name = "bit_vector_based_array", | |
109 | srcs = ["bit_vector_based_array.cc"], | |
110 | hdrs = ["bit_vector_based_array.h"], | |
111 | visibility = [ | |
112 | "//:__subpackages__", | |
113 | ], | |
114 | deps = [ | |
115 | ":simple_succinct_bit_vector_index", | |
116 | "//base", | |
117 | "//base:logging", | |
118 | "//base:port", | |
119 | ], | |
120 | ) | |
121 | ||
122 | cc_library_mozc( | |
123 | name = "bit_vector_based_array_builder", | |
124 | srcs = ["bit_vector_based_array_builder.cc"], | |
125 | hdrs = ["bit_vector_based_array_builder.h"], | |
126 | visibility = [ | |
127 | "//:__subpackages__", | |
128 | ], | |
129 | deps = [ | |
130 | ":bit_stream", | |
131 | "//base", | |
132 | "//base:logging", | |
133 | "//base:port", | |
134 | ], | |
135 | ) | |
136 | ||
137 | cc_test_mozc( | |
138 | name = "bit_vector_based_array_test", | |
139 | size = "small", | |
140 | srcs = ["bit_vector_based_array_test.cc"], | |
141 | deps = [ | |
142 | ":bit_vector_based_array", | |
143 | ":bit_vector_based_array_builder", | |
144 | "//base:port", | |
145 | "//testing:gunit_main", | |
146 | ], | |
147 | ) | |
148 | ||
149 | cc_library_mozc( | |
150 | name = "simple_succinct_bit_vector_index", | |
151 | srcs = ["simple_succinct_bit_vector_index.cc"], | |
152 | hdrs = ["simple_succinct_bit_vector_index.h"], | |
153 | visibility = ["//:__subpackages__"], | |
154 | deps = [ | |
155 | "//base", | |
156 | "//base:iterator_adapter", | |
157 | "//base:logging", | |
158 | "//base:port", | |
159 | ], | |
160 | ) | |
161 | ||
162 | cc_test_mozc( | |
163 | name = "simple_succinct_bit_vector_index_test", | |
164 | size = "small", | |
165 | srcs = ["simple_succinct_bit_vector_index_test.cc"], | |
166 | deps = [ | |
167 | ":simple_succinct_bit_vector_index", | |
168 | "//testing:gunit_main", | |
169 | ], | |
170 | ) | |
171 | ||
172 | cc_library_mozc( | |
173 | name = "bit_stream", | |
174 | srcs = ["bit_stream.cc"], | |
175 | hdrs = ["bit_stream.h"], | |
176 | deps = [ | |
177 | "//base", | |
178 | "//base:logging", | |
179 | "//base:port", | |
180 | ], | |
181 | ) | |
182 | ||
183 | cc_test_mozc( | |
184 | name = "bit_stream_test", | |
185 | size = "small", | |
186 | srcs = ["bit_stream_test.cc"], | |
187 | deps = [ | |
188 | ":bit_stream", | |
189 | "//testing:gunit_main", | |
190 | ], | |
191 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "select_mozc", | |
34 | ) | |
35 | ||
36 | package( | |
37 | default_visibility = [ | |
38 | "//:__subpackages__", | |
39 | ], | |
40 | ) | |
41 | ||
42 | alias( | |
43 | name = "testing", | |
44 | actual = "gunit", | |
45 | ) | |
46 | ||
47 | genrule( | |
48 | name = "gen_mozc_data_dir_header", | |
49 | srcs = [ | |
50 | # Used only for getting the directory name. | |
51 | ":testing.gyp", | |
52 | ], | |
53 | outs = ["mozc_data_dir.h"], | |
54 | cmd = ( | |
55 | "$(location //build_tools:embed_pathname) " + | |
56 | "--path_to_be_embedded " + | |
57 | "$$(dirname $$(dirname $<)) " + | |
58 | "--constant_name " + | |
59 | "kMozcDataDir " + | |
60 | "--output " + | |
61 | "$@" | |
62 | ), | |
63 | tools = ["//build_tools:embed_pathname"], | |
64 | ) | |
65 | ||
66 | cc_library_mozc( | |
67 | name = "mozc_data_dir_header", | |
68 | hdrs = ["mozc_data_dir.h"], | |
69 | ) | |
70 | ||
71 | cc_library_mozc( | |
72 | name = "gtest_main", | |
73 | testonly = 1, | |
74 | srcs = ["base/internal/gtest_main.cc"], | |
75 | deps = [ | |
76 | ":googletest", | |
77 | "//base", | |
78 | "//base:flags", | |
79 | ":gunit", | |
80 | ] + select_mozc( | |
81 | client = [ | |
82 | "//base:init_mozc", | |
83 | ], | |
84 | nacl = [ | |
85 | "//testing:nacl_mock_module", | |
86 | "//base:init_mozc", | |
87 | ], | |
88 | ), | |
89 | ) | |
90 | ||
91 | cc_library_mozc( | |
92 | name = "nacl_mock_module", | |
93 | testonly = 1, | |
94 | srcs = ["base/public/nacl_mock_module.cc"], | |
95 | hdrs = ["base/public/nacl_mock_module.h"], | |
96 | deps = select_mozc( | |
97 | nacl = [ | |
98 | ":googletest", | |
99 | ":gunit", | |
100 | "//base", | |
101 | "//base:init_mozc", | |
102 | "//base:nacl_linkopts", | |
103 | "//net:http_client", | |
104 | ], | |
105 | ) + [ | |
106 | "//base:logging", | |
107 | "//base:port", | |
108 | ], | |
109 | alwayslink = 1, | |
110 | ) | |
111 | ||
112 | cc_library_mozc( | |
113 | name = "gunit_main", | |
114 | testonly = 1, | |
115 | hdrs = ["base/public/gunit.h"], | |
116 | deps = [":gunit"] + select_mozc( | |
117 | client = [":gtest_main"], | |
118 | default = ["//testing/base/public:gunit_main"], | |
119 | ), | |
120 | ) | |
121 | ||
122 | cc_library_mozc( | |
123 | name = "gunit_prod", | |
124 | hdrs = ["base/public/gunit_prod.h"], | |
125 | ) | |
126 | ||
127 | cc_library_mozc( | |
128 | name = "testing_util", | |
129 | testonly = 1, | |
130 | srcs = ["base/public/testing_util.cc"], | |
131 | hdrs = ["base/public/testing_util.h"], | |
132 | deps = [ | |
133 | ":gunit", | |
134 | ":testing", | |
135 | "//base", | |
136 | "//base:logging", | |
137 | "//base:port", | |
138 | "//base/protobuf", | |
139 | "//base/protobuf:message", | |
140 | "//base/protobuf:text_format", | |
141 | ], | |
142 | ) | |
143 | ||
144 | cc_library_mozc( | |
145 | name = "gunit", | |
146 | testonly = 1, | |
147 | hdrs = ["base/public/gunit.h"], | |
148 | visibility = ["//visibility:private"], | |
149 | deps = [ | |
150 | ":googletest", | |
151 | "//testing/base/public:gunit_for_library_testonly", | |
152 | ], | |
153 | ) | |
154 | ||
155 | cc_library_mozc( | |
156 | name = "googletest", | |
157 | testonly = 1, | |
158 | srcs = select_mozc( | |
159 | client = ["base/internal/googletest.cc"], | |
160 | default = [], | |
161 | ), | |
162 | hdrs = ["base/public/googletest.h"], | |
163 | visibility = [ | |
164 | "//:__subpackages__", | |
165 | ], | |
166 | deps = select_mozc( | |
167 | client = [ | |
168 | ":mozc_data_dir_header", | |
169 | "//base", | |
170 | "//base:logging", | |
171 | ], | |
172 | default = ["//testing/base/public:gunit_for_library_testonly"], | |
173 | ) + [ | |
174 | "//base:file_util", | |
175 | "//base:flags", | |
176 | "//base:util", | |
177 | ], | |
178 | ) | |
179 | ||
180 | cc_library_mozc( | |
181 | name = "mozctest", | |
182 | testonly = 1, | |
183 | srcs = ["base/public/mozctest.cc"], | |
184 | hdrs = ["base/public/mozctest.h"], | |
185 | visibility = [ | |
186 | "//:__subpackages__", | |
187 | ], | |
188 | deps = [ | |
189 | ":googletest", | |
190 | "//base", | |
191 | "//base:file_util", | |
192 | "//base:logging", | |
193 | "//base:port", | |
194 | "//base:system_util", | |
195 | "//base:util", | |
196 | "@com_google_absl//absl/strings", | |
197 | ], | |
198 | ) | |
199 | ||
200 | cc_library_mozc( | |
201 | name = "gmock", | |
202 | testonly = 1, | |
203 | hdrs = ["base/public/gmock.h"], | |
204 | visibility = [ | |
205 | "//:__subpackages__", | |
206 | ], | |
207 | deps = [ | |
208 | "//testing/base/public:gunit_for_library_testonly", | |
209 | ], | |
210 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | """Stub functions.""" | |
31 | ||
32 | def register_extension_info(**kwargs): | |
33 | # Do nothing for OSS. | |
34 | _ignore = kwargs | |
35 | pass |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | """Stub functions.""" | |
31 | ||
32 | def cc_public_library(**kwargs): | |
33 | native.cc_library(**kwargs) | |
34 | ||
35 | def cc_internal_library(**kwargs): | |
36 | native.cc_library(**kwargs) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | """Qt build rules.""" | |
31 | ||
32 | load( | |
33 | "//:build_defs.bzl", | |
34 | "cc_binary_mozc", | |
35 | "cc_library_mozc", | |
36 | "select_mozc", | |
37 | ) | |
38 | ||
39 | bin_path = "/usr/bin/" | |
40 | ||
41 | def cc_qt_library_mozc(name, deps = [], **kwargs): | |
42 | cc_library_mozc( | |
43 | name = name, | |
44 | deps = deps + select_mozc( | |
45 | oss_linux = ["@io_qt//:qt"], | |
46 | default = ["//third_party/qt:qt_native"], | |
47 | ), | |
48 | **kwargs | |
49 | ) | |
50 | ||
51 | def cc_qt_binary_mozc(name, deps = [], **kwargs): | |
52 | cc_binary_mozc( | |
53 | name = name, | |
54 | deps = deps + select_mozc( | |
55 | oss_linux = ["@io_qt//:qt"], | |
56 | default = ["//third_party/qt:qt_native"], | |
57 | ), | |
58 | **kwargs | |
59 | ) | |
60 | ||
61 | def qt_moc_mozc(name, srcs, outs): | |
62 | native.genrule( | |
63 | name = name, | |
64 | srcs = srcs, | |
65 | outs = outs, | |
66 | cmd = select_mozc( | |
67 | oss_linux = bin_path + "moc -p $$(dirname $<) -o $@ $(SRCS)", | |
68 | default = "$(location //third_party/qt:moc) -p $$(dirname $<) -o $@ $(SRCS)", | |
69 | ), | |
70 | tools = select_mozc( | |
71 | oss_linux = [], | |
72 | default = ["//third_party/qt:moc"], | |
73 | ), | |
74 | ) | |
75 | ||
76 | def qt_uic_mozc(name, srcs, outs): | |
77 | native.genrule( | |
78 | name = name, | |
79 | srcs = srcs, | |
80 | outs = outs, | |
81 | cmd = select_mozc( | |
82 | oss_linux = bin_path + "uic -o $@ $(SRCS)", | |
83 | default = "$(location //third_party/qt:uic) -o $@ $(SRCS)", | |
84 | ), | |
85 | tools = select_mozc( | |
86 | oss_linux = [], | |
87 | default = ["//third_party/qt:uic"], | |
88 | ), | |
89 | ) | |
90 | ||
91 | def qt_rcc_mozc(name, qrc_name, qrc_file, srcs, outs): | |
92 | native.genrule( | |
93 | name = name, | |
94 | srcs = [qrc_file] + srcs, | |
95 | outs = outs, | |
96 | cmd = select_mozc( | |
97 | oss_linux = bin_path + "rcc -o $@ -name " + qrc_name + " $(location " + qrc_file + ")", | |
98 | default = "$(location //third_party/qt:rcc) -o $@ -name " + qrc_name + " " + qrc_file, | |
99 | ), | |
100 | tools = select_mozc( | |
101 | oss_linux = [], | |
102 | default = ["//third_party/qt:rcc"], | |
103 | ), | |
104 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | """Stub build rules.""" | |
31 | ||
32 | def portable_proto_library(name, proto_deps, deps = [], **kwargs): | |
33 | _ignore = [kwargs] | |
34 | native.cc_proto_library(name = name, deps = deps + proto_deps) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | """Stub functions.""" | |
31 | ||
32 | def android_cc_test(name, cc_test_name, **kwargs): | |
33 | # TODO(b/110808149): Support Android test. | |
34 | _ignore = kwargs | |
35 | native.alias( | |
36 | name = name, | |
37 | actual = cc_test_name, | |
38 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | package( | |
31 | default_visibility = ["//visibility:public"], | |
32 | ) | |
33 | ||
34 | config_setting( | |
35 | name = "android", | |
36 | values = { | |
37 | "define": "TARGET=android", | |
38 | # "cc_target_os": "android", | |
39 | }, | |
40 | ) | |
41 | ||
42 | config_setting( | |
43 | name = "oss_android", | |
44 | values = { | |
45 | "define": "TARGET=oss_android", | |
46 | }, | |
47 | ) | |
48 | ||
49 | config_setting( | |
50 | name = "ios", | |
51 | values = { | |
52 | "define": "TARGET=ios", | |
53 | # "cc_target_os": "apple", | |
54 | }, | |
55 | ) | |
56 | ||
57 | # apple is used for both iOS and macOS. | |
58 | config_setting( | |
59 | name = "apple", | |
60 | constraint_values = [ | |
61 | "@bazel_tools//platforms:osx", | |
62 | ], | |
63 | ) | |
64 | ||
65 | config_setting( | |
66 | name = "nacl", | |
67 | values = { | |
68 | "define": "TARGET=nacl", | |
69 | # "cc_target_os": "nacl", | |
70 | }, | |
71 | ) | |
72 | ||
73 | config_setting( | |
74 | name = "linux", | |
75 | values = { | |
76 | "define": "TARGET=linux", | |
77 | }, | |
78 | ) | |
79 | ||
80 | config_setting( | |
81 | name = "oss_linux", | |
82 | values = { | |
83 | "define": "TARGET=oss_linux", | |
84 | }, | |
85 | ) | |
86 | ||
87 | config_setting( | |
88 | name = "wasm", | |
89 | values = { | |
90 | "define": "TARGET=wasm", | |
91 | }, | |
92 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | ) | |
35 | ||
36 | package(default_visibility = ["//:__subpackages__"]) | |
37 | ||
38 | test_suite( | |
39 | name = "nacl_test", | |
40 | ) | |
41 | ||
42 | cc_library_mozc( | |
43 | name = "transliteration", | |
44 | srcs = ["transliteration.cc"], | |
45 | hdrs = ["transliteration.h"], | |
46 | deps = [ | |
47 | "//base", | |
48 | "//base:port", | |
49 | ], | |
50 | ) | |
51 | ||
52 | cc_test_mozc( | |
53 | name = "transliteration_test", | |
54 | size = "small", | |
55 | srcs = ["transliteration_test.cc"], | |
56 | deps = [ | |
57 | ":transliteration", | |
58 | "//base", | |
59 | "//testing:gunit_main", | |
60 | ], | |
61 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_binary_mozc", | |
33 | "cc_library_mozc", | |
34 | "cc_test_mozc", | |
35 | ) | |
36 | ||
37 | package(default_visibility = ["//:__subpackages__"]) | |
38 | ||
39 | cc_binary_mozc( | |
40 | name = "mozc_emacs_helper", | |
41 | srcs = ["mozc_emacs_helper.cc"], | |
42 | copts = [ | |
43 | "$(STACK_FRAME_UNLIMITED)", # mozc_emacs_helper.cc | |
44 | ], | |
45 | deps = [ | |
46 | ":mozc_emacs_helper_lib", | |
47 | "//base", | |
48 | "//base:flags", | |
49 | "//base:init_mozc", | |
50 | "//base:logging", | |
51 | "//base:util", | |
52 | "//base:version", | |
53 | "//client", | |
54 | "//config:config_handler", | |
55 | "//ipc", | |
56 | "//protocol:commands_proto", | |
57 | "@com_google_absl//absl/strings:str_format", | |
58 | ], | |
59 | ) | |
60 | ||
61 | cc_library_mozc( | |
62 | name = "mozc_emacs_helper_lib", | |
63 | srcs = [ | |
64 | "client_pool.cc", | |
65 | "mozc_emacs_helper_lib.cc", | |
66 | ], | |
67 | hdrs = [ | |
68 | "client_pool.h", | |
69 | "mozc_emacs_helper_lib.h", | |
70 | ], | |
71 | deps = [ | |
72 | "//base", | |
73 | "//base:logging", | |
74 | "//base:number_util", | |
75 | "//base:port", | |
76 | "//base:util", | |
77 | "//base/protobuf", | |
78 | "//base/protobuf:descriptor", | |
79 | "//base/protobuf:message", | |
80 | "//client", | |
81 | "//composer:key_parser", | |
82 | "//protocol:commands_proto", | |
83 | "//storage:lru_cache", | |
84 | "//storage:lru_storage", | |
85 | "@com_google_absl//absl/strings:str_format", | |
86 | ], | |
87 | ) | |
88 | ||
89 | cc_test_mozc( | |
90 | name = "mozc_emacs_helper_lib_test", | |
91 | size = "small", | |
92 | srcs = ["mozc_emacs_helper_lib_test.cc"], | |
93 | deps = [ | |
94 | ":mozc_emacs_helper_lib", | |
95 | "//base:util", | |
96 | "//base/protobuf:message", | |
97 | "//protocol:commands_proto", | |
98 | "//testing:googletest", | |
99 | "//testing:gunit_main", | |
100 | ], | |
101 | ) |
0 | # -*- coding: utf-8 -*- | |
1 | # Copyright 2010-2020, Google Inc. | |
2 | # All rights reserved. | |
3 | # | |
4 | # Redistribution and use in source and binary forms, with or without | |
5 | # modification, are permitted provided that the following conditions are | |
6 | # met: | |
7 | # | |
8 | # * Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | |
10 | # * Redistributions in binary form must reproduce the above | |
11 | # copyright notice, this list of conditions and the following disclaimer | |
12 | # in the documentation and/or other materials provided with the | |
13 | # distribution. | |
14 | # * Neither the name of Google Inc. nor the names of its | |
15 | # contributors may be used to endorse or promote products derived from | |
16 | # this software without specific prior written permission. | |
17 | # | |
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | ||
30 | load( | |
31 | "//:build_defs.bzl", | |
32 | "cc_library_mozc", | |
33 | "cc_test_mozc", | |
34 | "py_binary_mozc", | |
35 | ) | |
36 | load("//tools/build_defs:stubs.bzl", "portable_proto_library") | |
37 | ||
38 | package(default_visibility = [ | |
39 | "//:__subpackages__", | |
40 | ]) | |
41 | ||
42 | test_suite( | |
43 | name = "nacl_test", | |
44 | ) | |
45 | ||
46 | portable_proto_library( | |
47 | name = "usage_stats_proto", | |
48 | config = "//protocol:portable_proto.pbtxt", | |
49 | header_outs = ["usage_stats.pb.h"], | |
50 | proto_deps = [":usage_stats_proto_full"], | |
51 | visibility = [ | |
52 | # For //session:session_usage_observer. | |
53 | "//session:__pkg__", | |
54 | ], | |
55 | ) | |
56 | ||
57 | proto_library( | |
58 | name = "usage_stats_proto_full", | |
59 | srcs = ["usage_stats.proto"], | |
60 | visibility = ["//visibility:private"], | |
61 | ) | |
62 | ||
63 | cc_library_mozc( | |
64 | name = "usage_stats", | |
65 | srcs = [ | |
66 | "usage_stats.cc", | |
67 | ":usage_stats_list", | |
68 | ], | |
69 | hdrs = ["usage_stats.h"], | |
70 | deps = [ | |
71 | ":usage_stats_proto", | |
72 | ":usage_stats_uploader", | |
73 | "//base", | |
74 | "//base:logging", | |
75 | "//base:port", | |
76 | "//config:stats_config_util", | |
77 | "//storage:registry", | |
78 | ], | |
79 | ) | |
80 | ||
81 | cc_test_mozc( | |
82 | name = "usage_stats_test", | |
83 | size = "small", | |
84 | srcs = ["usage_stats_test.cc"], | |
85 | tags = [ | |
86 | "no_android", | |
87 | ], | |
88 | deps = [ | |
89 | ":usage_stats", | |
90 | ":usage_stats_proto", | |
91 | "//base:port", | |
92 | "//base:system_util", | |
93 | "//config:stats_config_util", | |
94 | "//config:stats_config_util_mock", | |
95 | "//storage:registry", | |
96 | "//storage:storage_interaface", | |
97 | "//testing:googletest", | |
98 | "//testing:gunit_main", | |
99 | ], | |
100 | ) | |
101 | ||
102 | cc_library_mozc( | |
103 | name = "usage_stats_uploader", | |
104 | srcs = [ | |
105 | "usage_stats_uploader.cc", | |
106 | ":usage_stats_list", | |
107 | ], | |
108 | hdrs = ["usage_stats_uploader.h"], | |
109 | deps = [ | |
110 | "//base", | |
111 | "//base:port", | |
112 | "//storage:registry", | |
113 | ], | |
114 | ) | |
115 | ||
116 | cc_test_mozc( | |
117 | name = "usage_stats_uploader_test", | |
118 | size = "small", | |
119 | srcs = ["usage_stats_uploader_test.cc"], | |
120 | tags = [ | |
121 | "no_android", | |
122 | ], | |
123 | deps = [ | |
124 | ":usage_stats", | |
125 | ":usage_stats_testing_util", | |
126 | ":usage_stats_uploader", | |
127 | "//base", | |
128 | "//base:port", | |
129 | "//base:system_util", | |
130 | "//base:version", | |
131 | "//storage:registry", | |
132 | "//testing:googletest", | |
133 | "//testing:gunit_main", | |
134 | ], | |
135 | ) | |
136 | ||
137 | cc_library_mozc( | |
138 | name = "usage_stats_testing_util", | |
139 | testonly = 1, | |
140 | srcs = ["usage_stats_testing_util.cc"], | |
141 | hdrs = ["usage_stats_testing_util.h"], | |
142 | deps = [ | |
143 | ":usage_stats", | |
144 | ":usage_stats_proto", | |
145 | "//base", | |
146 | "//base:port", | |
147 | "//base:util", | |
148 | "//config:stats_config_util", | |
149 | "//config:stats_config_util_mock", | |
150 | "//testing", | |
151 | ], | |
152 | ) | |
153 | ||
154 | py_binary_mozc( | |
155 | name = "gen_stats_list", | |
156 | srcs = ["gen_stats_list.py"], | |
157 | ) | |
158 | ||
159 | genrule( | |
160 | name = "usage_stats_list", | |
161 | srcs = ["//data/usage_stats:stats.def"], | |
162 | outs = ["usage_stats_list.h"], | |
163 | cmd = "$(location :gen_stats_list) $(SRCS) > $@", | |
164 | tools = [":gen_stats_list"], | |
165 | ) |