From 9b1d13db73bc5ea0c6df385202b3f47867ecbf31 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 19 Sep 2016 15:18:11 -0700 Subject: [PATCH] Fix checkbuild for modules with last variant disabled The soong checkbuild target is created by the last varaint of each module. Don't return early if the variant is disabled, which would prevent creating the checkbuild target. Test: m -j checkbuild Change-Id: Ib260bae7fb4be7255f5c1b34dfbd50225f308005 --- android/module.go | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/android/module.go b/android/module.go index e415c0a5a..95bd9ea07 100644 --- a/android/module.go +++ b/android/module.go @@ -366,10 +366,6 @@ func (p *ModuleBase) InstallInData() bool { } func (a *ModuleBase) generateModuleTarget(ctx blueprint.ModuleContext) { - if a != ctx.FinalModule().(Module).base() { - return - } - allInstalledFiles := Paths{} allCheckbuildFiles := Paths{} ctx.VisitAllModuleVariants(func(module blueprint.Module) { @@ -439,21 +435,21 @@ func (a *ModuleBase) GenerateBuildActions(ctx blueprint.ModuleContext) { missingDeps: ctx.GetMissingDependencies(), } - if !a.Enabled() { - return + if a.Enabled() { + a.module.GenerateAndroidBuildActions(androidCtx) + if ctx.Failed() { + return + } + + a.installFiles = append(a.installFiles, androidCtx.installFiles...) + a.checkbuildFiles = append(a.checkbuildFiles, androidCtx.checkbuildFiles...) } - a.module.GenerateAndroidBuildActions(androidCtx) - if ctx.Failed() { - return - } - - a.installFiles = append(a.installFiles, androidCtx.installFiles...) - a.checkbuildFiles = append(a.checkbuildFiles, androidCtx.checkbuildFiles...) - - a.generateModuleTarget(ctx) - if ctx.Failed() { - return + if a == ctx.FinalModule().(Module).base() { + a.generateModuleTarget(ctx) + if ctx.Failed() { + return + } } }