Skip creating variants for disabled OSes

The documentation java_genrule_host states that it creates a single
variant, which would make it work with the single variant fallback
in AddDependency used by the data property, but it actually has a host
and a host-cross windows variant.  Modify osMutator to take the
OS-specific enabled properties into account to skip creating variants
that will immediately be disabled so there is a single variant.

Test: m checkbuild
Change-Id: Ic2daab29f4fa3a3797d7a08348fbfcf1036ec5dc
This commit is contained in:
Colin Cross
2020-11-16 22:44:30 -08:00
parent 34037c66ae
commit d976af0cb4
5 changed files with 56 additions and 8 deletions

View File

@@ -174,20 +174,22 @@ func (d *DefaultsModuleBase) GenerateAndroidBuildActions(ctx ModuleContext) {
func InitDefaultsModule(module DefaultsModule) {
commonProperties := &commonProperties{}
enabledProperties := &enabledProperties{}
module.AddProperties(
&hostAndDeviceProperties{},
enabledProperties,
commonProperties,
&ApexProperties{},
&distProperties{})
base := module.base()
initAndroidModuleBase(module)
initProductVariableModule(module)
InitArchModule(module)
InitDefaultableModule(module)
// Add properties that will not have defaults applied to them.
base := module.base()
defaultsVisibility := &DefaultsVisibilityProperties{}
module.AddProperties(&base.nameProperties, defaultsVisibility)