xref: /aosp_15_r20/external/libtextclassifier/native/FlatBufferHeaders.bp (revision 993b0882672172b81d12fad7a7ac0c3e5c824a12)
1//
2// Copyright (C) 2018 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17genrule {
18    name: "libtextclassifier_fbgen_utils_i18n_language-tag",
19    srcs: ["utils/i18n/language-tag.fbs"],
20    out: ["utils/i18n/language-tag_generated.h"],
21    tools: ["flatc"],
22    cmd: FBGEN_ARGS + "$(in)",
23}
24
25genrule {
26    name: "libtextclassifier_fbgen_utils_tflite_text_encoder_config",
27    srcs: ["utils/tflite/text_encoder_config.fbs"],
28    out: ["utils/tflite/text_encoder_config_generated.h"],
29    tools: ["flatc"],
30    cmd: FBGEN_ARGS + "$(in)",
31}
32
33genrule {
34    name: "libtextclassifier_fbgen_utils_resources",
35    srcs: [
36        "utils/i18n/language-tag.fbs",
37        "utils/resources.fbs",
38        "utils/zlib/buffer.fbs",
39    ],
40    out: ["utils/resources_generated.h"],
41    tools: ["flatc"],
42    cmd: FBGEN_ARGS + "$(location utils/resources.fbs)",
43}
44
45genrule {
46    name: "libtextclassifier_fbgen_utils_grammar_rules",
47    srcs: [
48        "utils/flatbuffers/flatbuffers.fbs",
49        "utils/grammar/rules.fbs",
50        "utils/grammar/semantics/expression.fbs",
51        "utils/i18n/language-tag.fbs",
52        "utils/zlib/buffer.fbs",
53    ],
54    out: ["utils/grammar/rules_generated.h"],
55    tools: ["flatc"],
56    cmd: FBGEN_ARGS + "$(location utils/grammar/rules.fbs)",
57}
58
59genrule {
60    name: "libtextclassifier_fbgen_utils_grammar_testing_value",
61    srcs: ["utils/grammar/testing/value.fbs"],
62    out: ["utils/grammar/testing/value_generated.h"],
63    tools: ["flatc"],
64    cmd: FBGEN_ARGS + "$(in)",
65}
66
67genrule {
68    name: "libtextclassifier_fbgen_utils_grammar_semantics_expression",
69    srcs: [
70        "utils/flatbuffers/flatbuffers.fbs",
71        "utils/grammar/semantics/expression.fbs",
72    ],
73    out: ["utils/grammar/semantics/expression_generated.h"],
74    tools: ["flatc"],
75    cmd: FBGEN_ARGS + "$(location utils/grammar/semantics/expression.fbs)",
76}
77
78genrule {
79    name: "libtextclassifier_fbgen_utils_zlib_buffer",
80    srcs: ["utils/zlib/buffer.fbs"],
81    out: ["utils/zlib/buffer_generated.h"],
82    tools: ["flatc"],
83    cmd: FBGEN_ARGS + "$(in)",
84}
85
86genrule {
87    name: "libtextclassifier_fbgen_utils_normalization",
88    srcs: ["utils/normalization.fbs"],
89    out: ["utils/normalization_generated.h"],
90    tools: ["flatc"],
91    cmd: FBGEN_ARGS + "$(in)",
92}
93
94genrule {
95    name: "libtextclassifier_fbgen_utils_intents_intent-config",
96    srcs: [
97        "utils/intents/intent-config.fbs",
98        "utils/zlib/buffer.fbs",
99    ],
100    out: ["utils/intents/intent-config_generated.h"],
101    tools: ["flatc"],
102    cmd: FBGEN_ARGS + "$(location utils/intents/intent-config.fbs)",
103}
104
105genrule {
106    name: "libtextclassifier_fbgen_utils_container_bit-vector",
107    srcs: ["utils/container/bit-vector.fbs"],
108    out: ["utils/container/bit-vector_generated.h"],
109    tools: ["flatc"],
110    cmd: FBGEN_ARGS + "$(in)",
111}
112
113genrule {
114    name: "libtextclassifier_fbgen_utils_codepoint-range",
115    srcs: ["utils/codepoint-range.fbs"],
116    out: ["utils/codepoint-range_generated.h"],
117    tools: ["flatc"],
118    cmd: FBGEN_ARGS + "$(in)",
119}
120
121genrule {
122    name: "libtextclassifier_fbgen_utils_tokenizer",
123    srcs: ["utils/tokenizer.fbs"],
124    out: ["utils/tokenizer_generated.h"],
125    tools: ["flatc"],
126    cmd: FBGEN_ARGS + "$(in)",
127}
128
129genrule {
130    name: "libtextclassifier_fbgen_utils_flatbuffers_flatbuffers",
131    srcs: ["utils/flatbuffers/flatbuffers.fbs"],
132    out: ["utils/flatbuffers/flatbuffers_generated.h"],
133    tools: ["flatc"],
134    cmd: FBGEN_ARGS + "$(in)",
135}
136
137genrule {
138    name: "libtextclassifier_fbgen_actions_actions_model",
139    srcs: [
140        "actions/actions-entity-data.fbs",
141        "actions/actions_model.fbs",
142        "annotator/entity-data.fbs",
143        "annotator/experimental/experimental.fbs",
144        "annotator/model.fbs",
145        "utils/codepoint-range.fbs",
146        "utils/container/bit-vector.fbs",
147        "utils/flatbuffers/flatbuffers.fbs",
148        "utils/grammar/rules.fbs",
149        "utils/grammar/semantics/expression.fbs",
150        "utils/i18n/language-tag.fbs",
151        "utils/intents/intent-config.fbs",
152        "utils/normalization.fbs",
153        "utils/resources.fbs",
154        "utils/tokenizer.fbs",
155        "utils/zlib/buffer.fbs",
156    ],
157    out: ["actions/actions_model_generated.h"],
158    tools: ["flatc"],
159    cmd: FBGEN_ARGS + "$(location actions/actions_model.fbs)",
160}
161
162genrule {
163    name: "libtextclassifier_fbgen_actions_actions-entity-data",
164    srcs: ["actions/actions-entity-data.fbs"],
165    out: ["actions/actions-entity-data_generated.h"],
166    tools: ["flatc"],
167    cmd: FBGEN_ARGS + "$(in)",
168}
169
170genrule {
171    name: "libtextclassifier_fbgen_lang_id_common_flatbuffers_embedding-network",
172    srcs: ["lang_id/common/flatbuffers/embedding-network.fbs"],
173    out: ["lang_id/common/flatbuffers/embedding-network_generated.h"],
174    tools: ["flatc"],
175    cmd: FBGEN_ARGS + "$(in)",
176}
177
178genrule {
179    name: "libtextclassifier_fbgen_lang_id_common_flatbuffers_model",
180    srcs: ["lang_id/common/flatbuffers/model.fbs"],
181    out: ["lang_id/common/flatbuffers/model_generated.h"],
182    tools: ["flatc"],
183    cmd: FBGEN_ARGS + "$(in)",
184}
185
186genrule {
187    name: "libtextclassifier_fbgen_annotator_entity-data",
188    srcs: ["annotator/entity-data.fbs"],
189    out: ["annotator/entity-data_generated.h"],
190    tools: ["flatc"],
191    cmd: FBGEN_ARGS + "$(in)",
192}
193
194genrule {
195    name: "libtextclassifier_fbgen_annotator_person_name_person_name_model",
196    srcs: [
197        "annotator/entity-data.fbs",
198        "annotator/experimental/experimental.fbs",
199        "annotator/model.fbs",
200        "annotator/person_name/person_name_model.fbs",
201        "utils/codepoint-range.fbs",
202        "utils/container/bit-vector.fbs",
203        "utils/flatbuffers/flatbuffers.fbs",
204        "utils/grammar/rules.fbs",
205        "utils/grammar/semantics/expression.fbs",
206        "utils/i18n/language-tag.fbs",
207        "utils/intents/intent-config.fbs",
208        "utils/normalization.fbs",
209        "utils/resources.fbs",
210        "utils/tokenizer.fbs",
211        "utils/zlib/buffer.fbs",
212    ],
213    out: ["annotator/person_name/person_name_model_generated.h"],
214    tools: ["flatc"],
215    cmd: FBGEN_ARGS + "$(location annotator/person_name/person_name_model.fbs)",
216}
217
218genrule {
219    name: "libtextclassifier_fbgen_annotator_experimental_experimental",
220    srcs: ["annotator/experimental/experimental.fbs"],
221    out: ["annotator/experimental/experimental_generated.h"],
222    tools: ["flatc"],
223    cmd: FBGEN_ARGS + "$(in)",
224}
225
226genrule {
227    name: "libtextclassifier_fbgen_annotator_model",
228    srcs: [
229        "annotator/entity-data.fbs",
230        "annotator/experimental/experimental.fbs",
231        "annotator/model.fbs",
232        "utils/codepoint-range.fbs",
233        "utils/container/bit-vector.fbs",
234        "utils/flatbuffers/flatbuffers.fbs",
235        "utils/grammar/rules.fbs",
236        "utils/grammar/semantics/expression.fbs",
237        "utils/i18n/language-tag.fbs",
238        "utils/intents/intent-config.fbs",
239        "utils/normalization.fbs",
240        "utils/resources.fbs",
241        "utils/tokenizer.fbs",
242        "utils/zlib/buffer.fbs",
243    ],
244    out: ["annotator/model_generated.h"],
245    tools: ["flatc"],
246    cmd: FBGEN_ARGS + "$(location annotator/model.fbs)",
247}
248
249genrule {
250    name: "libtextclassifier_fbgen_annotator_datetime_datetime",
251    srcs: ["annotator/datetime/datetime.fbs"],
252    out: ["annotator/datetime/datetime_generated.h"],
253    tools: ["flatc"],
254    cmd: FBGEN_ARGS + "$(in)",
255}
256
257cc_library_headers {
258    name: "libtextclassifier_flatbuffer_headers",
259    stl: "libc++_static",
260    sdk_version: "current",
261    min_sdk_version: "30",
262    apex_available: [
263        "//apex_available:platform",
264        "com.android.extservices",
265        "com.android.adservices",
266    ],
267    generated_headers: [
268        "libtextclassifier_fbgen_utils_i18n_language-tag",
269        "libtextclassifier_fbgen_utils_tflite_text_encoder_config",
270        "libtextclassifier_fbgen_utils_resources",
271        "libtextclassifier_fbgen_utils_grammar_rules",
272        "libtextclassifier_fbgen_utils_grammar_semantics_expression",
273        "libtextclassifier_fbgen_utils_zlib_buffer",
274        "libtextclassifier_fbgen_utils_normalization",
275        "libtextclassifier_fbgen_utils_intents_intent-config",
276        "libtextclassifier_fbgen_utils_container_bit-vector",
277        "libtextclassifier_fbgen_utils_codepoint-range",
278        "libtextclassifier_fbgen_utils_tokenizer",
279        "libtextclassifier_fbgen_utils_flatbuffers_flatbuffers",
280        "libtextclassifier_fbgen_actions_actions_model",
281        "libtextclassifier_fbgen_actions_actions-entity-data",
282        "libtextclassifier_fbgen_lang_id_common_flatbuffers_embedding-network",
283        "libtextclassifier_fbgen_lang_id_common_flatbuffers_model",
284        "libtextclassifier_fbgen_annotator_entity-data",
285        "libtextclassifier_fbgen_annotator_person_name_person_name_model",
286        "libtextclassifier_fbgen_annotator_experimental_experimental",
287        "libtextclassifier_fbgen_annotator_model",
288        "libtextclassifier_fbgen_annotator_datetime_datetime",
289    ],
290    export_generated_headers: [
291        "libtextclassifier_fbgen_utils_i18n_language-tag",
292        "libtextclassifier_fbgen_utils_tflite_text_encoder_config",
293        "libtextclassifier_fbgen_utils_resources",
294        "libtextclassifier_fbgen_utils_grammar_rules",
295        "libtextclassifier_fbgen_utils_grammar_semantics_expression",
296        "libtextclassifier_fbgen_utils_zlib_buffer",
297        "libtextclassifier_fbgen_utils_normalization",
298        "libtextclassifier_fbgen_utils_intents_intent-config",
299        "libtextclassifier_fbgen_utils_container_bit-vector",
300        "libtextclassifier_fbgen_utils_codepoint-range",
301        "libtextclassifier_fbgen_utils_tokenizer",
302        "libtextclassifier_fbgen_utils_flatbuffers_flatbuffers",
303        "libtextclassifier_fbgen_actions_actions_model",
304        "libtextclassifier_fbgen_actions_actions-entity-data",
305        "libtextclassifier_fbgen_lang_id_common_flatbuffers_embedding-network",
306        "libtextclassifier_fbgen_lang_id_common_flatbuffers_model",
307        "libtextclassifier_fbgen_annotator_entity-data",
308        "libtextclassifier_fbgen_annotator_person_name_person_name_model",
309        "libtextclassifier_fbgen_annotator_experimental_experimental",
310        "libtextclassifier_fbgen_annotator_model",
311        "libtextclassifier_fbgen_annotator_datetime_datetime",
312    ],
313}
314
315cc_library_headers {
316    name: "libtextclassifier_flatbuffer_testonly_headers",
317    stl: "libc++_static",
318    sdk_version: "current",
319    min_sdk_version: "30",
320    apex_available: [
321        "//apex_available:platform",
322        "com.android.extservices",
323    ],
324    generated_headers: [
325        "libtextclassifier_fbgen_utils_grammar_testing_value",
326    ],
327    export_generated_headers: [
328        "libtextclassifier_fbgen_utils_grammar_testing_value",
329    ],
330}
331