Home | History | Annotate | Download | only in dumpstate
      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 
     16 cc_defaults {
     17     name: "dumpstate_cflag_defaults",
     18     cflags: [
     19         "-Wall",
     20         "-Werror",
     21         "-Wno-missing-field-initializers",
     22         "-Wno-unused-variable",
     23         "-Wunused-parameter",
     24     ],
     25 }
     26 
     27 cc_library_shared {
     28     name: "libdumpstateutil",
     29     defaults: ["dumpstate_cflag_defaults"],
     30     vendor_available: true,
     31     vndk: {
     32         enabled: true,
     33     },
     34     srcs: [
     35         "DumpstateInternal.cpp",
     36         "DumpstateUtil.cpp",
     37     ],
     38     shared_libs: [
     39         "libbase",
     40         "liblog",
     41     ],
     42     export_include_dirs: ["."],
     43     export_shared_lib_headers: [
     44         "libbase",
     45     ],
     46 }
     47 
     48 cc_library_shared {
     49     name: "libdumpstateaidl",
     50     defaults: ["dumpstate_cflag_defaults"],
     51     shared_libs: [
     52         "libbinder",
     53         "libutils",
     54     ],
     55     aidl: {
     56         local_include_dirs: ["binder"],
     57         export_aidl_headers: true,
     58     },
     59     srcs: [
     60         ":dumpstate_aidl",
     61     ],
     62     export_include_dirs: ["binder"],
     63 }
     64 
     65 filegroup {
     66     name: "dumpstate_aidl",
     67     srcs: [
     68         "binder/android/os/IDumpstateListener.aidl",
     69         "binder/android/os/IDumpstateToken.aidl",
     70         "binder/android/os/IDumpstate.aidl",
     71     ],
     72     path: "binder",
     73 }
     74 
     75 cc_defaults {
     76     name: "dumpstate_defaults",
     77     defaults: ["dumpstate_cflag_defaults"],
     78     shared_libs: [
     79         "android.hardware.dumpstate (a] 1.0",
     80         "libziparchive",
     81         "libbase",
     82         "libbinder",
     83         "libcrypto",
     84         "libcutils",
     85         "libdebuggerd_client",
     86         "libdumpstateaidl",
     87         "libdumpstateutil",
     88         "libdumputils",
     89         "libhidlbase",
     90         "libhidltransport",
     91         "liblog",
     92         "libutils",
     93     ],
     94     srcs: [
     95         "DumpstateSectionReporter.cpp",
     96         "DumpstateService.cpp",
     97         "utils.cpp",
     98     ],
     99     static_libs: [
    100         "libincidentcompanion",
    101         "libdumpsys",
    102         "libserviceutils",
    103     ],
    104 }
    105 
    106 cc_binary {
    107     name: "dumpstate",
    108     defaults: ["dumpstate_defaults"],
    109     srcs: [
    110         "dumpstate.cpp",
    111         "main.cpp",
    112     ],
    113     required: [
    114         "atrace",
    115         "df",
    116         "getprop",
    117         "ip",
    118         "iptables",
    119         "ip6tables",
    120         "kill",
    121         "librank",
    122         "logcat",
    123         "lsmod",
    124         "lsof",
    125         "netstat",
    126         "parse_radio_log",
    127         "printenv",
    128         "procrank",
    129         "screencap",
    130         "showmap",
    131         "ss",
    132         "storaged",
    133         "top",
    134         "uptime",
    135         "vdc",
    136         "vril-dump",
    137     ],
    138     init_rc: ["dumpstate.rc"],
    139 }
    140 
    141 cc_test {
    142     name: "dumpstate_test",
    143     defaults: ["dumpstate_defaults"],
    144     srcs: [
    145         "dumpstate.cpp",
    146         "tests/dumpstate_test.cpp",
    147     ],
    148     static_libs: ["libgmock"],
    149 }
    150 
    151 cc_test {
    152     name: "dumpstate_smoke_test",
    153     defaults: ["dumpstate_defaults"],
    154     srcs: [
    155         "dumpstate.cpp",
    156         "tests/dumpstate_smoke_test.cpp",
    157     ],
    158     static_libs: ["libgmock"],
    159 }
    160 
    161 
    162 // =======================#
    163 // dumpstate_test_fixture #
    164 // =======================#
    165 cc_test {
    166 
    167     name: "dumpstate_test_fixture",
    168     test_suites: ["device-tests"],
    169     cflags: [
    170         "-Wall",
    171         "-Werror",
    172         "-Wno-missing-field-initializers",
    173         "-Wno-unused-variable",
    174         "-Wunused-parameter",
    175     ],
    176     srcs: ["tests/dumpstate_test_fixture.cpp"],
    177     data: ["tests/testdata/**/*"],
    178 }
    179