Allow variable-prefixed include statements in mk2rbc
mk2rbc was already searching the whole android tree for Makefiles, so allowing variable-prefixed include statements doesn't affect performance on the file searching front. On the generated code front, there's already a cap of 150 potentially-included makefiles that prevents the performance from getting too bad, and it can be lowered if necessary. Bug: 213508006 Test: go test Change-Id: I3a4e81acb3d97bee08ac3dbe63052a274acf5793
This commit is contained in:
@@ -86,6 +86,8 @@ type inheritedDynamicModule struct {
|
||||
path interpolateExpr
|
||||
candidateModules []*moduleInfo
|
||||
loadAlways bool
|
||||
location ErrorLocation
|
||||
needsWarning bool
|
||||
}
|
||||
|
||||
func (i inheritedDynamicModule) name() string {
|
||||
@@ -97,6 +99,10 @@ func (i inheritedDynamicModule) entryName() string {
|
||||
}
|
||||
|
||||
func (i inheritedDynamicModule) emitSelect(gctx *generationContext) {
|
||||
if i.needsWarning {
|
||||
gctx.newLine()
|
||||
gctx.writef("%s.mkwarning(%q, %q)", baseName, i.location, "Including a path with a non-constant prefix, please convert this to a simple literal to generate cleaner starlark.")
|
||||
}
|
||||
gctx.newLine()
|
||||
gctx.writef("_entry = {")
|
||||
gctx.indentLevel++
|
||||
|
Reference in New Issue
Block a user