Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 1 | // Copyright (C) 2019 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 15 | // |
| 16 | // Module-specific defaults. |
| 17 | // |
| 18 | // For module X, if we need to build it both as a library and an executable: |
| 19 | // - A default rule `releasetools_X_defaults` is created, which lists `srcs`, `libs` and |
| 20 | // `required` properties. |
| 21 | // - `python_library_host` and `python_binary_host` are created by listing |
| 22 | // `releasetools_X_defaults` in their defaults. |
| 23 | // |
| 24 | |
Bob Badour | 0390580 | 2021-02-12 21:42:54 -0800 | [diff] [blame] | 25 | package { |
| 26 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 27 | } |
| 28 | |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 29 | python_defaults { |
| 30 | name: "releasetools_add_img_to_target_files_defaults", |
| 31 | srcs: [ |
| 32 | "add_img_to_target_files.py", |
| 33 | ], |
| 34 | libs: [ |
Kelvin Zhang | 5f0fcee | 2021-01-19 15:30:46 -0500 | [diff] [blame] | 35 | "ota_metadata_proto", |
| 36 | "releasetools_apex_utils", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 37 | "releasetools_build_image", |
| 38 | "releasetools_build_super_image", |
| 39 | "releasetools_common", |
| 40 | ], |
| 41 | required: [ |
| 42 | "care_map_generator", |
| 43 | ], |
| 44 | } |
| 45 | |
| 46 | python_defaults { |
| 47 | name: "releasetools_build_image_defaults", |
| 48 | srcs: [ |
| 49 | "build_image.py", |
| 50 | ], |
| 51 | libs: [ |
| 52 | "releasetools_common", |
| 53 | "releasetools_verity_utils", |
| 54 | ], |
| 55 | required: [ |
| 56 | "blk_alloc_to_base_fs", |
| 57 | "e2fsck", |
Gao Xiang | 961041a | 2020-06-17 13:59:16 +0800 | [diff] [blame] | 58 | "mkerofsimage.sh", |
Yifan Hong | 7702345 | 2020-08-25 16:15:16 -0700 | [diff] [blame] | 59 | "mkuserimg_mke2fs", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 60 | "simg2img", |
| 61 | "tune2fs", |
| 62 | ], |
| 63 | } |
| 64 | |
| 65 | python_defaults { |
| 66 | name: "releasetools_build_super_image_defaults", |
| 67 | srcs: [ |
| 68 | "build_super_image.py", |
| 69 | ], |
| 70 | libs: [ |
| 71 | "releasetools_common", |
| 72 | ], |
| 73 | } |
| 74 | |
| 75 | python_defaults { |
| 76 | name: "releasetools_img_from_target_files_defaults", |
| 77 | srcs: [ |
| 78 | "img_from_target_files.py", |
| 79 | ], |
| 80 | libs: [ |
| 81 | "releasetools_build_super_image", |
| 82 | "releasetools_common", |
| 83 | ], |
| 84 | } |
| 85 | |
| 86 | python_defaults { |
Yifan Hong | e3ba82c | 2019-08-21 13:29:30 -0700 | [diff] [blame] | 87 | name: "releasetools_check_target_files_vintf_defaults", |
| 88 | srcs: [ |
| 89 | "check_target_files_vintf.py", |
| 90 | ], |
| 91 | libs: [ |
| 92 | "releasetools_common", |
| 93 | ], |
| 94 | required: [ |
| 95 | "checkvintf", |
| 96 | ], |
| 97 | } |
| 98 | |
Tianjie | a207613 | 2020-08-19 17:25:32 -0700 | [diff] [blame] | 99 | python_library_host { |
| 100 | name: "ota_metadata_proto", |
| 101 | version: { |
| 102 | py2: { |
| 103 | enabled: true, |
| 104 | }, |
| 105 | py3: { |
| 106 | enabled: true, |
| 107 | }, |
| 108 | }, |
| 109 | srcs: [ |
| 110 | "ota_metadata.proto", |
| 111 | ], |
| 112 | proto: { |
| 113 | canonical_path_from_root: false, |
| 114 | }, |
| 115 | } |
| 116 | |
Yifan Hong | e3ba82c | 2019-08-21 13:29:30 -0700 | [diff] [blame] | 117 | python_defaults { |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 118 | name: "releasetools_ota_from_target_files_defaults", |
| 119 | srcs: [ |
| 120 | "edify_generator.py", |
Kelvin Zhang | cff4d76 | 2020-07-29 16:37:51 -0400 | [diff] [blame] | 121 | "non_ab_ota.py", |
Tianjie | a207613 | 2020-08-19 17:25:32 -0700 | [diff] [blame] | 122 | "ota_from_target_files.py", |
Kelvin Zhang | cff4d76 | 2020-07-29 16:37:51 -0400 | [diff] [blame] | 123 | "ota_utils.py", |
Tianjie | a207613 | 2020-08-19 17:25:32 -0700 | [diff] [blame] | 124 | "target_files_diff.py", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 125 | ], |
| 126 | libs: [ |
Tianjie | a207613 | 2020-08-19 17:25:32 -0700 | [diff] [blame] | 127 | "ota_metadata_proto", |
Yifan Hong | 9276cf0 | 2019-08-21 16:37:04 -0700 | [diff] [blame] | 128 | "releasetools_check_target_files_vintf", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 129 | "releasetools_common", |
| 130 | "releasetools_verity_utils", |
Mohammad Samiul Islam | 9fd5886 | 2021-01-06 13:33:25 +0000 | [diff] [blame] | 131 | "apex_manifest", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 132 | ], |
| 133 | required: [ |
| 134 | "brillo_update_payload", |
Yifan Hong | 0929855 | 2019-09-04 11:49:01 -0700 | [diff] [blame] | 135 | "checkvintf", |
Yifan Hong | 125d0b6 | 2020-09-24 17:07:03 -0700 | [diff] [blame] | 136 | "lz4", |
| 137 | "toybox", |
Mohammad Samiul Islam | 9fd5886 | 2021-01-06 13:33:25 +0000 | [diff] [blame] | 138 | "unpack_bootimg", |
| 139 | "deapexer", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 140 | ], |
Yo Chiang | 096c515 | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 141 | target: { |
| 142 | darwin: { |
| 143 | // required module "brillo_update_payload" is disabled on darwin |
| 144 | enabled: false, |
| 145 | }, |
| 146 | }, |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | // |
| 150 | // Host libraries. |
| 151 | // |
| 152 | |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 153 | python_defaults { |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 154 | name: "releasetools_library_defaults", |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 155 | version: { |
| 156 | py2: { |
| 157 | enabled: true, |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 158 | }, |
| 159 | py3: { |
Tao Bao | ca82fc9 | 2019-05-01 21:58:03 -0700 | [diff] [blame] | 160 | enabled: true, |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 161 | }, |
| 162 | }, |
| 163 | } |
| 164 | |
| 165 | python_library_host { |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 166 | name: "releasetools_add_img_to_target_files", |
| 167 | defaults: [ |
| 168 | "releasetools_library_defaults", |
| 169 | "releasetools_add_img_to_target_files_defaults", |
| 170 | ], |
| 171 | } |
| 172 | |
| 173 | python_library_host { |
| 174 | name: "releasetools_apex_utils", |
Tao Bao | 005305a | 2019-08-05 13:00:44 -0700 | [diff] [blame] | 175 | defaults: ["releasetools_library_defaults"], |
| 176 | srcs: [ |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 177 | "apex_utils.py", |
| 178 | ], |
| 179 | libs: [ |
Mohammad Samiul Islam | 9fd5886 | 2021-01-06 13:33:25 +0000 | [diff] [blame] | 180 | "apex_manifest", |
| 181 | "ota_metadata_proto", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 182 | "releasetools_common", |
| 183 | ], |
| 184 | } |
| 185 | |
| 186 | python_library_host { |
| 187 | name: "releasetools_build_image", |
| 188 | defaults: [ |
| 189 | "releasetools_library_defaults", |
| 190 | "releasetools_build_image_defaults", |
| 191 | ], |
| 192 | } |
| 193 | |
| 194 | python_library_host { |
| 195 | name: "releasetools_build_super_image", |
| 196 | defaults: [ |
| 197 | "releasetools_library_defaults", |
| 198 | "releasetools_build_super_image_defaults", |
Tao Bao | 005305a | 2019-08-05 13:00:44 -0700 | [diff] [blame] | 199 | ], |
| 200 | } |
| 201 | |
| 202 | python_library_host { |
Yifan Hong | ccb86fe | 2019-08-22 15:52:26 -0700 | [diff] [blame] | 203 | name: "releasetools_check_target_files_vintf", |
| 204 | defaults: [ |
| 205 | "releasetools_library_defaults", |
| 206 | "releasetools_check_target_files_vintf_defaults", |
| 207 | ], |
| 208 | } |
| 209 | |
| 210 | python_library_host { |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 211 | name: "releasetools_common", |
| 212 | defaults: ["releasetools_library_defaults"], |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 213 | srcs: [ |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 214 | "blockimgdiff.py", |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 215 | "common.py", |
Tianjie Xu | 41976c7 | 2019-07-03 13:57:01 -0700 | [diff] [blame] | 216 | "images.py", |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 217 | "rangelib.py", |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 218 | "sparse_img.py", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 219 | ], |
| 220 | // Only the tools that are referenced directly are listed as required modules. For example, |
| 221 | // `avbtool` is not here, as the script always uses the one from info_dict['avb_avbtool']. |
| 222 | required: [ |
changho.shin | 0f12536 | 2019-07-08 10:59:00 +0900 | [diff] [blame] | 223 | "aapt2", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 224 | "boot_signer", |
| 225 | "brotli", |
| 226 | "bsdiff", |
| 227 | "imgdiff", |
| 228 | "minigzip", |
J. Avila | 98cd4cc | 2020-06-10 20:09:10 +0000 | [diff] [blame] | 229 | "lz4", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 230 | "mkbootfs", |
Luca Stefani | 3e4b448 | 2020-03-27 14:00:23 +0100 | [diff] [blame] | 231 | "signapk", |
Yifan Hong | 14a8712 | 2021-01-12 13:26:25 -0800 | [diff] [blame] | 232 | "toybox", |
| 233 | "unpack_bootimg", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 234 | ], |
| 235 | } |
| 236 | |
| 237 | python_library_host { |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 238 | name: "releasetools_img_from_target_files", |
| 239 | defaults: [ |
| 240 | "releasetools_library_defaults", |
| 241 | "releasetools_img_from_target_files_defaults", |
| 242 | ], |
| 243 | } |
| 244 | |
| 245 | python_library_host { |
| 246 | name: "releasetools_ota_from_target_files", |
| 247 | defaults: [ |
| 248 | "releasetools_library_defaults", |
| 249 | "releasetools_ota_from_target_files_defaults", |
| 250 | ], |
| 251 | } |
| 252 | |
| 253 | python_library_host { |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 254 | name: "releasetools_verity_utils", |
| 255 | defaults: ["releasetools_library_defaults"], |
| 256 | srcs: [ |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 257 | "verity_utils.py", |
| 258 | ], |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 259 | required: [ |
| 260 | "append2simg", |
| 261 | "build_verity_metadata", |
| 262 | "build_verity_tree", |
| 263 | "fec", |
| 264 | ], |
| 265 | } |
| 266 | |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 267 | // |
| 268 | // Host binaries. |
| 269 | // |
| 270 | |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 271 | python_defaults { |
| 272 | name: "releasetools_binary_defaults", |
| 273 | version: { |
| 274 | py2: { |
| 275 | enabled: true, |
| 276 | embedded_launcher: true, |
| 277 | }, |
| 278 | py3: { |
| 279 | enabled: false, |
| 280 | embedded_launcher: false, |
| 281 | }, |
| 282 | }, |
Kiyoung Kim | 0a8d262 | 2020-03-24 09:36:03 +0900 | [diff] [blame] | 283 | // TODO (b/140144201) Build imgdiff from releasetools_common |
| 284 | required: [ |
| 285 | "aapt2", |
| 286 | "boot_signer", |
| 287 | "brotli", |
| 288 | "bsdiff", |
Mohammad Samiul Islam | f4909b4 | 2021-02-01 20:43:41 +0000 | [diff] [blame] | 289 | "deapexer", |
Kiyoung Kim | 0a8d262 | 2020-03-24 09:36:03 +0900 | [diff] [blame] | 290 | "imgdiff", |
| 291 | "minigzip", |
Luca Stefani | e0fc4ca | 2020-09-12 06:08:16 +0000 | [diff] [blame] | 292 | "lz4", |
Kiyoung Kim | 0a8d262 | 2020-03-24 09:36:03 +0900 | [diff] [blame] | 293 | "mkbootfs", |
Luca Stefani | e0fc4ca | 2020-09-12 06:08:16 +0000 | [diff] [blame] | 294 | "signapk", |
Yifan Hong | 14a8712 | 2021-01-12 13:26:25 -0800 | [diff] [blame] | 295 | "toybox", |
| 296 | "unpack_bootimg", |
Kiyoung Kim | 0a8d262 | 2020-03-24 09:36:03 +0900 | [diff] [blame] | 297 | ], |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | python_binary_host { |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 301 | name: "add_img_to_target_files", |
| 302 | defaults: [ |
| 303 | "releasetools_binary_defaults", |
| 304 | "releasetools_add_img_to_target_files_defaults", |
| 305 | ], |
| 306 | } |
| 307 | |
| 308 | python_binary_host { |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 309 | name: "build_image", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 310 | defaults: [ |
| 311 | "releasetools_binary_defaults", |
| 312 | "releasetools_build_image_defaults", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 313 | ], |
| 314 | } |
| 315 | |
| 316 | python_binary_host { |
| 317 | name: "build_super_image", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 318 | defaults: [ |
| 319 | "releasetools_binary_defaults", |
| 320 | "releasetools_build_super_image_defaults", |
| 321 | ], |
| 322 | } |
| 323 | |
| 324 | python_binary_host { |
Yifan Hong | 3a7c2ef | 2019-11-01 18:23:19 +0000 | [diff] [blame] | 325 | name: "check_partition_sizes", |
| 326 | srcs: [ |
| 327 | "check_partition_sizes.py", |
| 328 | ], |
| 329 | libs: [ |
| 330 | "releasetools_common", |
| 331 | ], |
| 332 | defaults: [ |
| 333 | "releasetools_binary_defaults", |
| 334 | ], |
| 335 | } |
| 336 | |
| 337 | python_binary_host { |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 338 | name: "check_ota_package_signature", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 339 | defaults: ["releasetools_binary_defaults"], |
| 340 | srcs: [ |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 341 | "check_ota_package_signature.py", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 342 | ], |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 343 | libs: [ |
| 344 | "releasetools_common", |
| 345 | ], |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 346 | required: [ |
| 347 | "delta_generator", |
| 348 | ], |
Yo Chiang | 096c515 | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 349 | target: { |
| 350 | darwin: { |
| 351 | // required module "delta_generator" is disabled on darwin |
| 352 | enabled: false, |
| 353 | }, |
| 354 | }, |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 355 | } |
| 356 | |
| 357 | python_binary_host { |
| 358 | name: "check_target_files_signatures", |
| 359 | defaults: ["releasetools_binary_defaults"], |
| 360 | srcs: [ |
| 361 | "check_target_files_signatures.py", |
| 362 | ], |
| 363 | libs: [ |
| 364 | "releasetools_common", |
| 365 | ], |
| 366 | required: [ |
| 367 | "aapt", |
| 368 | ], |
| 369 | } |
| 370 | |
| 371 | python_binary_host { |
Yifan Hong | e3ba82c | 2019-08-21 13:29:30 -0700 | [diff] [blame] | 372 | name: "check_target_files_vintf", |
| 373 | defaults: [ |
| 374 | "releasetools_binary_defaults", |
| 375 | "releasetools_check_target_files_vintf_defaults" |
| 376 | ], |
| 377 | } |
| 378 | |
| 379 | python_binary_host { |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 380 | name: "img_from_target_files", |
| 381 | defaults: [ |
| 382 | "releasetools_binary_defaults", |
| 383 | "releasetools_img_from_target_files_defaults", |
| 384 | ], |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 385 | } |
| 386 | |
Daniel Norman | b8d52a2 | 2020-10-26 17:55:00 -0700 | [diff] [blame] | 387 | python_defaults { |
| 388 | name: "releasetools_find_shareduid_violation_defaults", |
| 389 | srcs: [ |
| 390 | "find_shareduid_violation.py", |
| 391 | ], |
| 392 | libs: [ |
| 393 | "releasetools_common", |
| 394 | ], |
| 395 | } |
| 396 | |
| 397 | python_binary_host { |
| 398 | name: "find_shareduid_violation", |
| 399 | defaults: [ |
| 400 | "releasetools_binary_defaults", |
| 401 | "releasetools_find_shareduid_violation_defaults", |
| 402 | ], |
| 403 | } |
| 404 | |
| 405 | python_library_host { |
| 406 | name: "releasetools_find_shareduid_violation", |
| 407 | defaults: [ |
| 408 | "releasetools_find_shareduid_violation_defaults", |
| 409 | "releasetools_library_defaults", |
| 410 | ], |
| 411 | } |
| 412 | |
Daniel Norman | bfc51ef | 2019-07-24 14:34:54 -0700 | [diff] [blame] | 413 | python_binary_host { |
Tao Bao | e11a460 | 2019-08-06 23:21:23 -0700 | [diff] [blame] | 414 | name: "make_recovery_patch", |
| 415 | defaults: ["releasetools_binary_defaults"], |
| 416 | srcs: [ |
| 417 | "make_recovery_patch.py", |
| 418 | ], |
| 419 | libs: [ |
| 420 | "releasetools_common", |
| 421 | ], |
| 422 | } |
| 423 | |
| 424 | python_binary_host { |
Daniel Norman | bfc51ef | 2019-07-24 14:34:54 -0700 | [diff] [blame] | 425 | name: "merge_builds", |
| 426 | defaults: ["releasetools_binary_defaults"], |
| 427 | srcs: [ |
Daniel Norman | bfc51ef | 2019-07-24 14:34:54 -0700 | [diff] [blame] | 428 | "merge_builds.py", |
| 429 | ], |
Daniel Norman | bfc51ef | 2019-07-24 14:34:54 -0700 | [diff] [blame] | 430 | libs: [ |
Tao Bao | 005305a | 2019-08-05 13:00:44 -0700 | [diff] [blame] | 431 | "releasetools_build_super_image", |
Daniel Norman | bfc51ef | 2019-07-24 14:34:54 -0700 | [diff] [blame] | 432 | "releasetools_common", |
| 433 | ], |
| 434 | } |
| 435 | |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 436 | python_binary_host { |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 437 | name: "merge_target_files", |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 438 | defaults: ["releasetools_binary_defaults"], |
| 439 | srcs: [ |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 440 | "merge_target_files.py", |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 441 | ], |
| 442 | libs: [ |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 443 | "releasetools_add_img_to_target_files", |
| 444 | "releasetools_build_super_image", |
Yifan Hong | ade0d3f | 2019-08-21 16:37:11 -0700 | [diff] [blame] | 445 | "releasetools_check_target_files_vintf", |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 446 | "releasetools_common", |
Daniel Norman | b8d52a2 | 2020-10-26 17:55:00 -0700 | [diff] [blame] | 447 | "releasetools_find_shareduid_violation", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 448 | "releasetools_img_from_target_files", |
| 449 | "releasetools_ota_from_target_files", |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 450 | ], |
Yifan Hong | 0929855 | 2019-09-04 11:49:01 -0700 | [diff] [blame] | 451 | required: [ |
| 452 | "checkvintf", |
Daniel Norman | 21c34f7 | 2020-11-11 17:25:50 -0800 | [diff] [blame] | 453 | "host_init_verifier", |
Daniel Norman | 48603ff | 2021-02-22 15:15:24 -0800 | [diff] [blame^] | 454 | "secilc", |
Yifan Hong | 0929855 | 2019-09-04 11:49:01 -0700 | [diff] [blame] | 455 | ], |
Yo Chiang | 096c515 | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 456 | target: { |
| 457 | darwin: { |
| 458 | // libs dep "releasetools_ota_from_target_files" is disabled on darwin |
| 459 | enabled: false, |
| 460 | }, |
| 461 | }, |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 462 | } |
| 463 | |
| 464 | python_binary_host { |
| 465 | name: "ota_from_target_files", |
| 466 | defaults: [ |
| 467 | "releasetools_binary_defaults", |
| 468 | "releasetools_ota_from_target_files_defaults", |
| 469 | ], |
| 470 | } |
| 471 | |
| 472 | python_binary_host { |
| 473 | name: "ota_package_parser", |
| 474 | defaults: ["releasetools_binary_defaults"], |
| 475 | srcs: [ |
| 476 | "ota_package_parser.py", |
| 477 | "rangelib.py", |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 478 | ], |
| 479 | } |
| 480 | |
Tao Bao | e11a460 | 2019-08-06 23:21:23 -0700 | [diff] [blame] | 481 | python_binary_host { |
| 482 | name: "sparse_img", |
| 483 | defaults: ["releasetools_binary_defaults"], |
| 484 | srcs: [ |
| 485 | "rangelib.py", |
| 486 | "sparse_img.py", |
| 487 | ], |
Tao Bao | e11a460 | 2019-08-06 23:21:23 -0700 | [diff] [blame] | 488 | } |
| 489 | |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 490 | python_binary_host { |
| 491 | name: "sign_apex", |
| 492 | defaults: ["releasetools_binary_defaults"], |
| 493 | srcs: [ |
| 494 | "sign_apex.py", |
| 495 | ], |
| 496 | libs: [ |
| 497 | "releasetools_apex_utils", |
| 498 | "releasetools_common", |
| 499 | ], |
| 500 | } |
| 501 | |
| 502 | python_binary_host { |
| 503 | name: "sign_target_files_apks", |
| 504 | defaults: ["releasetools_binary_defaults"], |
| 505 | srcs: [ |
| 506 | "sign_target_files_apks.py", |
| 507 | ], |
| 508 | libs: [ |
| 509 | "releasetools_add_img_to_target_files", |
| 510 | "releasetools_apex_utils", |
| 511 | "releasetools_common", |
| 512 | ], |
| 513 | } |
| 514 | |
| 515 | python_binary_host { |
| 516 | name: "validate_target_files", |
| 517 | defaults: ["releasetools_binary_defaults"], |
| 518 | srcs: [ |
| 519 | "validate_target_files.py", |
| 520 | ], |
| 521 | libs: [ |
| 522 | "releasetools_common", |
| 523 | ], |
| 524 | } |
| 525 | |
| 526 | // |
| 527 | // Tests. |
| 528 | // |
| 529 | |
Tao Bao | ca82fc9 | 2019-05-01 21:58:03 -0700 | [diff] [blame] | 530 | python_defaults { |
| 531 | name: "releasetools_test_defaults", |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 532 | srcs: [ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 533 | "check_ota_package_signature.py", |
Yifan Hong | 3a7c2ef | 2019-11-01 18:23:19 +0000 | [diff] [blame] | 534 | "check_partition_sizes.py", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 535 | "check_target_files_signatures.py", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 536 | "make_recovery_patch.py", |
| 537 | "merge_target_files.py", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 538 | "ota_package_parser.py", |
| 539 | "sign_apex.py", |
| 540 | "sign_target_files_apks.py", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 541 | "validate_target_files.py", |
| 542 | |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 543 | "test_*.py", |
| 544 | ], |
| 545 | libs: [ |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 546 | "releasetools_add_img_to_target_files", |
| 547 | "releasetools_apex_utils", |
| 548 | "releasetools_build_image", |
Tao Bao | 005305a | 2019-08-05 13:00:44 -0700 | [diff] [blame] | 549 | "releasetools_build_super_image", |
Yifan Hong | ccb86fe | 2019-08-22 15:52:26 -0700 | [diff] [blame] | 550 | "releasetools_check_target_files_vintf", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 551 | "releasetools_common", |
Daniel Norman | b8d52a2 | 2020-10-26 17:55:00 -0700 | [diff] [blame] | 552 | "releasetools_find_shareduid_violation", |
Tao Bao | 3c7b2a6 | 2019-08-07 12:24:20 -0700 | [diff] [blame] | 553 | "releasetools_img_from_target_files", |
| 554 | "releasetools_ota_from_target_files", |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 555 | "releasetools_verity_utils", |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 556 | ], |
| 557 | data: [ |
Yifan Hong | ccb86fe | 2019-08-22 15:52:26 -0700 | [diff] [blame] | 558 | "testdata/**/*", |
Mohammad Samiul Islam | 9fd5886 | 2021-01-06 13:33:25 +0000 | [diff] [blame] | 559 | ":com.android.apex.compressed.v1", |
| 560 | ":com.android.apex.compressed.v1_original", |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 561 | ], |
Yo Chiang | 096c515 | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 562 | target: { |
| 563 | darwin: { |
| 564 | // libs dep "releasetools_ota_from_target_files" is disabled on darwin |
| 565 | enabled: false, |
| 566 | }, |
| 567 | }, |
Mohammad Samiul Islam | 9fd5886 | 2021-01-06 13:33:25 +0000 | [diff] [blame] | 568 | required: [ |
| 569 | "deapexer", |
| 570 | ], |
Tao Bao | ca82fc9 | 2019-05-01 21:58:03 -0700 | [diff] [blame] | 571 | } |
| 572 | |
| 573 | python_test_host { |
| 574 | name: "releasetools_test", |
| 575 | defaults: ["releasetools_test_defaults"], |
| 576 | main: "test_utils.py", |
| 577 | version: { |
| 578 | py2: { |
| 579 | enabled: true, |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 580 | // When using embedded launcher, atest will try (but may fail) to load libc++.so from |
| 581 | // host, because the test executable won't be able to find the needed libs via its |
| 582 | // runpath. |
Tao Bao | ca82fc9 | 2019-05-01 21:58:03 -0700 | [diff] [blame] | 583 | embedded_launcher: false, |
| 584 | }, |
| 585 | py3: { |
| 586 | enabled: false, |
| 587 | embedded_launcher: false, |
| 588 | }, |
| 589 | }, |
Julien Desprez | 6d9e78f | 2020-12-21 13:56:05 -0800 | [diff] [blame] | 590 | test_options: { |
| 591 | unit_test: true, |
| 592 | }, |
Tao Bao | ca82fc9 | 2019-05-01 21:58:03 -0700 | [diff] [blame] | 593 | } |
| 594 | |
| 595 | python_test_host { |
| 596 | name: "releasetools_py3_test", |
| 597 | defaults: ["releasetools_test_defaults"], |
| 598 | main: "test_utils.py", |
Kelvin Zhang | 553efca | 2021-02-01 17:25:41 -0500 | [diff] [blame] | 599 | test_suites: ["general-tests"], |
Tao Bao | ca82fc9 | 2019-05-01 21:58:03 -0700 | [diff] [blame] | 600 | version: { |
| 601 | py2: { |
| 602 | enabled: false, |
| 603 | embedded_launcher: false, |
| 604 | }, |
| 605 | py3: { |
| 606 | enabled: true, |
| 607 | embedded_launcher: false, |
| 608 | }, |
| 609 | }, |
Julien Desprez | 6d9e78f | 2020-12-21 13:56:05 -0800 | [diff] [blame] | 610 | test_options: { |
| 611 | unit_test: true, |
| 612 | }, |
Tao Bao | 30e3114 | 2019-04-09 00:12:30 -0700 | [diff] [blame] | 613 | } |