Merge "Fix bp2build-progress generating an empty converted_modules list, and duplicate module names."

This commit is contained in:
Jingwen Chen 2021-09-21 00:24:36 +00:00 committed by Gerrit Code Review
commit b3c3d9a2d5
2 changed files with 3 additions and 4 deletions

View file

@ -308,9 +308,8 @@ func GenerateBazelTargets(ctx *CodegenContext, generateFilegroups bool) (convers
}
}
targets = generateBazelTargets(bpCtx, aModule)
metrics.AddConvertedModule(m.Name())
for _, t := range targets {
// only add targets that exist in Soong to compatibility layer
metrics.AddConvertedModule(m.Name())
metrics.RuleClassCount[t.ruleClass] += 1
}
} else {

View file

@ -24,7 +24,7 @@ type CodegenMetrics struct {
}
// Print the codegen metrics to stdout.
func (metrics CodegenMetrics) Print() {
func (metrics *CodegenMetrics) Print() {
generatedTargetCount := 0
for _, ruleClass := range android.SortedStringKeys(metrics.RuleClassCount) {
count := metrics.RuleClassCount[ruleClass]
@ -40,7 +40,7 @@ func (metrics CodegenMetrics) Print() {
strings.Join(metrics.moduleWithUnconvertedDepsMsgs, "\n\t"))
}
func (metrics CodegenMetrics) AddConvertedModule(moduleName string) {
func (metrics *CodegenMetrics) AddConvertedModule(moduleName string) {
// Undo prebuilt_ module name prefix modifications
moduleName = android.RemoveOptionalPrebuiltPrefix(moduleName)
metrics.convertedModules = append(metrics.convertedModules, moduleName)