diff options
author | Colin Cross <ccross@android.com> | 2015-03-26 16:10:12 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2015-03-27 15:58:25 -0700 |
commit | c9404350293d3a1f3bc97a38c93914931c0165d3 (patch) | |
tree | a025de4b365b34499ff50303abd4a68f1e1a5e23 | |
parent | 1f8f234c336bac2f6a0bf3bf935accbc3c28491e (diff) | |
download | build_soong-c9404350293d3a1f3bc97a38c93914931c0165d3.tar.gz build_soong-c9404350293d3a1f3bc97a38c93914931c0165d3.tar.bz2 build_soong-c9404350293d3a1f3bc97a38c93914931c0165d3.zip |
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
-rw-r--r-- | common/module.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/common/module.go b/common/module.go index 3cb4c09d..d420fe1f 100644 --- a/common/module.go +++ b/common/module.go @@ -254,12 +254,9 @@ func (a *AndroidModuleBase) generateModuleTarget(ctx blueprint.ModuleContext) { 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 @@ func (a *AndroidModuleBase) GenerateBuildActions(ctx blueprint.ModuleContext) { 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 { |