Loading android/base_module_context.go +0 −8 Original line number Diff line number Diff line Loading @@ -200,10 +200,6 @@ type BaseModuleContext interface { // EvaluateConfiguration makes ModuleContext a valid proptools.ConfigurableEvaluator, so this context // can be used to evaluate the final value of Configurable properties. EvaluateConfiguration(condition proptools.ConfigurableCondition, property string) proptools.ConfigurableValue // HasMutatorFinished returns true if the given mutator has finished running. // It will panic if given an invalid mutator name. HasMutatorFinished(mutatorName string) bool } type baseModuleContext struct { Loading Loading @@ -254,10 +250,6 @@ func (b *baseModuleContext) setProvider(provider blueprint.AnyProviderKey, value b.bp.SetProvider(provider, value) } func (b *baseModuleContext) HasMutatorFinished(mutatorName string) bool { return b.bp.HasMutatorFinished(mutatorName) } func (b *baseModuleContext) GetDirectDepWithTag(name string, tag blueprint.DependencyTag) blueprint.Module { return b.bp.GetDirectDepWithTag(name, tag) } Loading android/early_module_context.go +8 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,10 @@ type EarlyModuleContext interface { // Namespace returns the Namespace object provided by the NameInterface set by Context.SetNameInterface, or the // default SimpleNameInterface if Context.SetNameInterface was not called. Namespace() *Namespace // HasMutatorFinished returns true if the given mutator has finished running. // It will panic if given an invalid mutator name. HasMutatorFinished(mutatorName string) bool } // Deprecated: use EarlyModuleContext instead Loading Loading @@ -175,3 +179,7 @@ func (e *earlyModuleContext) Namespace() *Namespace { func (e *earlyModuleContext) OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{}) { e.EarlyModuleContext.OtherModulePropertyErrorf(module, property, fmt, args...) } func (e *earlyModuleContext) HasMutatorFinished(mutatorName string) bool { return e.EarlyModuleContext.HasMutatorFinished(mutatorName) } android/hooks.go +7 −0 Original line number Diff line number Diff line Loading @@ -95,10 +95,17 @@ func (l *loadHookContext) createModule(factory blueprint.ModuleFactory, name str type createModuleContext interface { Module() Module HasMutatorFinished(mutatorName string) bool createModule(blueprint.ModuleFactory, string, ...interface{}) blueprint.Module } func createModule(ctx createModuleContext, factory ModuleFactory, ext string, props ...interface{}) Module { if ctx.HasMutatorFinished("defaults") { // Creating modules late is oftentimes problematic, because they don't have earlier // mutators run on them. Prevent making modules after the defaults mutator has run. panic("Cannot create a module after the defaults mutator has finished") } inherited := []interface{}{&ctx.Module().base().commonProperties} var typeName string Loading Loading
android/base_module_context.go +0 −8 Original line number Diff line number Diff line Loading @@ -200,10 +200,6 @@ type BaseModuleContext interface { // EvaluateConfiguration makes ModuleContext a valid proptools.ConfigurableEvaluator, so this context // can be used to evaluate the final value of Configurable properties. EvaluateConfiguration(condition proptools.ConfigurableCondition, property string) proptools.ConfigurableValue // HasMutatorFinished returns true if the given mutator has finished running. // It will panic if given an invalid mutator name. HasMutatorFinished(mutatorName string) bool } type baseModuleContext struct { Loading Loading @@ -254,10 +250,6 @@ func (b *baseModuleContext) setProvider(provider blueprint.AnyProviderKey, value b.bp.SetProvider(provider, value) } func (b *baseModuleContext) HasMutatorFinished(mutatorName string) bool { return b.bp.HasMutatorFinished(mutatorName) } func (b *baseModuleContext) GetDirectDepWithTag(name string, tag blueprint.DependencyTag) blueprint.Module { return b.bp.GetDirectDepWithTag(name, tag) } Loading
android/early_module_context.go +8 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,10 @@ type EarlyModuleContext interface { // Namespace returns the Namespace object provided by the NameInterface set by Context.SetNameInterface, or the // default SimpleNameInterface if Context.SetNameInterface was not called. Namespace() *Namespace // HasMutatorFinished returns true if the given mutator has finished running. // It will panic if given an invalid mutator name. HasMutatorFinished(mutatorName string) bool } // Deprecated: use EarlyModuleContext instead Loading Loading @@ -175,3 +179,7 @@ func (e *earlyModuleContext) Namespace() *Namespace { func (e *earlyModuleContext) OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{}) { e.EarlyModuleContext.OtherModulePropertyErrorf(module, property, fmt, args...) } func (e *earlyModuleContext) HasMutatorFinished(mutatorName string) bool { return e.EarlyModuleContext.HasMutatorFinished(mutatorName) }
android/hooks.go +7 −0 Original line number Diff line number Diff line Loading @@ -95,10 +95,17 @@ func (l *loadHookContext) createModule(factory blueprint.ModuleFactory, name str type createModuleContext interface { Module() Module HasMutatorFinished(mutatorName string) bool createModule(blueprint.ModuleFactory, string, ...interface{}) blueprint.Module } func createModule(ctx createModuleContext, factory ModuleFactory, ext string, props ...interface{}) Module { if ctx.HasMutatorFinished("defaults") { // Creating modules late is oftentimes problematic, because they don't have earlier // mutators run on them. Prevent making modules after the defaults mutator has run. panic("Cannot create a module after the defaults mutator has finished") } inherited := []interface{}{&ctx.Module().base().commonProperties} var typeName string Loading