Herbert Xue | 4c0faf0 | 2025-03-18 14:56:15 +0800 | [diff] [blame] | 1 | // Copyright (C) 2025 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 | |
| 15 | package { |
| 16 | // See: http://go/android-license-faq |
| 17 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 18 | } |
| 19 | |
| 20 | java_genrule_host { |
| 21 | name: "otatools_package_dep_jars", |
| 22 | tools: ["soong_zip"], |
| 23 | compile_multilib: "first", |
| 24 | cmd: "mkdir -p $(genDir)/framework && " + |
| 25 | "cp $(in) $(genDir)/framework && " + |
| 26 | "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)/framework", |
| 27 | srcs: [ |
| 28 | ":apksigner", |
| 29 | ":boot_signer", |
| 30 | ":signapk", |
| 31 | ":verity_signer", |
| 32 | ], |
| 33 | out: ["otatools_package_dep_jars.zip"], |
| 34 | } |
| 35 | |
Herbert Xue | 54af9c2 | 2025-03-21 13:31:33 +0800 | [diff] [blame] | 36 | cc_genrule { |
| 37 | name: "otatools_package_dep_libs", |
| 38 | host_supported: true, |
| 39 | device_supported: false, |
| 40 | compile_multilib: "first", |
| 41 | tools: ["soong_zip"], |
| 42 | cmd: "mkdir -p $(genDir)/$$CC_MULTILIB &&" + |
| 43 | "cp $(in) $(genDir)/$$CC_MULTILIB && " + |
| 44 | "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)/$$CC_MULTILIB", |
| 45 | srcs: [ |
| 46 | ":libbase", |
| 47 | ":libbrillo", |
| 48 | ":libbrillo-stream", |
| 49 | ":libc++", |
| 50 | "//external/libchrome:libchrome", |
| 51 | ":libconscrypt_openjdk_jni", |
| 52 | ":libcrypto", |
| 53 | ":libcrypto_utils", |
| 54 | ":libcutils", |
| 55 | ":libevent", |
| 56 | ":libext2_blkid", |
| 57 | ":libext2_com_err", |
| 58 | ":libext2_e2p", |
| 59 | ":libext2_quota", |
| 60 | ":libext2_uuid", |
| 61 | ":libext2fs", |
| 62 | ":libext4_utils", |
| 63 | ":libfec", |
| 64 | ":libhidl-gen-utils", |
| 65 | ":libhidlmetadata", |
| 66 | ":libicui18n", |
| 67 | ":libicuuc", |
| 68 | ":liblog", |
| 69 | ":liblp", |
| 70 | ":liblz4", |
| 71 | ":libpcre2", |
| 72 | ":libprocessgroup", |
| 73 | ":libprotobuf-cpp-lite", |
| 74 | ":libselinux", |
| 75 | ":libsparse", |
| 76 | ":libsqlite", |
| 77 | ":libsquashfs_utils", |
| 78 | ":libssl", |
| 79 | ":libz", |
| 80 | ":libziparchive", |
| 81 | ], |
| 82 | out: ["otatools_package_dep_libs.zip"], |
| 83 | } |
| 84 | |
| 85 | cc_genrule { |
| 86 | name: "otatools_package_dep_bins", |
| 87 | host_supported: true, |
| 88 | device_supported: false, |
| 89 | compile_multilib: "first", |
| 90 | tools: [ |
| 91 | "apksigner", |
| 92 | "boot_signer", |
| 93 | "merge_zips", |
| 94 | "signapk", |
| 95 | "verity_signer", |
| 96 | ], |
| 97 | cmd: "mkdir -p $(genDir)/bin && " + |
| 98 | "cp $(in) $(genDir)/bin && " + |
| 99 | "cp $(location apksigner) $(location boot_signer) $(location merge_zips) $(location signapk) $(location verity_signer) $(genDir)/bin && " + |
| 100 | "$(location :soong_zip) -o $(out) -C $(genDir) -D $(genDir)/bin", |
| 101 | srcs: [ |
| 102 | ":aapt2", |
| 103 | ":add_img_to_target_files", |
| 104 | ":apex_compression_tool", |
| 105 | ":apexd_host", |
| 106 | ":apexer", |
| 107 | ":append2simg", |
| 108 | ":avbtool", |
| 109 | ":blk_alloc_to_base_fs", |
| 110 | ":brillo_update_payload", |
| 111 | ":brotli", |
| 112 | ":bsdiff", |
| 113 | ":build_image", |
| 114 | ":build_super_image", |
| 115 | ":build_verity_metadata", |
| 116 | ":build_verity_tree", |
| 117 | ":care_map_generator", |
| 118 | ":check_ota_package_signature", |
| 119 | ":check_target_files_signatures", |
| 120 | ":check_target_files_vintf", |
| 121 | ":checkvintf", |
| 122 | ":create_brick_ota", |
| 123 | ":deapexer", |
| 124 | ":debugfs_static", |
| 125 | ":delta_generator", |
| 126 | ":e2fsck", |
| 127 | ":e2fsdroid", |
| 128 | ":fc_sort", |
| 129 | ":fec", |
| 130 | ":fs_config", |
| 131 | ":fsck.erofs", |
| 132 | ":fsck.f2fs", |
| 133 | ":generate_verity_key", |
| 134 | ":host_init_verifier", |
| 135 | ":img2simg", |
| 136 | ":img_from_target_files", |
| 137 | ":initrd_bootconfig", |
| 138 | ":lpmake", |
| 139 | ":lpunpack", |
| 140 | ":lz4", |
| 141 | ":make_f2fs", |
| 142 | ":make_f2fs_casefold", |
| 143 | ":merge_ota", |
| 144 | ":merge_target_files", |
| 145 | "//device/generic/goldfish:mk_combined_img", |
| 146 | ":mkbootfs", |
| 147 | ":mkbootimg", |
| 148 | ":mke2fs", |
| 149 | ":mkf2fsuserimg", |
| 150 | ":mkfs.erofs", |
| 151 | ":mksquashfs", |
| 152 | ":mksquashfsimage", |
| 153 | ":mkuserimg_mke2fs", |
| 154 | ":ota_extractor", |
| 155 | ":ota_from_target_files", |
| 156 | ":repack_bootimg", |
| 157 | ":resize2fs", |
| 158 | ":secilc", |
| 159 | ":sefcontext_compile", |
| 160 | ":sgdisk", |
| 161 | ":shflags", |
| 162 | ":sign_apex", |
| 163 | ":sign_target_files_apks", |
| 164 | ":sign_virt_apex", |
| 165 | ":simg2img", |
| 166 | ":sload_f2fs", |
| 167 | ":soong_zip", |
| 168 | ":toybox", |
| 169 | ":tune2fs", |
| 170 | ":unpack_bootimg", |
| 171 | ":update_device", |
| 172 | ":validate_target_files", |
| 173 | ":verity_verifier", |
| 174 | ":zip2zip", |
| 175 | ":zipalign", |
| 176 | ":zucchini", |
| 177 | ] + select(soong_config_variable("otatools", "use_vendor_google_tools"), { |
| 178 | true: [":build_mixed_kernels_ramdisk_host"], |
| 179 | default: [], |
| 180 | }) + select(soong_config_variable("otatools", "use_bootable_deprecated_ota_applypatch"), { |
| 181 | true: [ |
| 182 | ":imgdiff", |
| 183 | ":update_host_simulator", |
| 184 | ], |
| 185 | default: [], |
| 186 | }), |
| 187 | out: ["otatools_package_dep_bins.zip"], |
| 188 | } |
| 189 | |
Herbert Xue | 4c0faf0 | 2025-03-18 14:56:15 +0800 | [diff] [blame] | 190 | java_genrule_host { |
| 191 | name: "otatools_package", |
| 192 | tools: ["merge_zips"], |
| 193 | compile_multilib: "first", |
| 194 | cmd: "$(location merge_zips) $(out) $(in)", |
| 195 | srcs: [ |
| 196 | ":otatools_package_cert_files", |
Herbert Xue | 54af9c2 | 2025-03-21 13:31:33 +0800 | [diff] [blame] | 197 | ":otatools_package_dep_bins", |
Herbert Xue | 4c0faf0 | 2025-03-18 14:56:15 +0800 | [diff] [blame] | 198 | ":otatools_package_dep_jars", |
Herbert Xue | 54af9c2 | 2025-03-21 13:31:33 +0800 | [diff] [blame] | 199 | ":otatools_package_dep_libs", |
Herbert Xue | 4c0faf0 | 2025-03-18 14:56:15 +0800 | [diff] [blame] | 200 | ":otatools_package_releasetools", |
| 201 | ], |
| 202 | // TODO: Rename as "otatools.zip" when the rest files are ready. |
| 203 | out: ["otatools_temp.zip"], |
| 204 | dist: { |
| 205 | targets: [ |
| 206 | "otatools-package-temp", |
| 207 | ], |
| 208 | }, |
| 209 | } |
| 210 | |
| 211 | otatools_package_cert_files { |
| 212 | name: "otatools_package_cert_files", |
| 213 | } |