Merge changes from topic "clang-tidy-mixed-builds"
* changes:
add tidy files to mixed builds
add --norun_validations to bazel build action
diff --git a/android/bazel_handler.go b/android/bazel_handler.go
index f289c56..d014fc6 100644
--- a/android/bazel_handler.go
+++ b/android/bazel_handler.go
@@ -571,7 +571,9 @@
// Suppress noise
"--ui_event_filters=-INFO",
- "--noshow_progress"}
+ "--noshow_progress",
+ "--norun_validations",
+ }
cmdFlags = append(cmdFlags, extraFlags...)
bazelCmd := exec.Command(paths.bazelPath, cmdFlags...)
diff --git a/bazel/cquery/request_type.go b/bazel/cquery/request_type.go
index b99780a..5bf9fb2 100644
--- a/bazel/cquery/request_type.go
+++ b/bazel/cquery/request_type.go
@@ -30,6 +30,7 @@
// be a subset of OutputFiles. (or shared libraries, this will be equal to OutputFiles,
// but general cc_library will also have dynamic libraries in output files).
RootDynamicLibraries []string
+ TidyFiles []string
TocFile string
UnstrippedOutput string
}
@@ -165,6 +166,12 @@
# NOTE: It's OK if there's no ToC, as Soong just uses it for optimization
pass
+tidy_files = []
+p = providers(target)
+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()]
+
return json_encode({
"OutputFiles": outputFiles,
"CcObjectFiles": ccObjectFiles,
@@ -175,6 +182,7 @@
"Headers": headers,
"RootStaticArchives": rootStaticArchives,
"RootDynamicLibraries": rootSharedLibraries,
+ "TidyFiles": tidy_files,
"TocFile": toc_file,
"UnstrippedOutput": unstripped,
})`
diff --git a/cc/cc.go b/cc/cc.go
index 8840631..306e483 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1853,6 +1853,11 @@
func (c *Module) ProcessBazelQueryResponse(ctx android.ModuleContext) {
bazelModuleLabel := c.getBazelModuleLabel(ctx)
+ bazelCtx := ctx.Config().BazelContext
+ if ccInfo, err := bazelCtx.GetCcInfo(bazelModuleLabel, android.GetConfigKey(ctx)); err == nil {
+ c.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
+ }
+
c.bazelHandler.ProcessBazelQueryResponse(ctx, bazelModuleLabel)
c.Properties.SubName = GetSubnameProperty(ctx, c)