Loading android/configurable_properties.go +6 −0 Original line number Diff line number Diff line Loading @@ -26,3 +26,9 @@ func CreateSelectOsToBool(cases map[string]*bool) proptools.Configurable[bool] { resultCases, ) } func NewSimpleConfigurable[T proptools.ConfigurableElements](value T) proptools.Configurable[T] { return proptools.NewConfigurable(nil, []proptools.ConfigurableCase[T]{ proptools.NewConfigurableCase(nil, &value), }) } android/prebuilt.go +3 −7 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ var _ ExcludeFromApexContentsTag = PrebuiltDepTag type UserSuppliedPrebuiltProperties struct { // When prefer is set to true the prebuilt will be used instead of any source module with // a matching name. Prefer *bool `android:"arch_variant"` Prefer proptools.Configurable[bool] `android:"arch_variant,replace_instead_of_append"` // When specified this names a Soong config variable that controls the prefer property. // Loading Loading @@ -148,11 +148,7 @@ func PrebuiltNameFromSource(name string) string { } func (p *Prebuilt) ForcePrefer() { p.properties.Prefer = proptools.BoolPtr(true) } func (p *Prebuilt) Prefer() bool { return proptools.Bool(p.properties.Prefer) p.properties.Prefer = NewSimpleConfigurable(true) } // SingleSourcePathFromSupplier invokes the supplied supplier for the current module in the Loading Loading @@ -707,7 +703,7 @@ func (p *Prebuilt) usePrebuilt(ctx BaseMutatorContext, source Module, prebuilt M } // TODO: use p.Properties.Name and ctx.ModuleDir to override preference return Bool(p.properties.Prefer) return p.properties.Prefer.GetOrDefault(ctx, false) } func (p *Prebuilt) SourceExists() bool { Loading Loading
android/configurable_properties.go +6 −0 Original line number Diff line number Diff line Loading @@ -26,3 +26,9 @@ func CreateSelectOsToBool(cases map[string]*bool) proptools.Configurable[bool] { resultCases, ) } func NewSimpleConfigurable[T proptools.ConfigurableElements](value T) proptools.Configurable[T] { return proptools.NewConfigurable(nil, []proptools.ConfigurableCase[T]{ proptools.NewConfigurableCase(nil, &value), }) }
android/prebuilt.go +3 −7 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ var _ ExcludeFromApexContentsTag = PrebuiltDepTag type UserSuppliedPrebuiltProperties struct { // When prefer is set to true the prebuilt will be used instead of any source module with // a matching name. Prefer *bool `android:"arch_variant"` Prefer proptools.Configurable[bool] `android:"arch_variant,replace_instead_of_append"` // When specified this names a Soong config variable that controls the prefer property. // Loading Loading @@ -148,11 +148,7 @@ func PrebuiltNameFromSource(name string) string { } func (p *Prebuilt) ForcePrefer() { p.properties.Prefer = proptools.BoolPtr(true) } func (p *Prebuilt) Prefer() bool { return proptools.Bool(p.properties.Prefer) p.properties.Prefer = NewSimpleConfigurable(true) } // SingleSourcePathFromSupplier invokes the supplied supplier for the current module in the Loading Loading @@ -707,7 +703,7 @@ func (p *Prebuilt) usePrebuilt(ctx BaseMutatorContext, source Module, prebuilt M } // TODO: use p.Properties.Name and ctx.ModuleDir to override preference return Bool(p.properties.Prefer) return p.properties.Prefer.GetOrDefault(ctx, false) } func (p *Prebuilt) SourceExists() bool { Loading