Merge "Remove uncompressed prebuilt dumps before building new ones"
This commit is contained in:
@@ -3,13 +3,13 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import collections
|
import collections
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import shutil
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from utils import (
|
from utils import (
|
||||||
AOSP_DIR, COMPRESSED_SOURCE_ABI_DUMP_EXT, SOURCE_ABI_DUMP_EXT_END, SO_EXT,
|
AOSP_DIR, COMPRESSED_SOURCE_ABI_DUMP_EXT, SOURCE_ABI_DUMP_EXT,
|
||||||
copy_reference_dumps, find_lib_lsdumps, get_build_vars_for_product,
|
SOURCE_ABI_DUMP_EXT_END, SO_EXT, copy_reference_dumps, find_lib_lsdumps,
|
||||||
make_libraries, make_tree)
|
get_build_vars_for_product, make_libraries, make_tree)
|
||||||
|
|
||||||
|
|
||||||
PRODUCTS_DEFAULT = ['aosp_arm_ab', 'aosp_arm', 'aosp_arm64', 'aosp_x86_ab',
|
PRODUCTS_DEFAULT = ['aosp_arm_ab', 'aosp_arm', 'aosp_arm64', 'aosp_x86_ab',
|
||||||
@@ -110,14 +110,17 @@ def make_libs_for_product(libs, llndk_mode, product):
|
|||||||
def find_and_remove_path(root_path, file_name=None):
|
def find_and_remove_path(root_path, file_name=None):
|
||||||
if file_name is not None:
|
if file_name is not None:
|
||||||
root_path = os.path.join(root_path, 'source-based', file_name)
|
root_path = os.path.join(root_path, 'source-based', file_name)
|
||||||
remove_cmd_str = 'rm -rf ' + root_path
|
|
||||||
print('removing', root_path)
|
if os.path.exists(root_path):
|
||||||
subprocess.check_call(remove_cmd_str, shell=True)
|
print('removing', root_path)
|
||||||
|
if os.path.isfile(root_path):
|
||||||
|
os.remove(root_path)
|
||||||
|
else:
|
||||||
|
shutil.rmtree(root_path)
|
||||||
|
|
||||||
|
|
||||||
def remove_references_for_all_arches_and_variants(args, product, targets,
|
def remove_references_for_all_arches_and_variants(args, product, targets,
|
||||||
chosen_vndk_version):
|
chosen_vndk_version):
|
||||||
print('Removing reference dumps...')
|
|
||||||
libs = args.libs
|
libs = args.libs
|
||||||
for target in targets:
|
for target in targets:
|
||||||
if target.arch == '' or target.arch_variant == '':
|
if target.arch == '' or target.arch_variant == '':
|
||||||
@@ -133,8 +136,12 @@ def remove_references_for_all_arches_and_variants(args, product, targets,
|
|||||||
|
|
||||||
if libs:
|
if libs:
|
||||||
for lib in libs:
|
for lib in libs:
|
||||||
|
find_and_remove_path(dir_to_remove_vndk,
|
||||||
|
lib + SOURCE_ABI_DUMP_EXT)
|
||||||
find_and_remove_path(dir_to_remove_vndk,
|
find_and_remove_path(dir_to_remove_vndk,
|
||||||
lib + COMPRESSED_SOURCE_ABI_DUMP_EXT)
|
lib + COMPRESSED_SOURCE_ABI_DUMP_EXT)
|
||||||
|
find_and_remove_path(dir_to_remove_ndk,
|
||||||
|
lib + SOURCE_ABI_DUMP_EXT)
|
||||||
find_and_remove_path(dir_to_remove_ndk,
|
find_and_remove_path(dir_to_remove_ndk,
|
||||||
lib + COMPRESSED_SOURCE_ABI_DUMP_EXT)
|
lib + COMPRESSED_SOURCE_ABI_DUMP_EXT)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user