Merge "Add tests for request_type ParseResult functions."

This commit is contained in:
Treehugger Robot
2021-04-13 19:08:11 +00:00
committed by Gerrit Code Review
5 changed files with 116 additions and 15 deletions

View File

@@ -483,12 +483,16 @@ type staticLibraryBazelHandler struct {
func (handler *staticLibraryBazelHandler) generateBazelBuildActions(ctx android.ModuleContext, label string) bool {
bazelCtx := ctx.Config().BazelContext
ccInfo, ok := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType)
outputPaths := ccInfo.OutputFiles
objPaths := ccInfo.CcObjectFiles
ccInfo, ok, err := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType)
if err != nil {
ctx.ModuleErrorf("Error getting Bazel CcInfo: %s", err)
return false
}
if !ok {
return ok
}
outputPaths := ccInfo.OutputFiles
objPaths := ccInfo.CcObjectFiles
if len(outputPaths) > 1 {
// TODO(cparsons): This is actually expected behavior for static libraries with no srcs.
// We should support this.

View File

@@ -329,11 +329,14 @@ type prebuiltStaticLibraryBazelHandler struct {
func (h *prebuiltStaticLibraryBazelHandler) generateBazelBuildActions(ctx android.ModuleContext, label string) bool {
bazelCtx := ctx.Config().BazelContext
ccInfo, ok := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType)
staticLibs := ccInfo.CcStaticLibraryFiles
ccInfo, ok, err := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType)
if err != nil {
ctx.ModuleErrorf("Error getting Bazel CcInfo: %s", err)
}
if !ok {
return false
}
staticLibs := ccInfo.CcStaticLibraryFiles
if len(staticLibs) > 1 {
ctx.ModuleErrorf("expected 1 static library from bazel target %q, got %s", label, staticLibs)
return false