• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "system_bt_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["system_bt_license"],
8}
9
10filegroup {
11    name: "BluetoothDumpsysSources",
12    srcs: [
13        "filter.cc",
14        "internal/filter_internal.cc",
15        "reflection_schema.cc",
16    ],
17}
18
19filegroup {
20    name: "BluetoothDumpsysTestSources",
21    srcs: [
22        "filter_test.cc",
23        "internal/filter_internal_test.cc",
24        "reflection_schema_test.cc",
25    ],
26}
27
28genrule {
29    name: "BluetoothGeneratedDumpsysTestData_h",
30    visibility: ["//visibility:public"],
31    tools: [
32        "flatc",
33    ],
34    cmd: "$(location flatc) -I packages/modules/Bluetooth/system/gd -b --schema -o $(genDir) --cpp $(in) ",
35    srcs: [
36        "test_data/bar.fbs",
37        "test_data/baz.fbs",
38        "test_data/foo.fbs",
39        "test_data/qux.fbs",
40        "test_data/root.fbs",
41    ],
42    out: [
43        "bar_generated.h",
44        "baz_generated.h",
45        "foo_generated.h",
46        "qux_generated.h",
47        "root_generated.h",
48    ],
49}
50
51genrule {
52    name: "BluetoothGeneratedDumpsysTestData_bfbs",
53    visibility: ["//visibility:private"],
54    tools: [
55        "flatc",
56    ],
57    cmd: "$(location flatc) -I packages/modules/Bluetooth/system/gd -b --schema -o $(genDir) --cpp $(in) ",
58    srcs: [
59        "test_data/bar.fbs",
60        "test_data/baz.fbs",
61        "test_data/foo.fbs",
62        "test_data/qux.fbs",
63        "test_data/root.fbs",
64    ],
65    out: [
66        "bar.bfbs",
67        "baz.bfbs",
68        "foo.bfbs",
69        "qux.bfbs",
70        "root.bfbs",
71    ],
72}
73
74genrule {
75    name: "BluetoothGeneratedDumpsysTestSchema_cc",
76    visibility: ["//visibility:private"],
77    tools: [
78        "bluetooth_flatbuffer_bundler",
79    ],
80    cmd: "$(location bluetooth_flatbuffer_bundler) -w -m bluetooth.DumpsysData -f dumpsys_module_schema_data -n testing -g $(genDir) $(locations :BluetoothGeneratedDumpsysBinarySchema_bfbs)",
81    srcs: [
82        ":BluetoothGeneratedDumpsysBinarySchema_bfbs",
83    ],
84    out: [
85        "dumpsys_module_schema_data.cc",
86    ],
87}
88
89genrule {
90    name: "BluetoothGeneratedDumpsysBundledSchema_cc",
91    visibility: ["//visibility:private"],
92    tools: [
93        "bluetooth_flatbuffer_bundler",
94    ],
95    cmd: "$(location bluetooth_flatbuffer_bundler) -w -m bluetooth.DumpsysData -f generated_dumpsys_bundled_schema -n bluetooth::dumpsys -g $(genDir) $(locations :BluetoothGeneratedDumpsysBinarySchema_bfbs)",
96    srcs: [
97        ":BluetoothGeneratedDumpsysBinarySchema_bfbs",
98    ],
99    out: [
100        "generated_dumpsys_bundled_schema.cc",
101    ],
102}
103
104genrule {
105    name: "BluetoothGeneratedDumpsysBundledTestSchema_cc",
106    visibility: ["//visibility:private"],
107    tools: [
108        "bluetooth_flatbuffer_bundler",
109    ],
110    cmd: "$(location bluetooth_flatbuffer_bundler) -w -m testing.DumpsysTestDataRoot  -f generated_dumpsys_bundled_test_schema -n testing -g $(genDir) $(locations :BluetoothGeneratedDumpsysTestData_bfbs)",
111    srcs: [
112        ":BluetoothGeneratedDumpsysTestData_bfbs",
113    ],
114    out: [
115        "generated_dumpsys_bundled_test_schema.cc",
116    ],
117}
118
119genrule {
120    name: "BluetoothFlatbufferTestData_h",
121    tools: [
122        "flatc",
123    ],
124    cmd: "$(location flatc) -I packages/modules/Bluetooth/system/gd -b --schema -o $(genDir) --cpp $(in) ",
125    srcs: [
126        "bluetooth_flatbuffer_test.fbs",
127    ],
128    out: [
129        "bluetooth_flatbuffer_test.bfbs",
130        "bluetooth_flatbuffer_test_generated.h",
131    ],
132}
133
134genrule {
135    name: "BluetoothGeneratedDumpsysInternalTestData_h",
136    tools: [
137        "flatc",
138    ],
139    cmd: "$(location flatc) --cpp -o $(genDir)/dumpsys/internal/test_data $(in)",
140    srcs: [
141        "internal/test_data/float.fbs",
142        "internal/test_data/integer.fbs",
143        "internal/test_data/string.fbs",
144        "internal/test_data/struct.fbs",
145    ],
146    out: [
147        "dumpsys/internal/test_data/float_generated.h",
148        "dumpsys/internal/test_data/integer_generated.h",
149        "dumpsys/internal/test_data/string_generated.h",
150        "dumpsys/internal/test_data/struct_generated.h",
151    ],
152}
153
154cc_library {
155    name: "libbluetooth-dumpsys",
156    host_supported: true,
157    defaults: [
158        "gd_clang_tidy",
159        "gd_defaults",
160    ],
161    generated_sources: [
162        "BluetoothGeneratedDumpsysBundledSchema_cc",
163    ],
164    apex_available: [
165        "com.android.btservices",
166    ],
167    min_sdk_version: "30",
168}
169
170cc_library {
171    name: "libbluetooth-dumpsys-test",
172    host_supported: true,
173    defaults: [
174        "gd_clang_tidy",
175        "gd_defaults",
176    ],
177    generated_sources: [
178        "BluetoothGeneratedDumpsysBundledTestSchema_cc",
179    ],
180}
181
182cc_library {
183    name: "libbluetooth-dumpsys-unittest",
184    host_supported: true,
185    defaults: [
186        "gd_clang_tidy",
187        "gd_defaults",
188    ],
189    generated_headers: [
190        "BluetoothGeneratedDumpsysTestSchema_cc",
191    ],
192}
193
194cc_test {
195    name: "bluetooth_flatbuffer_tests",
196    test_suites: ["general-tests"],
197    defaults: [
198        "bluetooth_cflags",
199        "mts_defaults",
200    ],
201    host_supported: true,
202    test_options: {
203        unit_test: true,
204    },
205    static_libs: [
206        "libflatbuffers-cpp",
207        "libgmock",
208    ],
209    srcs: [
210        "bluetooth_flatbuffer_test.cc",
211    ],
212    generated_headers: [
213        "BluetoothFlatbufferTestData_h",
214    ],
215    min_sdk_version: "30",
216}
217