Loading android/early_module_context.go +11 −6 Original line number Diff line number Diff line Loading @@ -21,9 +21,20 @@ import ( "github.com/google/blueprint" ) // ModuleErrorContext provides only methods to report errors about the current module. type ModuleErrorContext interface { // ModuleErrorf reports an error at the line number of the module type in the module definition. ModuleErrorf(fmt string, args ...interface{}) // PropertyErrorf reports an error at the line number of a property in the module definition. PropertyErrorf(property, fmt string, args ...interface{}) } // EarlyModuleContext provides methods that can be called early, as soon as the properties have // been parsed into the module and before any mutators have run. type EarlyModuleContext interface { ModuleErrorContext // Module returns the current module as a Module. It should rarely be necessary, as the module already has a // reference to itself. Module() Module Loading @@ -49,12 +60,6 @@ type EarlyModuleContext interface { // Errorf reports an error at the specified position of the module definition file. Errorf(pos scanner.Position, fmt string, args ...interface{}) // ModuleErrorf reports an error at the line number of the module type in the module definition. ModuleErrorf(fmt string, args ...interface{}) // PropertyErrorf reports an error at the line number of a property in the module definition. PropertyErrorf(property, fmt string, args ...interface{}) // OtherModulePropertyErrorf reports an error at the line number of a property in the given module definition. OtherModulePropertyErrorf(module Module, property, fmt string, args ...interface{}) Loading android/mutator.go +9 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,7 @@ func (x *registerMutatorsContext) BottomUpBlueprint(name string, m blueprint.Bot type IncomingTransitionContext interface { ArchModuleContext ModuleProviderContext ModuleErrorContext // Module returns the target of the dependency edge for which the transition // is being computed Loading Loading @@ -539,6 +540,14 @@ func (c *incomingTransitionContextImpl) provider(provider blueprint.AnyProviderK return c.bp.Provider(provider) } func (c *incomingTransitionContextImpl) ModuleErrorf(fmt string, args ...interface{}) { c.bp.ModuleErrorf(fmt, args) } func (c *incomingTransitionContextImpl) PropertyErrorf(property, fmt string, args ...interface{}) { c.bp.PropertyErrorf(property, fmt, args) } func (a *androidTransitionMutator) IncomingTransition(bpctx blueprint.IncomingTransitionContext, incomingVariation string) string { if m, ok := bpctx.Module().(Module); ok { ctx := incomingTransitionContextPool.Get().(*incomingTransitionContextImpl) Loading Loading
android/early_module_context.go +11 −6 Original line number Diff line number Diff line Loading @@ -21,9 +21,20 @@ import ( "github.com/google/blueprint" ) // ModuleErrorContext provides only methods to report errors about the current module. type ModuleErrorContext interface { // ModuleErrorf reports an error at the line number of the module type in the module definition. ModuleErrorf(fmt string, args ...interface{}) // PropertyErrorf reports an error at the line number of a property in the module definition. PropertyErrorf(property, fmt string, args ...interface{}) } // EarlyModuleContext provides methods that can be called early, as soon as the properties have // been parsed into the module and before any mutators have run. type EarlyModuleContext interface { ModuleErrorContext // Module returns the current module as a Module. It should rarely be necessary, as the module already has a // reference to itself. Module() Module Loading @@ -49,12 +60,6 @@ type EarlyModuleContext interface { // Errorf reports an error at the specified position of the module definition file. Errorf(pos scanner.Position, fmt string, args ...interface{}) // ModuleErrorf reports an error at the line number of the module type in the module definition. ModuleErrorf(fmt string, args ...interface{}) // PropertyErrorf reports an error at the line number of a property in the module definition. PropertyErrorf(property, fmt string, args ...interface{}) // OtherModulePropertyErrorf reports an error at the line number of a property in the given module definition. OtherModulePropertyErrorf(module Module, property, fmt string, args ...interface{}) Loading
android/mutator.go +9 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,7 @@ func (x *registerMutatorsContext) BottomUpBlueprint(name string, m blueprint.Bot type IncomingTransitionContext interface { ArchModuleContext ModuleProviderContext ModuleErrorContext // Module returns the target of the dependency edge for which the transition // is being computed Loading Loading @@ -539,6 +540,14 @@ func (c *incomingTransitionContextImpl) provider(provider blueprint.AnyProviderK return c.bp.Provider(provider) } func (c *incomingTransitionContextImpl) ModuleErrorf(fmt string, args ...interface{}) { c.bp.ModuleErrorf(fmt, args) } func (c *incomingTransitionContextImpl) PropertyErrorf(property, fmt string, args ...interface{}) { c.bp.PropertyErrorf(property, fmt, args) } func (a *androidTransitionMutator) IncomingTransition(bpctx blueprint.IncomingTransitionContext, incomingVariation string) string { if m, ok := bpctx.Module().(Module); ok { ctx := incomingTransitionContextPool.Get().(*incomingTransitionContextImpl) Loading