def create_source_abi_reference_dumps_for_all_products(args): """Create reference ABI dumps for all specified products.""" platform_vndk_version, board_vndk_version = get_build_vars_for_product( ['PLATFORM_VNDK_VERSION', 'BOARD_VNDK_VERSION']) chosen_vndk_version = choose_vndk_version( args.version, platform_vndk_version, board_vndk_version) num_processed = 0 for product in args.products: targets = [Target(True, product), Target(False, product)] # Remove reference ABI dumps specified in `args.libs` (or remove all of # them if none of them are specified) so that we may build these # libraries successfully. remove_references_for_all_arches_and_variants( args, product, targets, chosen_vndk_version) if not args.no_make_lib: # Build all the specified libs (or build the 'vndk' target if none # of them are specified.) make_libs_for_product(args.libs, args.llndk, product, args.build_variant, targets) lsdump_paths = read_lsdump_paths(product, args.build_variant, targets, build=False) num_processed += create_source_abi_reference_dumps( args, product, chosen_vndk_version, lsdump_paths, targets) return num_processed
def main(): # Parse command line options. assert 'ANDROID_BUILD_TOP' in os.environ start = time.time() parser = argparse.ArgumentParser() parser.add_argument('--version', help='VNDK version') parser.add_argument('--no-make-lib', help='no m -j lib.vendor while \ creating reference', default=False, action='store_true') parser.add_argument('-libs', help='libs to create references for', action='append') parser.add_argument('-ref-dump-dir', help='directory to copy reference abi dumps into', default=os.path.join(AOSP_DIR, 'prebuilts/abi-dumps')) args = parser.parse_args() num_processed = 0 soong_dir = os.path.join(AOSP_DIR, 'out', 'soong', '.intermediates') # Remove reference dumps specified by libs / all of them if none specified, # so that we may build those libraries succesfully. remove_references_for_all_arches_and_variants(args) # make all the libs specified / the entire vndk_package if none specified if (args.no_make_lib == False): make_libs_for_all_arches_and_variants(args.libs) platform_vndk_version =\ get_build_vars_for_product(['PLATFORM_VNDK_VERSION'])[0] for product in PRODUCTS: num_processed += create_source_abi_reference_dumps( soong_dir, args, product, platform_vndk_version) print() end = time.time() print('msg: Processed', num_processed, 'libraries in ', (end - start) / 60)
def create_source_abi_reference_dumps_for_all_products(args): """Create reference ABI dumps for all specified products.""" platform_vndk_version, board_vndk_version = get_build_vars_for_product( ['PLATFORM_VNDK_VERSION', 'BOARD_VNDK_VERSION']) chosen_vndk_version = choose_vndk_version(args.version, platform_vndk_version, board_vndk_version) num_processed = 0 for product in args.products: targets = [Target(True, product), Target(False, product)] # Remove reference ABI dumps specified in `args.libs` (or remove all of # them if none of them are specified) so that we may build these # libraries successfully. remove_references_for_all_arches_and_variants(args, product, targets, chosen_vndk_version) if not args.no_make_lib: # Build all the specified libs (or build the 'vndk' target if none # of them are specified.) make_libs_for_product(args.libs, args.llndk, product) lsdump_paths = get_lsdump_paths(product, args.libs) num_processed += create_source_abi_reference_dumps( args, product, chosen_vndk_version, lsdump_paths, targets) return num_processed
def get_ref_dump_dir_stem(args, vndk_or_ndk, product, chosen_vndk_version): binder_bitness = '64' if get_build_vars_for_product(['BINDER32BIT'], product)[0] == 'true': binder_bitness = '32' ref_dump_dir_stem = os.path.join(args.ref_dump_dir, vndk_or_ndk) ref_dump_dir_stem = os.path.join(ref_dump_dir_stem, chosen_vndk_version) ref_dump_dir_stem = os.path.join(ref_dump_dir_stem, binder_bitness) return ref_dump_dir_stem
def get_lsdump_paths_file(product): build_vars_to_fetch = ['OUT_DIR', 'TARGET_DEVICE'] build_vars = get_build_vars_for_product(build_vars_to_fetch, product) lsdump_paths_file = os.path.join(AOSP_DIR, build_vars[0], 'target', 'product', build_vars[1], 'lsdump_paths.txt') if os.path.exists(lsdump_paths_file) == False: make_targets([FIND_LSDUMPS_TARGET], product) return lsdump_paths_file
def get_ref_dump_dir_stem(args, vndk_or_ndk, product, chosen_vndk_version): binder_bitness = '64' if get_build_vars_for_product(['BINDER32BIT'], product)[0] == 'true': binder_bitness = '32' ref_dump_dir_stem = os.path.join(args.ref_dump_dir, vndk_or_ndk) ref_dump_dir_stem = os.path.join(ref_dump_dir_stem, chosen_vndk_version) ref_dump_dir_stem = os.path.join(ref_dump_dir_stem, binder_bitness) return ref_dump_dir_stem
def main(): # Parse command line options. assert 'ANDROID_BUILD_TOP' in os.environ start = time.time() parser = argparse.ArgumentParser() parser.add_argument('--version', help='VNDK version') parser.add_argument('--no-make-lib', help='no m -j lib.vendor while \ creating reference', default=False, action='store_true') parser.add_argument('--llndk', help='The libs specified by -l are llndk', default=False, action='store_true') parser.add_argument('-libs', help='libs to create references for', action='append') parser.add_argument('-products', help='products to create references for', action='append') parser.add_argument('-ref-dump-dir', help='directory to copy reference abi dumps into', default=os.path.join(AOSP_DIR, 'prebuilts/abi-dumps')) parser.add_argument('--compress', action='store_true', help='compress reference dump with gzip') args = parser.parse_args() num_processed = 0 # Remove reference dumps specified by libs / all of them if none specified, # so that we may build those libraries succesfully. vndk_versions = get_build_vars_for_product( ['PLATFORM_VNDK_VERSION', 'BOARD_VNDK_VERSION']) platform_vndk_version = vndk_versions[0] board_vndk_version = vndk_versions[1] chosen_vndk_version = \ choose_vndk_version(args.version, platform_vndk_version, board_vndk_version) if args.products is None: args.products = PRODUCTS for product in args.products: targets = [Target(True, product), Target(False, product)] remove_references_for_all_arches_and_variants(args, product, targets, chosen_vndk_version) # make all the libs specified / the 'vndk' target if none specified if (args.no_make_lib == False): make_libs_for_product(args.libs, args.llndk, product) lsdump_paths = get_lsdump_paths(product, args.libs) num_processed += create_source_abi_reference_dumps( args, product, chosen_vndk_version, lsdump_paths, targets) print() end = time.time() print('msg: Processed', num_processed, 'libraries in ', (end - start) / 60, ' minutes')
def __init__(self, has_2nd, product): extra = '_2ND' if has_2nd else '' build_vars_to_fetch = ['TARGET_ARCH', 'TARGET{}_ARCH'.format(extra), 'TARGET{}_ARCH_VARIANT'.format(extra), 'TARGET{}_CPU_VARIANT'.format(extra)] build_vars = get_build_vars_for_product(build_vars_to_fetch, product) self.primary_arch = build_vars[0] self.arch = build_vars[1] self.arch_variant = build_vars[2] self.cpu_variant = build_vars[3]
def get_lsdump_paths_from_out(product): build_vars_to_fetch = ['OUT_DIR', 'TARGET_DEVICE'] build_vars = get_build_vars_for_product(build_vars_to_fetch, product) lsdump_paths_file = os.path.join(AOSP_DIR, build_vars[0], 'target', 'product', build_vars[1], 'lsdump_paths.txt') assert (os.path.exists(lsdump_paths_file) == True) lsdump_paths = dict() with open(lsdump_paths_file) as f: for path in f: add_to_path_dict(path.rstrip(), lsdump_paths) return lsdump_paths
def get_lsdump_paths_from_out(product): build_vars_to_fetch = ['OUT_DIR', 'TARGET_DEVICE'] build_vars = get_build_vars_for_product(build_vars_to_fetch, product) lsdump_paths_file = os.path.join(AOSP_DIR, build_vars[0],'target', 'product', build_vars[1], 'lsdump_paths.txt') assert(os.path.exists(lsdump_paths_file) == True) lsdump_paths = dict() with open(lsdump_paths_file) as f: for path in f.read().split(' '): add_to_path_dict(path, lsdump_paths) return lsdump_paths
def get_lsdump_paths_from_out(product): build_vars_to_fetch = ['OUT_DIR', 'TARGET_DEVICE'] build_vars = get_build_vars_for_product(build_vars_to_fetch, product) lsdump_paths_file = os.path.join(AOSP_DIR, build_vars[0], 'target', 'product', build_vars[1], 'lsdump_paths.txt') if os.path.exists(lsdump_paths_file) == False: make_targets([FIND_LSDUMPS_TARGET], product) lsdump_paths = dict() with open(lsdump_paths_file) as f: for path in f.read().split(' '): add_to_path_dict(path, lsdump_paths) return lsdump_paths
def get_ref_dump_dir_stem(args, vndk_or_ndk, product, platform_vndk_version): version = args.version if version is None: version = platform_vndk_version if version != '' and version[0].isdigit() == False: version = 'current' primary_arch =\ get_build_vars_for_product(['TARGET_ARCH'], product)[0] ref_dump_dir_stem = os.path.join(args.ref_dump_dir, vndk_or_ndk) ref_dump_dir_stem = os.path.join(ref_dump_dir_stem, version) ref_dump_dir_stem = os.path.join(ref_dump_dir_stem, primary_arch) return ref_dump_dir_stem
def get_ref_dump_dir_stem(args, vndk_or_ndk, product, platform_vndk_version): version = args.version if version is None: version = platform_vndk_version if version != '' and version[0].isdigit() == False: version = 'current' binder_bitness = '64' if get_build_vars_for_product(['BINDER32BIT'], product)[0] == 'true': binder_bitness = '32' ref_dump_dir_stem = os.path.join(args.ref_dump_dir, vndk_or_ndk) ref_dump_dir_stem = os.path.join(ref_dump_dir_stem, version) ref_dump_dir_stem = os.path.join(ref_dump_dir_stem, binder_bitness) return ref_dump_dir_stem
def create_source_abi_reference_dumps_for_all_products(args): """Create reference ABI dumps for all specified products.""" num_processed = 0 for product in args.products: build_vars = get_build_vars_for_product( ['PLATFORM_VNDK_VERSION', 'BOARD_VNDK_VERSION', 'BINDER32BIT'], product, args.build_variant) platform_vndk_version = build_vars[0] board_vndk_version = build_vars[1] if build_vars[2] == 'true': binder_bitness = '32' else: binder_bitness = '64' chosen_vndk_version = choose_vndk_version(args.version, platform_vndk_version, board_vndk_version) targets = [Target(True, product), Target(False, product)] # Remove reference ABI dumps specified in `args.libs` (or remove all of # them if none of them are specified) so that we may build these # libraries successfully. remove_references_for_all_arches_and_variants(args.ref_dump_dir, chosen_vndk_version, binder_bitness, targets, args.libs) if not args.no_make_lib: # Build all the specified libs, or build `findlsdumps` if no libs # are specified. make_libs_for_product(args.libs, product, args.build_variant, platform_vndk_version, targets) lsdump_paths = read_lsdump_paths(product, args.build_variant, platform_vndk_version, targets, build=False) num_processed += create_source_abi_reference_dumps( args, chosen_vndk_version, binder_bitness, lsdump_paths, targets) return num_processed
def main(): # Parse command line options. assert 'ANDROID_BUILD_TOP' in os.environ start = time.time() parser = argparse.ArgumentParser() parser.add_argument('--version', help='VNDK version') parser.add_argument('--no-make-lib', help='no m -j lib.vendor while \ creating reference', default=False, action='store_true') parser.add_argument('--llndk', help='The libs specified by -l are llndk', default=False, action='store_true') parser.add_argument('-libs', help='libs to create references for', action='append') parser.add_argument('-ref-dump-dir', help='directory to copy reference abi dumps into', default=os.path.join(AOSP_DIR,'prebuilts/abi-dumps')) args = parser.parse_args() num_processed = 0 # Remove reference dumps specified by libs / all of them if none specified, # so that we may build those libraries succesfully. vndk_versions = get_build_vars_for_product(['PLATFORM_VNDK_VERSION', 'BOARD_VNDK_VERSION']) platform_vndk_version = vndk_versions[0] board_vndk_version = vndk_versions[1] chosen_vndk_version = \ choose_vndk_version(args.version, platform_vndk_version, board_vndk_version) remove_references_for_all_arches_and_variants(args, chosen_vndk_version) # make all the libs specified / the 'vndk' target if none specified if (args.no_make_lib == False): make_libs_for_all_arches_and_variants(args.libs, args.llndk) for product in PRODUCTS: lsdump_paths = get_lsdump_paths(product, args.libs) num_processed += create_source_abi_reference_dumps( args, product, chosen_vndk_version, lsdump_paths) print() end = time.time() print('msg: Processed', num_processed, 'libraries in ', (end - start) / 60, ' minutes')