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        "init_flags.cc",
15        "internal/filter_internal.cc",
16        "reflection_schema.cc",
17    ],
18}
19
20filegroup {
21    name: "BluetoothDumpsysTestSources",
22    srcs: [
23        "filter_test.cc",
24        "internal/filter_internal_test.cc",
25        "reflection_schema_test.cc",
26    ],
27}
28
29genrule {
30    name: "BluetoothGeneratedDumpsysTestData_h",
31    tools: [
32        "flatc",
33    ],
34    cmd: "$(location flatc) -I system/bt/gd -b --schema -o $(genDir) --cpp $(in) ",
35    srcs: [
36            "test_data/root.fbs",
37            "test_data/bar.fbs",
38            "test_data/baz.fbs",
39            "test_data/foo.fbs",
40            "test_data/qux.fbs",
41    ],
42    out: [
43        "root_generated.h",
44        "bar_generated.h",
45        "baz_generated.h",
46        "foo_generated.h",
47        "qux_generated.h",
48    ],
49}
50
51genrule {
52    name: "BluetoothGeneratedDumpsysTestData_bfbs",
53    tools: [
54        "flatc",
55    ],
56    cmd: "$(location flatc) -I system/bt/gd -b --schema -o $(genDir) --cpp $(in) ",
57    srcs: [
58            "test_data/root.fbs",
59            "test_data/bar.fbs",
60            "test_data/baz.fbs",
61            "test_data/foo.fbs",
62            "test_data/qux.fbs",
63    ],
64    out: [
65        "root.bfbs",
66        "bar.bfbs",
67        "baz.bfbs",
68        "foo.bfbs",
69        "qux.bfbs",
70    ],
71}
72
73genrule {
74    name: "BluetoothGeneratedDumpsysTestSchema_h",
75    tools: [
76        "bluetooth_flatbuffer_bundler",
77    ],
78    cmd: "$(location bluetooth_flatbuffer_bundler) -w -m bluetooth.DumpsysData -f dumpsys_module_schema_data -n testing -g $(genDir) $(locations :BluetoothGeneratedDumpsysBinarySchema_bfbs)",
79    srcs: [
80        ":BluetoothGeneratedDumpsysBinarySchema_bfbs",
81    ],
82    out: [
83         "dumpsys_module_schema_data.h",
84    ],
85}
86
87genrule {
88    name: "BluetoothGeneratedDumpsysBundledSchema_h",
89    tools: [
90            "bluetooth_flatbuffer_bundler",
91    ],
92    cmd: "$(location bluetooth_flatbuffer_bundler) -w -m bluetooth.DumpsysData -f generated_dumpsys_bundled_schema -n bluetooth::dumpsys -g $(genDir) $(locations :BluetoothGeneratedDumpsysBinarySchema_bfbs)",
93    srcs: [
94        ":BluetoothGeneratedDumpsysBinarySchema_bfbs",
95    ],
96    out: [
97         "generated_dumpsys_bundled_schema.h",
98    ],
99}
100
101genrule {
102    name: "BluetoothGeneratedDumpsysBundledTestSchema_h",
103    tools: [
104            "bluetooth_flatbuffer_bundler",
105    ],
106    cmd: "$(location bluetooth_flatbuffer_bundler) -w -m testing.DumpsysTestDataRoot  -f generated_dumpsys_bundled_test_schema -n testing -g $(genDir) $(locations :BluetoothGeneratedDumpsysTestData_bfbs)",
107    srcs: [
108        ":BluetoothGeneratedDumpsysTestData_bfbs",
109    ],
110    out: [
111         "generated_dumpsys_bundled_test_schema.h",
112    ],
113}
114
115genrule {
116    name: "BluetoothFlatbufferTestData_h",
117    tools: [
118        "flatc",
119    ],
120    cmd: "$(location flatc) -I system/bt/gd -b --schema -o $(genDir) --cpp $(in) ",
121    srcs: [
122        "bluetooth_flatbuffer_test.fbs",
123    ],
124    out: [
125        "bluetooth_flatbuffer_test_generated.h", "bluetooth_flatbuffer_test.bfbs",
126    ],
127}
128
129cc_test {
130    name: "bluetooth_flatbuffer_test",
131    test_suites: ["device-tests"],
132    host_supported: true,
133    test_options: {
134        unit_test: true,
135    },
136    static_libs: [
137        "libgmock",
138        "libflatbuffers-cpp",
139    ],
140    srcs: [
141        "bluetooth_flatbuffer_test.cc",
142    ],
143    generated_headers: [
144        "BluetoothFlatbufferTestData_h",
145    ],
146    cflags: [
147        "-Werror",
148        "-Wall",
149        "-Wextra",
150    ],
151}
152