Write relative paths to source_file fields in sdump

This commit adds --root-dir as a parameter to the ABI tools. It defaults
to current working directory. The source_file fields in the dump files
are relative to the root dir, so the file content doesn't depend on the
absolute path to Android source tree.

Test: ./header-checker-unittests
Test: ./test.py
Bug: 154177636
Change-Id: Ia07d0d3b913c921e9e91ea01c4f1e9c3c62c6ea9
This commit is contained in:
Hsin-Yi Chen
2020-06-19 19:32:10 +08:00
parent acd0ad6ab9
commit 7e15a236a3
179 changed files with 2430 additions and 2333 deletions

View File

@@ -140,7 +140,7 @@ def _run_header_abi_dumper_on_file(input_path, output_path,
# The export include dirs imply local include dirs.
for dir in export_include_dirs:
cmd += ['-I', dir]
subprocess.check_call(cmd)
subprocess.check_call(cmd, cwd=AOSP_DIR)
def run_header_abi_linker(output_path, inputs, version_script, api, arch,
@@ -154,7 +154,7 @@ def run_header_abi_linker(output_path, inputs, version_script, api, arch,
if '-output-format' not in flags:
cmd += ['-output-format', DEFAULT_FORMAT]
cmd += inputs
subprocess.check_call(cmd)
subprocess.check_call(cmd, cwd=AOSP_DIR)
return read_output_content(output_path, input_dir)