• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
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
16package {
17    // See: http://go/android-license-faq
18    // A large-scale-change added 'default_applicable_licenses' to import
19    // all of the 'license_kinds' from "frameworks_native_license"
20    // to get the below license kinds:
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["frameworks_native_license"],
23}
24
25cc_defaults {
26    name: "dumpstate_cflag_defaults",
27    cflags: [
28        "-Wall",
29        "-Werror",
30        "-Wno-missing-field-initializers",
31        "-Wno-unused-variable",
32        "-Wunused-parameter",
33    ],
34}
35
36cc_library_shared {
37    name: "libdumpstateutil",
38    defaults: ["dumpstate_cflag_defaults"],
39    vendor_available: true,
40    vndk: {
41        enabled: true,
42    },
43    srcs: [
44        "DumpstateInternal.cpp",
45        "DumpstateUtil.cpp",
46    ],
47    shared_libs: [
48        "libbase",
49        "liblog",
50    ],
51    export_include_dirs: ["."],
52    export_shared_lib_headers: [
53        "libbase",
54    ],
55}
56
57cc_library_shared {
58    name: "libdumpstateaidl",
59    defaults: ["dumpstate_cflag_defaults"],
60    shared_libs: [
61        "libbinder",
62        "libutils",
63    ],
64    aidl: {
65        local_include_dirs: ["binder"],
66        export_aidl_headers: true,
67    },
68    srcs: [
69        ":dumpstate_aidl",
70    ],
71    export_include_dirs: ["binder"],
72}
73
74filegroup {
75    name: "dumpstate_aidl",
76    srcs: [
77        "binder/android/os/IDumpstateListener.aidl",
78        "binder/android/os/IDumpstate.aidl",
79    ],
80    path: "binder",
81}
82
83cc_defaults {
84    name: "dumpstate_defaults",
85    defaults: ["dumpstate_cflag_defaults"],
86    shared_libs: [
87        "android.hardware.dumpstate@1.0",
88        "android.hardware.dumpstate@1.1",
89        "android.hardware.dumpstate-V1-ndk",
90        "libziparchive",
91        "libbase",
92        "libbinder",
93        "libbinder_ndk",
94        "libcrypto",
95        "libcutils",
96        "libdebuggerd_client",
97        "libdumpstateaidl",
98        "libdumpstateutil",
99        "libdumputils",
100        "libhardware_legacy",
101        "libhidlbase",
102        "liblog",
103        "libutils",
104        "libvintf",
105        "libbinderdebug",
106        "packagemanager_aidl-cpp",
107    ],
108    srcs: [
109        "DumpstateService.cpp",
110    ],
111    static_libs: [
112        "libincidentcompanion",
113        "libdumpsys",
114        "libserviceutils",
115    ],
116}
117
118cc_binary {
119    name: "dumpstate",
120    defaults: ["dumpstate_defaults"],
121    srcs: [
122        "DumpPool.cpp",
123        "TaskQueue.cpp",
124        "dumpstate.cpp",
125        "main.cpp",
126    ],
127    required: [
128        "atrace",
129        "bugreport_procdump",
130        "dmabuf_dump",
131        "ip",
132        "iptables",
133        "librank",
134        "logcat",
135        "lpdump",
136        "lpdumpd",
137        "procrank",
138        "screencap",
139        "showmap",
140        "ss",
141        "storaged",
142        "toolbox",
143        "toybox",
144        "vdc",
145    ],
146    init_rc: ["dumpstate.rc"],
147}
148
149cc_test {
150    name: "dumpstate_test",
151    defaults: ["dumpstate_defaults"],
152    srcs: [
153        "DumpPool.cpp",
154        "TaskQueue.cpp",
155        "dumpstate.cpp",
156        "tests/dumpstate_test.cpp",
157    ],
158    static_libs: [
159        "libc++fs",
160        "libgmock",
161    ],
162    test_config: "dumpstate_test.xml",
163    data: [
164        ":dumpstate_test_fixture",
165        "tests/testdata/**/*",
166    ],
167    test_suites: ["device-tests"],
168}
169
170cc_test {
171    name: "dumpstate_smoke_test",
172    defaults: ["dumpstate_defaults"],
173    srcs: [
174        "DumpPool.cpp",
175        "TaskQueue.cpp",
176        "dumpstate.cpp",
177        "tests/dumpstate_smoke_test.cpp",
178    ],
179    static_libs: ["libgmock"],
180    test_config: "dumpstate_smoke_test.xml",
181    test_suites: ["device-tests"],
182}
183
184// =======================#
185// dumpstate_test_fixture #
186// =======================#
187cc_test {
188
189    name: "dumpstate_test_fixture",
190    test_suites: ["device-tests"],
191    cflags: [
192        "-Wall",
193        "-Werror",
194        "-Wno-missing-field-initializers",
195        "-Wno-unused-variable",
196        "-Wunused-parameter",
197    ],
198    srcs: ["tests/dumpstate_test_fixture.cpp"],
199    data: ["tests/testdata/**/*"],
200}
201