blob: 1f055f3be7198963a3dd1174c4129aed8defc7e0 [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: [
Rhed Jao27077b12020-07-14 18:38:08 +0800108 "DumpPool.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900109 "dumpstate.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800110 "main.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900111 ],
Elliott Hughesc1e09172018-06-27 15:04:28 -0700112 required: [
113 "atrace",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700114 "ip",
115 "iptables",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700116 "librank",
117 "logcat",
David Andersond9ba4752018-12-11 18:26:59 -0800118 "lpdump",
119 "lpdumpd",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700120 "procrank",
121 "screencap",
122 "showmap",
123 "ss",
124 "storaged",
Yo Chiang1151baf2020-06-04 16:52:27 +0800125 "toolbox",
126 "toybox",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700127 "vdc",
Elliott Hughesc1e09172018-06-27 15:04:28 -0700128 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900129 init_rc: ["dumpstate.rc"],
130}
131
132cc_test {
133 name: "dumpstate_test",
134 defaults: ["dumpstate_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900135 srcs: [
Rhed Jao27077b12020-07-14 18:38:08 +0800136 "DumpPool.cpp",
Nandana Dutt3f8c7172018-09-25 12:01:54 +0100137 "dumpstate.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900138 "tests/dumpstate_test.cpp",
139 ],
140 static_libs: ["libgmock"],
Dan Shie177e8e2019-06-20 11:08:14 -0700141 test_config: "dumpstate_test.xml",
Abhijeet Kaurb7b67bc2019-07-08 15:52:20 +0100142 data: [
143 ":dumpstate_test_fixture",
144 "tests/testdata/**/*",
145 ],
146 test_suites: ["device-tests"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900147}
Vishnu Naire97d6122018-01-18 13:58:56 -0800148
149cc_test {
150 name: "dumpstate_smoke_test",
151 defaults: ["dumpstate_defaults"],
152 srcs: [
Rhed Jao27077b12020-07-14 18:38:08 +0800153 "DumpPool.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800154 "dumpstate.cpp",
155 "tests/dumpstate_smoke_test.cpp",
156 ],
157 static_libs: ["libgmock"],
Rhed Jaod180c4c2020-06-23 19:22:34 +0800158 test_config: "dumpstate_smoke_test.xml",
159 test_suites: ["device-tests"],
Kweku Adams5ce418d2018-02-05 16:43:53 -0800160}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800161
162
163// =======================#
164// dumpstate_test_fixture #
165// =======================#
166cc_test {
167
168 name: "dumpstate_test_fixture",
169 test_suites: ["device-tests"],
170 cflags: [
171 "-Wall",
172 "-Werror",
173 "-Wno-missing-field-initializers",
174 "-Wno-unused-variable",
175 "-Wunused-parameter",
176 ],
177 srcs: ["tests/dumpstate_test_fixture.cpp"],
178 data: ["tests/testdata/**/*"],
179}