Implement OtherModulePropertyErrorf proxies
Also move EvaluateConfiguration() to a standalone configurationEvalutor
object, which can be constructed from a ModuleBase and a minimial
context. This allows us to evaluate configurable properties in
scenarios where we don't have much more than the module.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I2d1c9f42a469c399f34c759410509aeae095becb
diff --git a/android/early_module_context.go b/android/early_module_context.go
index 8f75773..cf1b5fc 100644
--- a/android/early_module_context.go
+++ b/android/early_module_context.go
@@ -15,9 +15,10 @@
package android
import (
- "github.com/google/blueprint"
"os"
"text/scanner"
+
+ "github.com/google/blueprint"
)
// EarlyModuleContext provides methods that can be called early, as soon as the properties have
@@ -54,6 +55,9 @@
// 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{})
+
// Failed returns true if any errors have been reported. In most cases the module can continue with generating
// build rules after an error, allowing it to report additional errors in a single run, but in cases where the error
// has prevented the module from creating necessary data it can return early when Failed returns true.
@@ -167,3 +171,7 @@
func (e *earlyModuleContext) Namespace() *Namespace {
return e.EarlyModuleContext.Namespace().(*Namespace)
}
+
+func (e *earlyModuleContext) OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{}) {
+ e.EarlyModuleContext.OtherModulePropertyErrorf(module, property, fmt, args)
+}