Rename soong outdir to generated-headers

vndk snapshot captures exported headers as-is, but soong intermediates
directory name is used as a result. It may confuse users, so this
changes the intermediates directory name to "generated-headers".

Bug: 200159267
Test: install snapshot and build
Change-Id: I3da7ee98f53e460c448c05ad3456022888099888
This commit is contained in:
Inseob Kim
2021-09-24 13:17:06 +09:00
parent 3dab1f72f7
commit 6547080f72
3 changed files with 17 additions and 3 deletions

View File

@@ -525,6 +525,10 @@ class GenBuildFile(object):
dirs=dirs,
name=name))
def rename_generated_dirs(dirs):
# Reame out/soong/.intermedaites to generated-headers for better readability.
return [d.replace(utils.SOONG_INTERMEDIATES_DIR, utils.GENERATED_HEADERS_DIR, 1) for d in dirs]
for src in sorted(src_paths):
include_dirs = ''
system_include_dirs = ''
@@ -541,10 +545,12 @@ class GenBuildFile(object):
if prebuilt == 'android.hidl.memory@1.0-impl.so':
props['RelativeInstallPath'] = 'hw'
if 'ExportedDirs' in props:
l = ['include/%s' % d for d in props['ExportedDirs']]
dirs = rename_generated_dirs(props['ExportedDirs'])
l = ['include/%s' % d for d in dirs]
include_dirs = list_to_prop_value(l, 'export_include_dirs')
if 'ExportedSystemDirs' in props:
l = ['include/%s' % d for d in props['ExportedSystemDirs']]
dirs = rename_generated_dirs(props['ExportedSystemDirs'])
l = ['include/%s' % d for d in dirs]
system_include_dirs = list_to_prop_value(l, 'export_system_include_dirs')
if 'ExportedFlags' in props:
flags = list_to_prop_value(props['ExportedFlags'], 'export_flags')

View File

@@ -95,6 +95,13 @@ def install_snapshot(branch, build, local_dir, install_dir, temp_artifact_dir):
logging.info('Unzipping VNDK snapshot: {}'.format(artifact))
utils.check_call(['unzip', '-qn', artifact, '-d', install_dir])
# rename {install_dir}/{arch}/include/out/soong/.intermediates
for soong_intermediates_dir in glob.glob(install_dir + '/*/include/' + utils.SOONG_INTERMEDIATES_DIR):
generated_headers_dir = soong_intermediates_dir.replace(
utils.SOONG_INTERMEDIATES_DIR,
utils.GENERATED_HEADERS_DIR
)
os.rename(soong_intermediates_dir, generated_headers_dir)
def gather_notice_files(install_dir):
"""Gathers all NOTICE files to a common NOTICE_FILES directory."""

View File

@@ -37,7 +37,8 @@ NOTICE_FILES_DIR_NAME = 'NOTICE_FILES'
NOTICE_FILES_DIR_PATH = os.path.join(COMMON_DIR_PATH, NOTICE_FILES_DIR_NAME)
BINDER32 = 'binder32'
MINIMUM_VNDK_VERSION = 28
SOONG_INTERMEDIATES_DIR = 'out/soong/.intermediates'
GENERATED_HEADERS_DIR = 'generated-headers'
def set_logging_config(verbose_level):
verbose_map = (logging.WARNING, logging.INFO, logging.DEBUG)