blob: be7e3e1a7319cdcb63355952dda2931edeae4540 [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",
79 "libziparchive",
80 "libbase",
81 "libbinder",
82 "libcrypto",
83 "libcutils",
84 "libdebuggerd_client",
85 "libdumpstateaidl",
86 "libdumpstateutil",
Kweku Adams5ce418d2018-02-05 16:43:53 -080087 "libdumputils",
Sahana Raof35ed432019-07-12 10:47:52 +010088 "libhardware_legacy",
Jiyong Park522ae9a2017-06-23 21:23:16 +090089 "libhidlbase",
Jiyong Park522ae9a2017-06-23 21:23:16 +090090 "liblog",
91 "libutils",
92 ],
93 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +090094 "DumpstateService.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -080095 ],
96 static_libs: [
Joe Onorato2927da92018-12-11 14:24:49 -080097 "libincidentcompanion",
Vishnu Naire97d6122018-01-18 13:58:56 -080098 "libdumpsys",
Joe Onorato2927da92018-12-11 14:24:49 -080099 "libserviceutils",
Vishnu Naire97d6122018-01-18 13:58:56 -0800100 ],
101}
102
103cc_binary {
104 name: "dumpstate",
105 defaults: ["dumpstate_defaults"],
106 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +0900107 "dumpstate.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800108 "main.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900109 ],
Elliott Hughesc1e09172018-06-27 15:04:28 -0700110 required: [
111 "atrace",
112 "df",
113 "getprop",
114 "ip",
115 "iptables",
116 "ip6tables",
117 "kill",
118 "librank",
119 "logcat",
David Andersond9ba4752018-12-11 18:26:59 -0800120 "lpdump",
121 "lpdumpd",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700122 "lsmod",
123 "lsof",
124 "netstat",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700125 "printenv",
126 "procrank",
127 "screencap",
128 "showmap",
129 "ss",
130 "storaged",
131 "top",
132 "uptime",
133 "vdc",
134 "vril-dump",
135 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900136 init_rc: ["dumpstate.rc"],
137}
138
139cc_test {
140 name: "dumpstate_test",
141 defaults: ["dumpstate_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900142 srcs: [
Nandana Dutt3f8c7172018-09-25 12:01:54 +0100143 "dumpstate.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900144 "tests/dumpstate_test.cpp",
145 ],
146 static_libs: ["libgmock"],
Dan Shie177e8e2019-06-20 11:08:14 -0700147 test_config: "dumpstate_test.xml",
Abhijeet Kaurb7b67bc2019-07-08 15:52:20 +0100148 data: [
149 ":dumpstate_test_fixture",
150 "tests/testdata/**/*",
151 ],
152 test_suites: ["device-tests"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900153}
Vishnu Naire97d6122018-01-18 13:58:56 -0800154
155cc_test {
156 name: "dumpstate_smoke_test",
157 defaults: ["dumpstate_defaults"],
158 srcs: [
159 "dumpstate.cpp",
160 "tests/dumpstate_smoke_test.cpp",
161 ],
162 static_libs: ["libgmock"],
Kweku Adams5ce418d2018-02-05 16:43:53 -0800163}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800164
165
166// =======================#
167// dumpstate_test_fixture #
168// =======================#
169cc_test {
170
171 name: "dumpstate_test_fixture",
172 test_suites: ["device-tests"],
173 cflags: [
174 "-Wall",
175 "-Werror",
176 "-Wno-missing-field-initializers",
177 "-Wno-unused-variable",
178 "-Wunused-parameter",
179 ],
180 srcs: ["tests/dumpstate_test_fixture.cpp"],
181 data: ["tests/testdata/**/*"],
182}