blob: ba54d1343698a00b1256bc37281fb54a61a953f8 [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",
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",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700113 "ip",
114 "iptables",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700115 "librank",
116 "logcat",
David Andersond9ba4752018-12-11 18:26:59 -0800117 "lpdump",
118 "lpdumpd",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700119 "procrank",
120 "screencap",
121 "showmap",
122 "ss",
123 "storaged",
Yo Chiang1151baf2020-06-04 16:52:27 +0800124 "toolbox",
125 "toybox",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700126 "vdc",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700127 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900128 init_rc: ["dumpstate.rc"],
129}
130
131cc_test {
132 name: "dumpstate_test",
133 defaults: ["dumpstate_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900134 srcs: [
Nandana Dutt3f8c7172018-09-25 12:01:54 +0100135 "dumpstate.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900136 "tests/dumpstate_test.cpp",
137 ],
138 static_libs: ["libgmock"],
Dan Shie177e8e2019-06-20 11:08:14 -0700139 test_config: "dumpstate_test.xml",
Abhijeet Kaurb7b67bc2019-07-08 15:52:20 +0100140 data: [
141 ":dumpstate_test_fixture",
142 "tests/testdata/**/*",
143 ],
144 test_suites: ["device-tests"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900145}
Vishnu Naire97d6122018-01-18 13:58:56 -0800146
147cc_test {
148 name: "dumpstate_smoke_test",
149 defaults: ["dumpstate_defaults"],
150 srcs: [
151 "dumpstate.cpp",
152 "tests/dumpstate_smoke_test.cpp",
153 ],
154 static_libs: ["libgmock"],
Kweku Adams5ce418d2018-02-05 16:43:53 -0800155}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800156
157
158// =======================#
159// dumpstate_test_fixture #
160// =======================#
161cc_test {
162
163 name: "dumpstate_test_fixture",
164 test_suites: ["device-tests"],
165 cflags: [
166 "-Wall",
167 "-Werror",
168 "-Wno-missing-field-initializers",
169 "-Wno-unused-variable",
170 "-Wunused-parameter",
171 ],
172 srcs: ["tests/dumpstate_test_fixture.cpp"],
173 data: ["tests/testdata/**/*"],
174}