Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 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 | |
| 17 | cc_defaults { |
| 18 | name: "storaged_defaults", |
| 19 | |
| 20 | shared_libs: [ |
Yifan Hong | bf2dcb2 | 2017-09-27 14:01:30 -0700 | [diff] [blame] | 21 | "android.hardware.health@1.0", |
| 22 | "android.hardware.health@2.0", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 23 | "libbase", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 24 | "libbinder", |
| 25 | "libcutils", |
Yifan Hong | bf2dcb2 | 2017-09-27 14:01:30 -0700 | [diff] [blame] | 26 | "libhidlbase", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 27 | "liblog", |
Jin Qian | ebf031b | 2017-08-14 16:41:24 -0700 | [diff] [blame] | 28 | "libprotobuf-cpp-lite", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 29 | "libsysutils", |
| 30 | "libutils", |
Jin Qian | ebf031b | 2017-08-14 16:41:24 -0700 | [diff] [blame] | 31 | "libz", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 32 | ], |
| 33 | |
| 34 | cflags: [ |
| 35 | "-Wall", |
| 36 | "-Werror", |
| 37 | "-Wextra", |
| 38 | "-Wno-unused-parameter" |
| 39 | ], |
| 40 | } |
| 41 | |
| 42 | cc_library_static { |
| 43 | name: "libstoraged", |
| 44 | |
| 45 | defaults: ["storaged_defaults"], |
| 46 | |
Jin Qian | b049d18 | 2017-10-12 17:02:17 -0700 | [diff] [blame] | 47 | aidl: { |
| 48 | export_aidl_headers: true, |
| 49 | local_include_dirs: ["binder"], |
| 50 | include_dirs: ["frameworks/native/aidl/binder"], |
| 51 | }, |
| 52 | |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 53 | srcs: [ |
| 54 | "storaged.cpp", |
Jin Qian | 65dea71 | 2017-08-29 16:48:20 -0700 | [diff] [blame] | 55 | "storaged_diskstats.cpp", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 56 | "storaged_info.cpp", |
| 57 | "storaged_service.cpp", |
| 58 | "storaged_utils.cpp", |
| 59 | "storaged_uid_monitor.cpp", |
Jin Qian | b049d18 | 2017-10-12 17:02:17 -0700 | [diff] [blame] | 60 | "uid_info.cpp", |
Jin Qian | ebf031b | 2017-08-14 16:41:24 -0700 | [diff] [blame] | 61 | "storaged.proto", |
Colin Cross | c2a3a20 | 2017-11-25 08:46:56 -0800 | [diff] [blame] | 62 | ":storaged_aidl", |
Dan Willemsen | c53f5c1 | 2018-09-14 21:27:31 -0700 | [diff] [blame] | 63 | ":storaged_aidl_private", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 64 | ], |
| 65 | |
Yifan Hong | 70c44e7 | 2018-01-16 17:50:58 -0800 | [diff] [blame] | 66 | static_libs: ["libhealthhalutils"], |
Yifan Hong | acd2d30 | 2018-05-04 14:20:34 -0700 | [diff] [blame] | 67 | header_libs: ["libbatteryservice_headers"], |
Yifan Hong | 70c44e7 | 2018-01-16 17:50:58 -0800 | [diff] [blame] | 68 | |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 69 | logtags: ["EventLogTags.logtags"], |
| 70 | |
Jin Qian | ebf031b | 2017-08-14 16:41:24 -0700 | [diff] [blame] | 71 | proto: { |
| 72 | type: "lite", |
| 73 | export_proto_headers: true, |
| 74 | }, |
| 75 | |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 76 | export_include_dirs: ["include"], |
| 77 | } |
| 78 | |
| 79 | cc_binary { |
| 80 | name: "storaged", |
| 81 | |
| 82 | defaults: ["storaged_defaults"], |
| 83 | |
| 84 | init_rc: ["storaged.rc"], |
| 85 | |
| 86 | srcs: ["main.cpp"], |
| 87 | |
Yifan Hong | 70c44e7 | 2018-01-16 17:50:58 -0800 | [diff] [blame] | 88 | static_libs: [ |
| 89 | "libhealthhalutils", |
| 90 | "libstoraged", |
| 91 | ], |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | /* |
| 95 | * Run with: |
| 96 | * adb shell /data/nativetest/storaged-unit-tests/storaged-unit-tests |
| 97 | */ |
| 98 | cc_test { |
| 99 | name: "storaged-unit-tests", |
| 100 | |
| 101 | defaults: ["storaged_defaults"], |
| 102 | |
| 103 | srcs: ["tests/storaged_test.cpp"], |
| 104 | |
Yifan Hong | c4b46e0 | 2018-01-16 15:49:08 -0800 | [diff] [blame] | 105 | static_libs: [ |
| 106 | "libhealthhalutils", |
| 107 | "libstoraged", |
| 108 | ], |
Yifan Hong | bf2dcb2 | 2017-09-27 14:01:30 -0700 | [diff] [blame] | 109 | } |
Colin Cross | c2a3a20 | 2017-11-25 08:46:56 -0800 | [diff] [blame] | 110 | |
| 111 | // AIDL interface between storaged and framework.jar |
| 112 | filegroup { |
| 113 | name: "storaged_aidl", |
| 114 | srcs: [ |
| 115 | "binder/android/os/IStoraged.aidl", |
| 116 | ], |
Dan Willemsen | c53f5c1 | 2018-09-14 21:27:31 -0700 | [diff] [blame] | 117 | path: "binder", |
| 118 | } |
| 119 | |
| 120 | filegroup { |
| 121 | name: "storaged_aidl_private", |
| 122 | srcs: [ |
| 123 | "binder/android/os/storaged/IStoragedPrivate.aidl", |
| 124 | ], |
| 125 | path: "binder", |
Colin Cross | c2a3a20 | 2017-11-25 08:46:56 -0800 | [diff] [blame] | 126 | } |