From 7228ecd5e3c9282e7e6f4a81d81fd333cb08eaff Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 18 Nov 2019 16:00:16 -0800 Subject: Move cc.imageMutator into the android package Prepare for making the image mutator available to all modules and moving it between the os and arch mutators by moving it into the android package and using an interface implemented by the module types to control it. Bug: 142286466 Test: No unexpected changes to out/soong/build.ninja Change-Id: I0dcc9c7b5ec80edffade340c367f6ae4da34151b --- android/module.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'android/module.go') diff --git a/android/module.go b/android/module.go index fa6388cb8..9e16e50f0 100644 --- a/android/module.go +++ b/android/module.go @@ -431,6 +431,9 @@ type commonProperties struct { DebugName string `blueprint:"mutated"` DebugMutators []string `blueprint:"mutated"` DebugVariations []string `blueprint:"mutated"` + + // set by ImageMutator + ImageVariation string `blueprint:"mutated"` } type hostAndDeviceProperties struct { @@ -865,6 +868,21 @@ func (m *ModuleBase) NoticeFile() OptionalPath { return m.noticeFile } +func (m *ModuleBase) setImageVariation(variant string) { + m.commonProperties.ImageVariation = variant +} + +func (m *ModuleBase) ImageVariation() blueprint.Variation { + return blueprint.Variation{ + Mutator: "image", + Variation: m.base().commonProperties.ImageVariation, + } +} + +func (m *ModuleBase) InRecovery() bool { + return m.base().commonProperties.ImageVariation == RecoveryVariation +} + func (m *ModuleBase) generateModuleTarget(ctx ModuleContext) { allInstalledFiles := Paths{} allCheckbuildFiles := Paths{} -- cgit v1.2.3-59-g8ed1b