blob: 9aa10750e1e72abfd10e518d6736f3d99dc91b0a [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 "binder/android/os/DumpstateOptions.cpp",
61 ":dumpstate_aidl",
62 ],
63 export_include_dirs: ["binder"],
64}
65
66filegroup {
67 name: "dumpstate_aidl",
68 srcs: [
Jiyong Park522ae9a2017-06-23 21:23:16 +090069 "binder/android/os/IDumpstateListener.aidl",
70 "binder/android/os/IDumpstateToken.aidl",
Nandana Duttcccbb5f2018-09-27 09:23:36 +010071 //"binder/android/os/DumpstateOptions.aidl",
72 "binder/android/os/IDumpstate.aidl",
Jiyong Park522ae9a2017-06-23 21:23:16 +090073 ],
Nandana Duttcccbb5f2018-09-27 09:23:36 +010074 path: "binder",
Jiyong Park522ae9a2017-06-23 21:23:16 +090075}
76
Vishnu Naire97d6122018-01-18 13:58:56 -080077cc_defaults {
78 name: "dumpstate_defaults",
79 defaults: ["dumpstate_cflag_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +090080 shared_libs: [
81 "android.hardware.dumpstate@1.0",
82 "libziparchive",
83 "libbase",
84 "libbinder",
85 "libcrypto",
86 "libcutils",
87 "libdebuggerd_client",
88 "libdumpstateaidl",
89 "libdumpstateutil",
Kweku Adams5ce418d2018-02-05 16:43:53 -080090 "libdumputils",
Jiyong Park522ae9a2017-06-23 21:23:16 +090091 "libhidlbase",
92 "libhidltransport",
93 "liblog",
94 "libutils",
95 ],
96 srcs: [
Vishnu Nair20cf5032018-01-05 13:15:49 -080097 "DumpstateSectionReporter.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +090098 "DumpstateService.cpp",
99 "utils.cpp",
Vishnu Naire97d6122018-01-18 13:58:56 -0800100 ],
101 static_libs: [
102 "libdumpsys",
103 "libserviceutils"
104 ],
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",
127 "parse_radio_log",
128 "printenv",
129 "procrank",
130 "screencap",
131 "showmap",
132 "ss",
133 "storaged",
134 "top",
135 "uptime",
136 "vdc",
137 "vril-dump",
138 ],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900139 init_rc: ["dumpstate.rc"],
140}
141
142cc_test {
143 name: "dumpstate_test",
144 defaults: ["dumpstate_defaults"],
Jiyong Park522ae9a2017-06-23 21:23:16 +0900145 srcs: [
Nandana Dutt3f8c7172018-09-25 12:01:54 +0100146 "dumpstate.cpp",
Jiyong Park522ae9a2017-06-23 21:23:16 +0900147 "tests/dumpstate_test.cpp",
148 ],
149 static_libs: ["libgmock"],
150}
Vishnu Naire97d6122018-01-18 13:58:56 -0800151
152cc_test {
153 name: "dumpstate_smoke_test",
154 defaults: ["dumpstate_defaults"],
155 srcs: [
156 "dumpstate.cpp",
157 "tests/dumpstate_smoke_test.cpp",
158 ],
159 static_libs: ["libgmock"],
Kweku Adams5ce418d2018-02-05 16:43:53 -0800160}