Support abi check in mixed build.

Bug: 253498204
Test: Manual tested.
Change-Id: I451a6109a2a7efa24bafc860b7b757e23fde09e1
This commit is contained in:
Yu Liu
2022-11-22 12:30:59 -08:00
parent dfc72a8ca2
commit 24214aacc2
2 changed files with 11 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ type CcInfo struct {
TidyFiles []string
TocFile string
UnstrippedOutput string
AbiDiffFiles []string
}
type getOutputFilesRequestType struct{}
@@ -174,6 +175,11 @@ clang_tidy_info = p.get("//build/bazel/rules/cc:clang_tidy.bzl%ClangTidyInfo")
if clang_tidy_info:
tidy_files = [v.path for v in clang_tidy_info.tidy_files.to_list()]
abi_diff_files = []
abi_diff_info = p.get("//build/bazel/rules/abi:abi_dump.bzl%AbiDiffInfo")
if abi_diff_info:
abi_diff_files = [f.path for f in abi_diff_info.diff_files.to_list()]
return json_encode({
"OutputFiles": outputFiles,
"CcObjectFiles": ccObjectFiles,
@@ -187,6 +193,7 @@ return json_encode({
"TidyFiles": tidy_files,
"TocFile": toc_file,
"UnstrippedOutput": unstripped,
"AbiDiffFiles": abi_diff_files,
})`
}

View File

@@ -898,6 +898,10 @@ func (handler *ccLibraryBazelHandler) generateSharedBazelBuildActions(ctx androi
}
handler.module.linker.(*libraryDecorator).tocFile = tocFile
if len(ccInfo.AbiDiffFiles) > 0 {
handler.module.linker.(*libraryDecorator).sAbiDiff = android.PathsForBazelOut(ctx, ccInfo.AbiDiffFiles)
}
ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
TableOfContents: tocFile,
SharedLibrary: outputFilePath,