Merge "Add --build-variant to create_reference_dumps.py"

This commit is contained in:
Hsin-Yi Chen
2018-12-27 03:31:49 +00:00
committed by Gerrit Code Review
2 changed files with 17 additions and 14 deletions

View File

@@ -99,12 +99,12 @@ def get_ref_dump_dir_stem(args, vndk_or_ndk, product, chosen_vndk_version):
return ref_dump_dir_stem return ref_dump_dir_stem
def make_libs_for_product(libs, llndk_mode, product): def make_libs_for_product(libs, llndk_mode, product, variant):
print('making libs for product:', product) print('making libs for', product + '-' + variant)
if libs: if libs:
make_libraries(libs, product, llndk_mode) make_libraries(libs, product, variant, llndk_mode)
else: else:
make_tree(product) make_tree(product, variant)
def find_and_remove_path(root_path, file_name=None): def find_and_remove_path(root_path, file_name=None):
@@ -219,7 +219,8 @@ def create_source_abi_reference_dumps_for_all_products(args):
if not args.no_make_lib: if not args.no_make_lib:
# Build all the specified libs (or build the 'vndk' target if none # Build all the specified libs (or build the 'vndk' target if none
# of them are specified.) # of them are specified.)
make_libs_for_product(args.libs, args.llndk, product) make_libs_for_product(args.libs, args.llndk, product,
args.build_variant)
lsdump_paths = get_lsdump_paths(product, args.libs) lsdump_paths = get_lsdump_paths(product, args.libs)
num_processed += create_source_abi_reference_dumps( num_processed += create_source_abi_reference_dumps(
@@ -241,6 +242,8 @@ def _parse_args():
help='libs to create references for') help='libs to create references for')
parser.add_argument('-products', action='append', parser.add_argument('-products', action='append',
help='products to create references for') help='products to create references for')
parser.add_argument('--build-variant', default='userdebug',
help='build variant to create references for')
parser.add_argument('--compress', action='store_true', parser.add_argument('--compress', action='store_true',
help='compress reference dump with gzip') help='compress reference dump with gzip')
parser.add_argument('-ref-dump-dir', parser.add_argument('-ref-dump-dir',

View File

@@ -137,30 +137,30 @@ def run_header_abi_linker(output_path, inputs, version_script, api, arch,
return read_output_content(output_path, AOSP_DIR) return read_output_content(output_path, AOSP_DIR)
def make_tree(product): def make_tree(product, variant):
# To aid creation of reference dumps. # To aid creation of reference dumps.
make_cmd = ['build/soong/soong_ui.bash', '--make-mode', '-j', make_cmd = ['build/soong/soong_ui.bash', '--make-mode', '-j',
'vndk', 'findlsdumps', 'TARGET_PRODUCT=' + product] 'vndk', 'findlsdumps', 'TARGET_PRODUCT=' + product,
'TARGET_BUILD_VARIANT=' + variant]
subprocess.check_call(make_cmd, cwd=AOSP_DIR) subprocess.check_call(make_cmd, cwd=AOSP_DIR)
def make_targets(targets, product): def make_targets(targets, product, variant):
make_cmd = ['build/soong/soong_ui.bash', '--make-mode', '-j'] make_cmd = ['build/soong/soong_ui.bash', '--make-mode', '-j',
for target in targets: 'TARGET_PRODUCT=' + product, 'TARGET_BUILD_VARIANT=' + variant]
make_cmd.append(target) make_cmd += targets
make_cmd.append('TARGET_PRODUCT=' + product)
subprocess.check_call(make_cmd, cwd=AOSP_DIR, stdout=subprocess.DEVNULL, subprocess.check_call(make_cmd, cwd=AOSP_DIR, stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
def make_libraries(libs, product, llndk_mode): def make_libraries(libs, product, variant, llndk_mode):
# To aid creation of reference dumps. Makes lib.vendor for the current # To aid creation of reference dumps. Makes lib.vendor for the current
# configuration. # configuration.
lib_targets = [] lib_targets = []
for lib in libs: for lib in libs:
lib = lib if llndk_mode else lib + VENDOR_SUFFIX lib = lib if llndk_mode else lib + VENDOR_SUFFIX
lib_targets.append(lib) lib_targets.append(lib)
make_targets(lib_targets, product) make_targets(lib_targets, product, variant)
def find_lib_lsdumps(target_arch, target_arch_variant, def find_lib_lsdumps(target_arch, target_arch_variant,