Start unblocking com.android.runtime deps

Adds support to warn rather than error about missing deps in order to
suport modules in build/soong with deps outside of build/sooong in
bp2build integration tests.

Test: build/bazel/ci/bp2build.sh
Change-Id: I1282bccd37a3fc9f33555d34e68d7f0873d8272c
This commit is contained in:
Liz Kammer
2021-12-15 15:35:38 -05:00
parent 4fd34e1a6d
commit daa09efb5e
6 changed files with 105 additions and 16 deletions

View File

@@ -324,6 +324,15 @@ func GenerateBazelTargets(ctx *CodegenContext, generateFilegroups bool) (convers
return
}
}
if unconvertedDeps := aModule.GetMissingBp2buildDeps(); len(unconvertedDeps) > 0 {
msg := fmt.Sprintf("%q depends on missing modules: %s", m.Name(), strings.Join(unconvertedDeps, ", "))
if ctx.unconvertedDepMode == warnUnconvertedDeps {
metrics.moduleWithMissingDepsMsgs = append(metrics.moduleWithMissingDepsMsgs, msg)
} else if ctx.unconvertedDepMode == errorModulesUnconvertedDeps {
errs = append(errs, fmt.Errorf(msg))
return
}
}
targets = generateBazelTargets(bpCtx, aModule)
for _, t := range targets {
// A module can potentially generate more than 1 Bazel