blob: a2491e503f92f298c3ab034893f36506b7517e7a [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,
Justin Yun7fdc6602017-08-02 17:02:05 +090040 vndk: {
41 enabled: true,
42 },
Jiyong Park522ae9a2017-06-23 21:23:16 +090043 srcs: [
44 "DumpstateInternal.cpp",
45 "DumpstateUtil.cpp",
46 ],
47 shared_libs: [
48 "libbase",
49 "liblog",
50 ],
Jiyong Park259775c2017-11-03 14:40:24 +090051 export_include_dirs: ["."],
52 export_shared_lib_headers: [
53 "libbase",
54 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +090055}
56
57cc_library_shared {
58 name: "libdumpstateaidl",
Vishnu Naire97d6122018-01-18 13:58:56 -080059 defaults: ["dumpstate_cflag_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +090060 shared_libs: [
61 "libbinder",
62 "libutils",
63 ],
64 aidl: {
65 local_include_dirs: ["binder"],
66 export_aidl_headers: true,
67 },
68 srcs: [
Nandana Duttcccbb5f2018-09-27 09:23:36 +010069 ":dumpstate_aidl",
70 ],
71 export_include_dirs: ["binder"],
72}
73
74filegroup {
75 name: "dumpstate_aidl",
76 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +090077 "binder/android/os/IDumpstateListener.aidl",
Nandana Duttcccbb5f2018-09-27 09:23:36 +010078 "binder/android/os/IDumpstate.aidl",
Jiyong Park522ae9a2017-06-23 21:23:16 +090079 ],
Nandana Duttcccbb5f2018-09-27 09:23:36 +010080 path: "binder",
Jiyong Park522ae9a2017-06-23 21:23:16 +090081}
82
Vishnu Naire97d6122018-01-18 13:58:56 -080083cc_defaults {
84 name: "dumpstate_defaults",
85 defaults: ["dumpstate_cflag_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +090086 shared_libs: [
87 "android.hardware.dumpstate@1.0",
Hunter Knepshield8540faf2020-02-04 19:47:20 -080088 "android.hardware.dumpstate@1.1",
Kedar Chitnis9fd8c052021-11-16 09:09:22 +000089 "android.hardware.dumpstate-V1-ndk",
Jiyong Park522ae9a2017-06-23 21:23:16 +090090 "libziparchive",
91 "libbase",
92 "libbinder",
Kedar Chitnis9fd8c052021-11-16 09:09:22 +000093 "libbinder_ndk",
Jiyong Park522ae9a2017-06-23 21:23:16 +090094 "libcrypto",
95 "libcutils",
96 "libdebuggerd_client",
97 "libdumpstateaidl",
98 "libdumpstateutil",
Kweku Adams5ce418d2018-02-05 16:43:53 -080099 "libdumputils",
Sahana Raof35ed432019-07-12 10:47:52 +0100100 "libhardware_legacy",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900101 "libhidlbase",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900102 "liblog",
103 "libutils",
Devin Moorecfeeda42020-12-08 12:50:58 -0800104 "libbinderdebug",
Samiul Islam8cd95232021-08-26 11:41:49 +0100105 "packagemanager_aidl-cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900106 ],
107 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +0900108 "DumpstateService.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800109 ],
110 static_libs: [
Joe Onorato2927da92018-12-11 14:24:49 -0800111 "libincidentcompanion",
Vishnu Naire97d6122018-01-18 13:58:56 -0800112 "libdumpsys",
Joe Onorato2927da92018-12-11 14:24:49 -0800113 "libserviceutils",
Vishnu Naire97d6122018-01-18 13:58:56 -0800114 ],
115}
116
117cc_binary {
118 name: "dumpstate",
119 defaults: ["dumpstate_defaults"],
120 srcs: [
Rhed Jao27077b12020-07-14 18:38:08 +0800121 "DumpPool.cpp",
Rhed Jao4875aa62020-07-20 17:46:29 +0800122 "TaskQueue.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900123 "dumpstate.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800124 "main.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900125 ],
Elliott Hughesc1e09172018-06-27 15:04:28 -0700126 required: [
127 "atrace",
Hridya Valsaraju1da80c52021-01-09 22:10:11 -0800128 "dmabuf_dump",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700129 "ip",
130 "iptables",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700131 "librank",
132 "logcat",
David Andersond9ba4752018-12-11 18:26:59 -0800133 "lpdump",
134 "lpdumpd",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700135 "procrank",
136 "screencap",
137 "showmap",
138 "ss",
139 "storaged",
Yo Chiang1151baf2020-06-04 16:52:27 +0800140 "toolbox",
141 "toybox",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700142 "vdc",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700143 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900144 init_rc: ["dumpstate.rc"],
145}
146
147cc_test {
148 name: "dumpstate_test",
149 defaults: ["dumpstate_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900150 srcs: [
Rhed Jao27077b12020-07-14 18:38:08 +0800151 "DumpPool.cpp",
Rhed Jao4875aa62020-07-20 17:46:29 +0800152 "TaskQueue.cpp",
Nandana Dutt3f8c7172018-09-25 12:01:54 +0100153 "dumpstate.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900154 "tests/dumpstate_test.cpp",
155 ],
156 static_libs: ["libgmock"],
Dan Shie177e8e2019-06-20 11:08:14 -0700157 test_config: "dumpstate_test.xml",
Abhijeet Kaurb7b67bc2019-07-08 15:52:20 +0100158 data: [
159 ":dumpstate_test_fixture",
160 "tests/testdata/**/*",
161 ],
162 test_suites: ["device-tests"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900163}
Vishnu Naire97d6122018-01-18 13:58:56 -0800164
165cc_test {
166 name: "dumpstate_smoke_test",
167 defaults: ["dumpstate_defaults"],
168 srcs: [
Rhed Jao27077b12020-07-14 18:38:08 +0800169 "DumpPool.cpp",
Rhed Jao4875aa62020-07-20 17:46:29 +0800170 "TaskQueue.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800171 "dumpstate.cpp",
172 "tests/dumpstate_smoke_test.cpp",
173 ],
174 static_libs: ["libgmock"],
Rhed Jaod180c4c2020-06-23 19:22:34 +0800175 test_config: "dumpstate_smoke_test.xml",
176 test_suites: ["device-tests"],
Kweku Adams5ce418d2018-02-05 16:43:53 -0800177}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800178
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800179// =======================#
180// dumpstate_test_fixture #
181// =======================#
182cc_test {
183
184 name: "dumpstate_test_fixture",
185 test_suites: ["device-tests"],
186 cflags: [
187 "-Wall",
188 "-Werror",
189 "-Wno-missing-field-initializers",
190 "-Wno-unused-variable",
191 "-Wunused-parameter",
192 ],
193 srcs: ["tests/dumpstate_test_fixture.cpp"],
194 data: ["tests/testdata/**/*"],
195}