Fix checkbuild files on last variant
The context checkbuild files were not copied to the module checkbuild
files before calling generateModuleTarget, which would cause them
to not be considered, and in the case of a module with a single
variant, cause a build failure when the checkbuild target was skipped.
Change-Id: I77faafdc1a8a866e3c2c1157f987015b553acf01
diff --git a/common/module.go b/common/module.go
index 3cb4c09..d420fe1 100644
--- a/common/module.go
+++ b/common/module.go
@@ -254,12 +254,9 @@
allInstalledFiles := []string{}
allCheckbuildFiles := []string{}
ctx.VisitAllModuleVariants(func(module blueprint.Module) {
- if androidModule, ok := module.(AndroidModule); ok {
- files := androidModule.base().installFiles
- allInstalledFiles = append(allInstalledFiles, files...)
- files = androidModule.base().checkbuildFiles
- allCheckbuildFiles = append(allCheckbuildFiles, files...)
- }
+ a := module.(AndroidModule).base()
+ allInstalledFiles = append(allInstalledFiles, a.installFiles...)
+ allCheckbuildFiles = append(allCheckbuildFiles, a.checkbuildFiles...)
})
deps := []string{}
@@ -329,13 +326,13 @@
return
}
+ a.installFiles = append(a.installFiles, androidCtx.installFiles...)
+ a.checkbuildFiles = append(a.checkbuildFiles, androidCtx.checkbuildFiles...)
+
a.generateModuleTarget(ctx)
if ctx.Failed() {
return
}
-
- a.installFiles = append(a.installFiles, androidCtx.installFiles...)
- a.checkbuildFiles = append(a.checkbuildFiles, androidCtx.checkbuildFiles...)
}
type androidBaseContextImpl struct {