Merge "Syntax check generated Android.bp snapshot"

This commit is contained in:
Paul Duffin
2020-05-19 07:53:27 +00:00
committed by Gerrit Code Review
2 changed files with 44 additions and 0 deletions

View File

@@ -104,6 +104,8 @@ type EarlyModuleContext interface {
type BaseModuleContext interface {
EarlyModuleContext
blueprintBaseModuleContext() blueprint.BaseModuleContext
OtherModuleName(m blueprint.Module) string
OtherModuleDir(m blueprint.Module) string
OtherModuleErrorf(m blueprint.Module, fmt string, args ...interface{})
@@ -1439,6 +1441,10 @@ func (b *baseModuleContext) GetDirectDepWithTag(name string, tag blueprint.Depen
return b.bp.GetDirectDepWithTag(name, tag)
}
func (b *baseModuleContext) blueprintBaseModuleContext() blueprint.BaseModuleContext {
return b.bp
}
type moduleContext struct {
bp blueprint.ModuleContext
baseModuleContext
@@ -2361,3 +2367,8 @@ type IdeInfo struct {
Installed_paths []string `json:"installed,omitempty"`
SrcJars []string `json:"srcjars,omitempty"`
}
func CheckBlueprintSyntax(ctx BaseModuleContext, filename string, contents string) []error {
bpctx := ctx.blueprintBaseModuleContext()
return blueprint.CheckBlueprintSyntax(bpctx.ModuleFactories(), filename, contents)
}