Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "installd_defaults", |
| 3 | |
| 4 | cflags: [ |
| 5 | "-Wall", |
| 6 | "-Werror", |
Jeff Sharkey | c1149c9 | 2017-09-21 14:51:09 -0600 | [diff] [blame] | 7 | "-Wextra", |
Andreas Gampe | fa2dadd | 2018-02-28 19:52:47 -0800 | [diff] [blame] | 8 | |
| 9 | "-Wunreachable-code", |
| 10 | "-Wunreachable-code-break", |
| 11 | "-Wunreachable-code-return", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 12 | ], |
| 13 | srcs: [ |
Jeff Sharkey | 88ddd94 | 2017-01-17 18:05:54 -0700 | [diff] [blame] | 14 | "CacheItem.cpp", |
| 15 | "CacheTracker.cpp", |
Jeff Sharkey | f3e30b9 | 2016-12-09 17:06:57 -0700 | [diff] [blame] | 16 | "InstalldNativeService.cpp", |
Risan | 5f30826 | 2018-10-26 12:06:58 -0600 | [diff] [blame] | 17 | "QuotaUtils.cpp", |
Jeff Sharkey | 6c2c056 | 2016-12-07 12:12:00 -0700 | [diff] [blame] | 18 | "dexopt.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 19 | "execv_helper.cpp", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 20 | "globals.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 21 | "run_dex2oat.cpp", |
Victor Hsieh | cb35a06 | 2020-08-13 16:11:13 -0700 | [diff] [blame^] | 22 | "unique_file.cpp", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 23 | "utils.cpp", |
Oleksandr Peletskyi | d2be632 | 2019-01-24 17:59:45 +0100 | [diff] [blame] | 24 | "utils_default.cpp", |
Eric Holk | 0ebbe0f | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 25 | "view_compiler.cpp", |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 26 | ":installd_aidl", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 27 | ], |
Andreas Gampe | fa2dadd | 2018-02-28 19:52:47 -0800 | [diff] [blame] | 28 | header_libs: [ |
| 29 | "dex2oat_headers", |
| 30 | ], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 31 | shared_libs: [ |
| 32 | "libbase", |
| 33 | "libbinder", |
Alan Stokes | a25d90c | 2017-10-16 10:56:00 +0100 | [diff] [blame] | 34 | "libcrypto", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 35 | "libcutils", |
| 36 | "liblog", |
| 37 | "liblogwrap", |
Suren Baghdasaryan | cd82905 | 2018-11-02 19:15:37 -0700 | [diff] [blame] | 38 | "libprocessgroup", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 39 | "libselinux", |
| 40 | "libutils", |
Nicolas Geoffray | aaad21e | 2019-02-25 13:31:10 +0000 | [diff] [blame] | 41 | "server_configurable_flags", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 42 | ], |
| 43 | |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 44 | product_variables: { |
| 45 | arc: { |
| 46 | exclude_srcs: [ |
| 47 | "QuotaUtils.cpp", |
| 48 | ], |
| 49 | static_libs: [ |
| 50 | "libarcdiskquota", |
| 51 | "arc_services_aidl", |
| 52 | ], |
| 53 | cflags: [ |
| 54 | "-DUSE_ARC", |
| 55 | ], |
| 56 | }, |
| 57 | }, |
| 58 | |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 59 | clang: true, |
Jeff Sharkey | c1149c9 | 2017-09-21 14:51:09 -0600 | [diff] [blame] | 60 | |
| 61 | tidy: true, |
| 62 | tidy_checks: [ |
| 63 | "-*", |
| 64 | "clang-analyzer-security*", |
| 65 | "cert-*", |
| 66 | "-cert-err58-cpp", |
| 67 | ], |
| 68 | tidy_flags: [ |
| 69 | "-warnings-as-errors=clang-analyzer-security*,cert-*" |
| 70 | ], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | // |
| 74 | // Static library used in testing and executable |
| 75 | // |
| 76 | |
| 77 | cc_library_static { |
| 78 | name: "libinstalld", |
| 79 | defaults: ["installd_defaults"], |
| 80 | |
| 81 | export_include_dirs: ["."], |
| 82 | aidl: { |
| 83 | export_aidl_headers: true, |
| 84 | }, |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 85 | |
| 86 | product_variables: { |
| 87 | arc: { |
| 88 | exclude_srcs: [ |
| 89 | "QuotaUtils.cpp", |
| 90 | ], |
| 91 | static_libs: [ |
| 92 | "libarcdiskquota", |
| 93 | "arc_services_aidl", |
| 94 | ], |
| 95 | cflags: [ |
| 96 | "-DUSE_ARC", |
| 97 | ], |
| 98 | }, |
| 99 | }, |
| 100 | } |
| 101 | |
| 102 | cc_library_headers { |
| 103 | name: "libinstalld_headers", |
| 104 | export_include_dirs: ["."], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | // |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 108 | // Unit tests |
| 109 | // |
| 110 | |
| 111 | cc_test_host { |
| 112 | name: "run_dex2oat_test", |
| 113 | test_suites: ["general-tests"], |
| 114 | clang: true, |
| 115 | srcs: [ |
| 116 | "run_dex2oat_test.cpp", |
| 117 | "run_dex2oat.cpp", |
Victor Hsieh | cb35a06 | 2020-08-13 16:11:13 -0700 | [diff] [blame^] | 118 | "unique_file.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 119 | "execv_helper.cpp", |
| 120 | ], |
| 121 | cflags: ["-Wall", "-Werror"], |
| 122 | shared_libs: [ |
| 123 | "libbase", |
| 124 | "server_configurable_flags", |
| 125 | ], |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 126 | test_config: "run_dex2oat_test.xml", |
| 127 | } |
| 128 | |
| 129 | // |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 130 | // Executable |
| 131 | // |
| 132 | |
| 133 | cc_binary { |
| 134 | name: "installd", |
| 135 | defaults: ["installd_defaults"], |
| 136 | srcs: ["installd.cpp"], |
| 137 | |
| 138 | static_libs: ["libdiskusage"], |
| 139 | |
| 140 | init_rc: ["installd.rc"], |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 141 | |
| 142 | product_variables: { |
| 143 | arc: { |
| 144 | exclude_srcs: [ |
| 145 | "QuotaUtils.cpp", |
| 146 | ], |
| 147 | static_libs: [ |
| 148 | "libarcdiskquota", |
| 149 | "arc_services_aidl", |
| 150 | ], |
| 151 | cflags: [ |
| 152 | "-DUSE_ARC", |
| 153 | ], |
| 154 | }, |
| 155 | }, |
Narayan Kamath | 28ab93b | 2019-05-15 18:29:44 +0100 | [diff] [blame] | 156 | |
| 157 | // Needs to be wherever installd is as it's execed by |
| 158 | // installd. |
| 159 | required: [ "migrate_legacy_obb_data.sh" ], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 160 | } |
| 161 | |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 162 | // OTA chroot tool |
| 163 | |
| 164 | cc_binary { |
| 165 | name: "otapreopt_chroot", |
Martijn Coenen | 8af07d9 | 2019-07-03 14:56:39 +0200 | [diff] [blame] | 166 | defaults: ["libapexd-deps"], |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 167 | cflags: [ |
| 168 | "-Wall", |
| 169 | "-Werror", |
| 170 | ], |
| 171 | clang: true, |
| 172 | |
Roland Levillain | 94b4180 | 2019-01-18 11:56:50 +0000 | [diff] [blame] | 173 | srcs: [ |
| 174 | "otapreopt_chroot.cpp", |
| 175 | "otapreopt_utils.cpp", |
| 176 | ], |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 177 | shared_libs: [ |
| 178 | "libbase", |
| 179 | "liblog", |
Martijn Coenen | 13eba26 | 2019-03-13 12:59:57 +0100 | [diff] [blame] | 180 | "libutils", |
Roland Levillain | c19c604 | 2018-12-18 12:15:12 +0000 | [diff] [blame] | 181 | ], |
| 182 | static_libs: [ |
Roland Levillain | c19c604 | 2018-12-18 12:15:12 +0000 | [diff] [blame] | 183 | "libapexd", |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 184 | ], |
| 185 | } |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 186 | |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 187 | filegroup { |
| 188 | name: "installd_aidl", |
| 189 | srcs: [ |
| 190 | "binder/android/os/IInstalld.aidl", |
| 191 | ], |
Dan Willemsen | a5d6522 | 2018-09-14 21:27:01 -0700 | [diff] [blame] | 192 | path: "binder", |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 193 | } |
| 194 | |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 195 | // |
| 196 | // Static library for otapreopt used in testing |
| 197 | // |
| 198 | cc_library_static { |
| 199 | name: "libotapreoptparameters", |
| 200 | cflags: [ |
| 201 | "-Wall", |
| 202 | "-Werror" |
| 203 | ], |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 204 | |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 205 | srcs: ["otapreopt_parameters.cpp"], |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 206 | |
| 207 | export_include_dirs: ["."], |
| 208 | |
| 209 | shared_libs: [ |
| 210 | "libbase", |
| 211 | "libcutils", |
| 212 | "liblog", |
Suren Baghdasaryan | cd82905 | 2018-11-02 19:15:37 -0700 | [diff] [blame] | 213 | "libprocessgroup", |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 214 | "libutils", |
| 215 | ], |
| 216 | } |
| 217 | |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 218 | // |
| 219 | // OTA Executable |
| 220 | // |
| 221 | |
| 222 | cc_binary { |
| 223 | name: "otapreopt", |
| 224 | cflags: [ |
| 225 | "-Wall", |
| 226 | "-Werror" |
| 227 | ], |
| 228 | |
| 229 | srcs: [ |
| 230 | "dexopt.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 231 | "execv_helper.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 232 | "globals.cpp", |
| 233 | "otapreopt.cpp", |
Roland Levillain | 94b4180 | 2019-01-18 11:56:50 +0000 | [diff] [blame] | 234 | "otapreopt_utils.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 235 | "run_dex2oat.cpp", |
Victor Hsieh | cb35a06 | 2020-08-13 16:11:13 -0700 | [diff] [blame^] | 236 | "unique_file.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 237 | "utils.cpp", |
Oleksandr Peletskyi | d2be632 | 2019-01-24 17:59:45 +0100 | [diff] [blame] | 238 | "utils_default.cpp", |
Eric Holk | 0ebbe0f | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 239 | "view_compiler.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 240 | ], |
| 241 | |
| 242 | header_libs: ["dex2oat_headers"], |
| 243 | |
| 244 | static_libs: [ |
| 245 | "libartimagevalues", |
| 246 | "libdiskusage", |
| 247 | "libotapreoptparameters", |
| 248 | ], |
| 249 | |
| 250 | shared_libs: [ |
| 251 | "libbase", |
| 252 | "libcrypto", |
| 253 | "libcutils", |
| 254 | "liblog", |
| 255 | "liblogwrap", |
Suren Baghdasaryan | cd82905 | 2018-11-02 19:15:37 -0700 | [diff] [blame] | 256 | "libprocessgroup", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 257 | "libselinux", |
| 258 | "libutils", |
Nicolas Geoffray | aaad21e | 2019-02-25 13:31:10 +0000 | [diff] [blame] | 259 | "server_configurable_flags", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 260 | ], |
| 261 | } |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 262 | |
| 263 | // OTA slot script |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 264 | sh_binary { |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 265 | name: "otapreopt_slot", |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 266 | src: "otapreopt_slot.sh", |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 267 | init_rc: ["otapreopt.rc"], |
| 268 | } |
| 269 | |
| 270 | // OTA postinstall script |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 271 | sh_binary { |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 272 | name: "otapreopt_script", |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 273 | src: "otapreopt_script.sh", |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 274 | // Let this depend on otapreopt, the chroot tool and the slot script, |
| 275 | // so we just have to mention one in a configuration. |
| 276 | required: [ |
| 277 | "otapreopt", |
| 278 | "otapreopt_chroot", |
| 279 | "otapreopt_slot", |
| 280 | ], |
| 281 | } |
Narayan Kamath | 28ab93b | 2019-05-15 18:29:44 +0100 | [diff] [blame] | 282 | |
| 283 | // Script to migrate legacy obb data. |
| 284 | sh_binary { |
| 285 | name: "migrate_legacy_obb_data.sh", |
| 286 | src: "migrate_legacy_obb_data.sh" |
| 287 | } |