blob: acca11acf7cdb872d817502576f241f430751b8b [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
16cc_defaults {
Vishnu Naire97d6122018-01-18 13:58:56 -080017 name: "dumpstate_cflag_defaults",
Jiyong Park522ae9a2017-06-23 21:23:16 +090018 cflags: [
19 "-Wall",
20 "-Werror",
21 "-Wno-missing-field-initializers",
22 "-Wno-unused-variable",
23 "-Wunused-parameter",
24 ],
25}
26
Jiyong Park522ae9a2017-06-23 21:23:16 +090027cc_library_shared {
28 name: "libdumpstateutil",
Vishnu Naire97d6122018-01-18 13:58:56 -080029 defaults: ["dumpstate_cflag_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +090030 vendor_available: true,
Justin Yun7fdc6602017-08-02 17:02:05 +090031 vndk: {
32 enabled: true,
33 },
Jiyong Park522ae9a2017-06-23 21:23:16 +090034 srcs: [
35 "DumpstateInternal.cpp",
36 "DumpstateUtil.cpp",
37 ],
38 shared_libs: [
39 "libbase",
40 "liblog",
41 ],
Jiyong Park259775c2017-11-03 14:40:24 +090042 export_include_dirs: ["."],
43 export_shared_lib_headers: [
44 "libbase",
45 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +090046}
47
48cc_library_shared {
49 name: "libdumpstateaidl",
Vishnu Naire97d6122018-01-18 13:58:56 -080050 defaults: ["dumpstate_cflag_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +090051 shared_libs: [
52 "libbinder",
53 "libutils",
54 ],
55 aidl: {
56 local_include_dirs: ["binder"],
57 export_aidl_headers: true,
58 },
59 srcs: [
Nandana Duttcccbb5f2018-09-27 09:23:36 +010060 ":dumpstate_aidl",
61 ],
62 export_include_dirs: ["binder"],
63}
64
65filegroup {
66 name: "dumpstate_aidl",
67 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +090068 "binder/android/os/IDumpstateListener.aidl",
Nandana Duttcccbb5f2018-09-27 09:23:36 +010069 "binder/android/os/IDumpstate.aidl",
Jiyong Park522ae9a2017-06-23 21:23:16 +090070 ],
Nandana Duttcccbb5f2018-09-27 09:23:36 +010071 path: "binder",
Jiyong Park522ae9a2017-06-23 21:23:16 +090072}
73
Vishnu Naire97d6122018-01-18 13:58:56 -080074cc_defaults {
75 name: "dumpstate_defaults",
76 defaults: ["dumpstate_cflag_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +090077 shared_libs: [
78 "android.hardware.dumpstate@1.0",
Hunter Knepshield8540faf2020-02-04 19:47:20 -080079 "android.hardware.dumpstate@1.1",
Jiyong Park522ae9a2017-06-23 21:23:16 +090080 "libziparchive",
81 "libbase",
82 "libbinder",
83 "libcrypto",
84 "libcutils",
85 "libdebuggerd_client",
86 "libdumpstateaidl",
87 "libdumpstateutil",
Kweku Adams5ce418d2018-02-05 16:43:53 -080088 "libdumputils",
Sahana Raof35ed432019-07-12 10:47:52 +010089 "libhardware_legacy",
Jiyong Park522ae9a2017-06-23 21:23:16 +090090 "libhidlbase",
Jiyong Park522ae9a2017-06-23 21:23:16 +090091 "liblog",
92 "libutils",
93 ],
94 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +090095 "DumpstateService.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -080096 ],
97 static_libs: [
Joe Onorato2927da92018-12-11 14:24:49 -080098 "libincidentcompanion",
Vishnu Naire97d6122018-01-18 13:58:56 -080099 "libdumpsys",
Joe Onorato2927da92018-12-11 14:24:49 -0800100 "libserviceutils",
Vishnu Naire97d6122018-01-18 13:58:56 -0800101 ],
102}
103
104cc_binary {
105 name: "dumpstate",
106 defaults: ["dumpstate_defaults"],
107 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +0900108 "dumpstate.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800109 "main.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900110 ],
Elliott Hughesc1e09172018-06-27 15:04:28 -0700111 required: [
112 "atrace",
113 "df",
114 "getprop",
115 "ip",
116 "iptables",
117 "ip6tables",
118 "kill",
119 "librank",
120 "logcat",
David Andersond9ba4752018-12-11 18:26:59 -0800121 "lpdump",
122 "lpdumpd",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700123 "lsmod",
124 "lsof",
125 "netstat",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700126 "printenv",
127 "procrank",
128 "screencap",
129 "showmap",
130 "ss",
131 "storaged",
132 "top",
133 "uptime",
134 "vdc",
135 "vril-dump",
136 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900137 init_rc: ["dumpstate.rc"],
138}
139
140cc_test {
141 name: "dumpstate_test",
142 defaults: ["dumpstate_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900143 srcs: [
Nandana Dutt3f8c7172018-09-25 12:01:54 +0100144 "dumpstate.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900145 "tests/dumpstate_test.cpp",
146 ],
147 static_libs: ["libgmock"],
Dan Shie177e8e2019-06-20 11:08:14 -0700148 test_config: "dumpstate_test.xml",
Abhijeet Kaurb7b67bc2019-07-08 15:52:20 +0100149 data: [
150 ":dumpstate_test_fixture",
151 "tests/testdata/**/*",
152 ],
153 test_suites: ["device-tests"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900154}
Vishnu Naire97d6122018-01-18 13:58:56 -0800155
156cc_test {
157 name: "dumpstate_smoke_test",
158 defaults: ["dumpstate_defaults"],
159 srcs: [
160 "dumpstate.cpp",
161 "tests/dumpstate_smoke_test.cpp",
162 ],
163 static_libs: ["libgmock"],
Kweku Adams5ce418d2018-02-05 16:43:53 -0800164}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800165
166
167// =======================#
168// dumpstate_test_fixture #
169// =======================#
170cc_test {
171
172 name: "dumpstate_test_fixture",
173 test_suites: ["device-tests"],
174 cflags: [
175 "-Wall",
176 "-Werror",
177 "-Wno-missing-field-initializers",
178 "-Wno-unused-variable",
179 "-Wunused-parameter",
180 ],
181 srcs: ["tests/dumpstate_test_fixture.cpp"],
182 data: ["tests/testdata/**/*"],
183}