blob: fdb032b285fc1dc35177c14ef3566ef1b864882a [file] [log] [blame]
Jiyong Park522ae9a2017-06-23 21:23:16 +09001//
2// Copyright (C) 2017 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
Bob Badour3c538232021-02-12 21:26:48 -080016package {
17 // See: http://go/android-license-faq
18 // A large-scale-change added 'default_applicable_licenses' to import
19 // all of the 'license_kinds' from "frameworks_native_license"
20 // to get the below license kinds:
21 // SPDX-license-identifier-Apache-2.0
22 default_applicable_licenses: ["frameworks_native_license"],
23}
24
Jiyong Park522ae9a2017-06-23 21:23:16 +090025cc_defaults {
Vishnu Naire97d6122018-01-18 13:58:56 -080026 name: "dumpstate_cflag_defaults",
Jiyong Park522ae9a2017-06-23 21:23:16 +090027 cflags: [
28 "-Wall",
29 "-Werror",
30 "-Wno-missing-field-initializers",
31 "-Wno-unused-variable",
32 "-Wunused-parameter",
33 ],
34}
35
Jiyong Park522ae9a2017-06-23 21:23:16 +090036cc_library_shared {
37 name: "libdumpstateutil",
Vishnu Naire97d6122018-01-18 13:58:56 -080038 defaults: ["dumpstate_cflag_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +090039 vendor_available: true,
Jiyong Park522ae9a2017-06-23 21:23:16 +090040 srcs: [
41 "DumpstateInternal.cpp",
42 "DumpstateUtil.cpp",
43 ],
44 shared_libs: [
45 "libbase",
46 "liblog",
47 ],
Jiyong Park259775c2017-11-03 14:40:24 +090048 export_include_dirs: ["."],
49 export_shared_lib_headers: [
50 "libbase",
51 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +090052}
53
54cc_library_shared {
55 name: "libdumpstateaidl",
Vishnu Naire97d6122018-01-18 13:58:56 -080056 defaults: ["dumpstate_cflag_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +090057 shared_libs: [
58 "libbinder",
59 "libutils",
60 ],
61 aidl: {
62 local_include_dirs: ["binder"],
63 export_aidl_headers: true,
64 },
65 srcs: [
Nandana Duttcccbb5f2018-09-27 09:23:36 +010066 ":dumpstate_aidl",
67 ],
68 export_include_dirs: ["binder"],
69}
70
71filegroup {
72 name: "dumpstate_aidl",
73 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +090074 "binder/android/os/IDumpstateListener.aidl",
Nandana Duttcccbb5f2018-09-27 09:23:36 +010075 "binder/android/os/IDumpstate.aidl",
Jiyong Park522ae9a2017-06-23 21:23:16 +090076 ],
Nandana Duttcccbb5f2018-09-27 09:23:36 +010077 path: "binder",
Jiyong Park522ae9a2017-06-23 21:23:16 +090078}
79
Vishnu Naire97d6122018-01-18 13:58:56 -080080cc_defaults {
81 name: "dumpstate_defaults",
Ted Bauerf8b76562024-04-30 20:59:04 +000082 defaults: [
83 "aconfig_lib_cc_static_link.defaults",
84 "dumpstate_cflag_defaults",
85 ],
Steven Moreland0d564d52025-01-10 22:24:57 +000086 // See README.md: "Dumpstate philosophy: exec not link"
87 // Do not add things here - keep dumpstate as simple as possible and exec where possible.
Jiyong Park522ae9a2017-06-23 21:23:16 +090088 shared_libs: [
89 "android.hardware.dumpstate@1.0",
Hunter Knepshield8540faf2020-02-04 19:47:20 -080090 "android.hardware.dumpstate@1.1",
Kedar Chitnis9fd8c052021-11-16 09:09:22 +000091 "android.hardware.dumpstate-V1-ndk",
Jiyong Park522ae9a2017-06-23 21:23:16 +090092 "libziparchive",
93 "libbase",
Steven Moreland0d564d52025-01-10 22:24:57 +000094 "libbinder", // BAD: dumpstate should not link code directly, should only exec binaries
95 "libbinder_ndk", // BAD: dumpstate should not link code directly, should only exec binaries
Jiyong Park522ae9a2017-06-23 21:23:16 +090096 "libcrypto",
97 "libcutils",
98 "libdebuggerd_client",
99 "libdumpstateaidl",
100 "libdumpstateutil",
Kweku Adams5ce418d2018-02-05 16:43:53 -0800101 "libdumputils",
Sahana Raof35ed432019-07-12 10:47:52 +0100102 "libhardware_legacy",
Steven Moreland0d564d52025-01-10 22:24:57 +0000103 "libhidlbase", // BAD: dumpstate should not link code directly, should only exec binaries
Jiyong Park522ae9a2017-06-23 21:23:16 +0900104 "liblog",
105 "libutils",
Steven Moreland0d564d52025-01-10 22:24:57 +0000106 "libvintf", // BAD: dumpstate should not link code directly, should only exec binaries
107 "libbinderdebug", // BAD: dumpstate should not link code directly, should only exec binaries
Samiul Islam8cd95232021-08-26 11:41:49 +0100108 "packagemanager_aidl-cpp",
Kholoud Mohamed7c3fb7c2023-10-18 12:56:22 +0000109 "server_configurable_flags",
110 "device_policy_aconfig_flags_c_lib",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900111 ],
112 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +0900113 "DumpstateService.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800114 ],
115 static_libs: [
Joe Onorato2927da92018-12-11 14:24:49 -0800116 "libincidentcompanion",
Vishnu Naire97d6122018-01-18 13:58:56 -0800117 "libdumpsys",
Joe Onorato2927da92018-12-11 14:24:49 -0800118 "libserviceutils",
Pablo Gamito654831c2024-02-16 16:47:48 +0000119 "android.tracing.flags_c_lib",
Primiano Tucci06d34202025-02-13 11:17:06 -0800120 "perfetto_flags_c_lib",
Vishnu Naire97d6122018-01-18 13:58:56 -0800121 ],
122}
123
Kunduz Baryktabasova3a5b65a2024-10-07 11:53:48 +0000124prebuilt_etc {
125 name: "default_screenshot",
126 src: "res/default_screenshot.png",
127 filename_from_src: true,
128}
129
Vishnu Naire97d6122018-01-18 13:58:56 -0800130cc_binary {
131 name: "dumpstate",
132 defaults: ["dumpstate_defaults"],
133 srcs: [
Rhed Jao27077b12020-07-14 18:38:08 +0800134 "DumpPool.cpp",
Rhed Jao4875aa62020-07-20 17:46:29 +0800135 "TaskQueue.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900136 "dumpstate.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800137 "main.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900138 ],
Elliott Hughesc1e09172018-06-27 15:04:28 -0700139 required: [
Alessio Balsini9e332a72024-12-10 15:31:57 +0000140 "alloctop",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700141 "atrace",
Kevin Jeon947922b2022-09-21 00:29:18 +0000142 "bugreport_procdump",
Kunduz Baryktabasova3a5b65a2024-10-07 11:53:48 +0000143 "default_screenshot",
Hridya Valsaraju1da80c52021-01-09 22:10:11 -0800144 "dmabuf_dump",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700145 "ip",
146 "iptables",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700147 "librank",
148 "logcat",
David Andersond9ba4752018-12-11 18:26:59 -0800149 "lpdump",
150 "lpdumpd",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700151 "procrank",
152 "screencap",
153 "showmap",
154 "ss",
155 "storaged",
Yo Chiang1151baf2020-06-04 16:52:27 +0800156 "toolbox",
157 "toybox",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700158 "vdc",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700159 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900160 init_rc: ["dumpstate.rc"],
161}
162
163cc_test {
164 name: "dumpstate_test",
165 defaults: ["dumpstate_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900166 srcs: [
Rhed Jao27077b12020-07-14 18:38:08 +0800167 "DumpPool.cpp",
Rhed Jao4875aa62020-07-20 17:46:29 +0800168 "TaskQueue.cpp",
Nandana Dutt3f8c7172018-09-25 12:01:54 +0100169 "dumpstate.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900170 "tests/dumpstate_test.cpp",
171 ],
Kean Mariotti306633e2022-09-05 16:30:47 +0000172 static_libs: [
Kean Mariotti306633e2022-09-05 16:30:47 +0000173 "libgmock",
174 ],
Dan Shie177e8e2019-06-20 11:08:14 -0700175 test_config: "dumpstate_test.xml",
Abhijeet Kaurb7b67bc2019-07-08 15:52:20 +0100176 data: [
177 ":dumpstate_test_fixture",
178 "tests/testdata/**/*",
179 ],
180 test_suites: ["device-tests"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900181}
Vishnu Naire97d6122018-01-18 13:58:56 -0800182
183cc_test {
184 name: "dumpstate_smoke_test",
185 defaults: ["dumpstate_defaults"],
186 srcs: [
Rhed Jao27077b12020-07-14 18:38:08 +0800187 "DumpPool.cpp",
Rhed Jao4875aa62020-07-20 17:46:29 +0800188 "TaskQueue.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800189 "dumpstate.cpp",
190 "tests/dumpstate_smoke_test.cpp",
191 ],
192 static_libs: ["libgmock"],
Rhed Jaod180c4c2020-06-23 19:22:34 +0800193 test_config: "dumpstate_smoke_test.xml",
194 test_suites: ["device-tests"],
Kweku Adams5ce418d2018-02-05 16:43:53 -0800195}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800196
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800197// =======================#
198// dumpstate_test_fixture #
199// =======================#
200cc_test {
201
202 name: "dumpstate_test_fixture",
203 test_suites: ["device-tests"],
204 cflags: [
205 "-Wall",
206 "-Werror",
207 "-Wno-missing-field-initializers",
208 "-Wno-unused-variable",
209 "-Wunused-parameter",
210 ],
211 srcs: ["tests/dumpstate_test_fixture.cpp"],
212 data: ["tests/testdata/**/*"],
213}