blob: 6cf2ea75498b0802a0e8bba8413cb417e59a98b5 [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",
69 "binder/android/os/IDumpstateToken.aidl",
Nandana Duttcccbb5f2018-09-27 09:23:36 +010070 "binder/android/os/IDumpstate.aidl",
Jiyong Park522ae9a2017-06-23 21:23:16 +090071 ],
Nandana Duttcccbb5f2018-09-27 09:23:36 +010072 path: "binder",
Jiyong Park522ae9a2017-06-23 21:23:16 +090073}
74
Vishnu Naire97d6122018-01-18 13:58:56 -080075cc_defaults {
76 name: "dumpstate_defaults",
77 defaults: ["dumpstate_cflag_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +090078 shared_libs: [
79 "android.hardware.dumpstate@1.0",
80 "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",
91 "libhidltransport",
92 "liblog",
93 "libutils",
94 ],
95 srcs: [
Vishnu Nair20cf5032018-01-05 13:15:49 -080096 "DumpstateSectionReporter.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +090097 "DumpstateService.cpp",
98 "utils.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -080099 ],
100 static_libs: [
Joe Onorato2927da92018-12-11 14:24:49 -0800101 "libincidentcompanion",
Vishnu Naire97d6122018-01-18 13:58:56 -0800102 "libdumpsys",
Joe Onorato2927da92018-12-11 14:24:49 -0800103 "libserviceutils",
Vishnu Naire97d6122018-01-18 13:58:56 -0800104 ],
105}
106
107cc_binary {
108 name: "dumpstate",
109 defaults: ["dumpstate_defaults"],
110 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +0900111 "dumpstate.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800112 "main.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900113 ],
Elliott Hughesc1e09172018-06-27 15:04:28 -0700114 required: [
115 "atrace",
116 "df",
117 "getprop",
118 "ip",
119 "iptables",
120 "ip6tables",
121 "kill",
122 "librank",
123 "logcat",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700124 "lsmod",
125 "lsof",
126 "netstat",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700127 "printenv",
128 "procrank",
129 "screencap",
130 "showmap",
131 "ss",
132 "storaged",
133 "top",
134 "uptime",
135 "vdc",
136 "vril-dump",
137 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900138 init_rc: ["dumpstate.rc"],
139}
140
141cc_test {
142 name: "dumpstate_test",
143 defaults: ["dumpstate_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900144 srcs: [
Nandana Dutt3f8c7172018-09-25 12:01:54 +0100145 "dumpstate.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900146 "tests/dumpstate_test.cpp",
147 ],
148 static_libs: ["libgmock"],
Dan Shie177e8e2019-06-20 11:08:14 -0700149 test_config: "dumpstate_test.xml",
150 data: [":dumpstate_test_fixture", "tests/testdata/**/*"]
Jiyong Park522ae9a2017-06-23 21:23:16 +0900151}
Vishnu Naire97d6122018-01-18 13:58:56 -0800152
153cc_test {
154 name: "dumpstate_smoke_test",
155 defaults: ["dumpstate_defaults"],
156 srcs: [
157 "dumpstate.cpp",
158 "tests/dumpstate_smoke_test.cpp",
159 ],
160 static_libs: ["libgmock"],
Kweku Adams5ce418d2018-02-05 16:43:53 -0800161}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800162
163
164// =======================#
165// dumpstate_test_fixture #
166// =======================#
167cc_test {
168
169 name: "dumpstate_test_fixture",
170 test_suites: ["device-tests"],
171 cflags: [
172 "-Wall",
173 "-Werror",
174 "-Wno-missing-field-initializers",
175 "-Wno-unused-variable",
176 "-Wunused-parameter",
177 ],
178 srcs: ["tests/dumpstate_test_fixture.cpp"],
179 data: ["tests/testdata/**/*"],
180}