|  | // | 
|  | // Copyright (C) 2017 The Android Open Source Project | 
|  | // | 
|  | // Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | // you may not use this file except in compliance with the License. | 
|  | // You may obtain a copy of the License at | 
|  | // | 
|  | //      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | // | 
|  | // Unless required by applicable law or agreed to in writing, software | 
|  | // distributed under the License is distributed on an "AS IS" BASIS, | 
|  | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | // See the License for the specific language governing permissions and | 
|  | // limitations under the License. | 
|  |  | 
|  | package { | 
|  | // See: http://go/android-license-faq | 
|  | // A large-scale-change added 'default_applicable_licenses' to import | 
|  | // all of the 'license_kinds' from "frameworks_native_license" | 
|  | // to get the below license kinds: | 
|  | //   SPDX-license-identifier-Apache-2.0 | 
|  | default_applicable_licenses: ["frameworks_native_license"], | 
|  | } | 
|  |  | 
|  | cc_defaults { | 
|  | name: "dumpstate_cflag_defaults", | 
|  | cflags: [ | 
|  | "-Wall", | 
|  | "-Werror", | 
|  | "-Wno-missing-field-initializers", | 
|  | "-Wno-unused-variable", | 
|  | "-Wunused-parameter", | 
|  | ], | 
|  | } | 
|  |  | 
|  | cc_library_shared { | 
|  | name: "libdumpstateutil", | 
|  | defaults: ["dumpstate_cflag_defaults"], | 
|  | vendor_available: true, | 
|  | vndk: { | 
|  | enabled: true, | 
|  | }, | 
|  | srcs: [ | 
|  | "DumpstateInternal.cpp", | 
|  | "DumpstateUtil.cpp", | 
|  | ], | 
|  | shared_libs: [ | 
|  | "libbase", | 
|  | "liblog", | 
|  | ], | 
|  | export_include_dirs: ["."], | 
|  | export_shared_lib_headers: [ | 
|  | "libbase", | 
|  | ], | 
|  | } | 
|  |  | 
|  | cc_library_shared { | 
|  | name: "libdumpstateaidl", | 
|  | defaults: ["dumpstate_cflag_defaults"], | 
|  | shared_libs: [ | 
|  | "libbinder", | 
|  | "libutils", | 
|  | ], | 
|  | aidl: { | 
|  | local_include_dirs: ["binder"], | 
|  | export_aidl_headers: true, | 
|  | }, | 
|  | srcs: [ | 
|  | ":dumpstate_aidl", | 
|  | ], | 
|  | export_include_dirs: ["binder"], | 
|  | } | 
|  |  | 
|  | filegroup { | 
|  | name: "dumpstate_aidl", | 
|  | srcs: [ | 
|  | "binder/android/os/IDumpstateListener.aidl", | 
|  | "binder/android/os/IDumpstate.aidl", | 
|  | ], | 
|  | path: "binder", | 
|  | } | 
|  |  | 
|  | cc_defaults { | 
|  | name: "dumpstate_defaults", | 
|  | defaults: ["dumpstate_cflag_defaults"], | 
|  | shared_libs: [ | 
|  | "android.hardware.dumpstate@1.0", | 
|  | "android.hardware.dumpstate@1.1", | 
|  | "libziparchive", | 
|  | "libbase", | 
|  | "libbinder", | 
|  | "libcrypto", | 
|  | "libcutils", | 
|  | "libdebuggerd_client", | 
|  | "libdumpstateaidl", | 
|  | "libdumpstateutil", | 
|  | "libdumputils", | 
|  | "libhardware_legacy", | 
|  | "libhidlbase", | 
|  | "liblog", | 
|  | "libutils", | 
|  | "libbinderdebug", | 
|  | ], | 
|  | srcs: [ | 
|  | "DumpstateService.cpp", | 
|  | ], | 
|  | static_libs: [ | 
|  | "libincidentcompanion", | 
|  | "libdumpsys", | 
|  | "libserviceutils", | 
|  | ], | 
|  | } | 
|  |  | 
|  | cc_binary { | 
|  | name: "dumpstate", | 
|  | defaults: ["dumpstate_defaults"], | 
|  | srcs: [ | 
|  | "DumpPool.cpp", | 
|  | "TaskQueue.cpp", | 
|  | "dumpstate.cpp", | 
|  | "main.cpp", | 
|  | ], | 
|  | required: [ | 
|  | "atrace", | 
|  | "dmabuf_dump", | 
|  | "ip", | 
|  | "iptables", | 
|  | "librank", | 
|  | "logcat", | 
|  | "lpdump", | 
|  | "lpdumpd", | 
|  | "procrank", | 
|  | "screencap", | 
|  | "showmap", | 
|  | "ss", | 
|  | "storaged", | 
|  | "toolbox", | 
|  | "toybox", | 
|  | "vdc", | 
|  | ], | 
|  | init_rc: ["dumpstate.rc"], | 
|  | } | 
|  |  | 
|  | cc_test { | 
|  | name: "dumpstate_test", | 
|  | defaults: ["dumpstate_defaults"], | 
|  | srcs: [ | 
|  | "DumpPool.cpp", | 
|  | "TaskQueue.cpp", | 
|  | "dumpstate.cpp", | 
|  | "tests/dumpstate_test.cpp", | 
|  | ], | 
|  | static_libs: ["libgmock"], | 
|  | test_config: "dumpstate_test.xml", | 
|  | data: [ | 
|  | ":dumpstate_test_fixture", | 
|  | "tests/testdata/**/*", | 
|  | ], | 
|  | test_suites: ["device-tests"], | 
|  | } | 
|  |  | 
|  | cc_test { | 
|  | name: "dumpstate_smoke_test", | 
|  | defaults: ["dumpstate_defaults"], | 
|  | srcs: [ | 
|  | "DumpPool.cpp", | 
|  | "TaskQueue.cpp", | 
|  | "dumpstate.cpp", | 
|  | "tests/dumpstate_smoke_test.cpp", | 
|  | ], | 
|  | static_libs: ["libgmock"], | 
|  | test_config: "dumpstate_smoke_test.xml", | 
|  | test_suites: ["device-tests"], | 
|  | } | 
|  |  | 
|  |  | 
|  | // =======================# | 
|  | // dumpstate_test_fixture # | 
|  | // =======================# | 
|  | cc_test { | 
|  |  | 
|  | name: "dumpstate_test_fixture", | 
|  | test_suites: ["device-tests"], | 
|  | cflags: [ | 
|  | "-Wall", | 
|  | "-Werror", | 
|  | "-Wno-missing-field-initializers", | 
|  | "-Wno-unused-variable", | 
|  | "-Wunused-parameter", | 
|  | ], | 
|  | srcs: ["tests/dumpstate_test_fixture.cpp"], | 
|  | data: ["tests/testdata/**/*"], | 
|  | } |