Merge "Disable "__builtin_func" when converting mk to bp" into main

This commit is contained in:
Treehugger Robot 2024-03-26 02:30:35 +00:00 committed by Gerrit Code Review
commit f7e7776079
2 changed files with 18 additions and 4 deletions

View file

@ -510,6 +510,22 @@ endif # b==false
// endif // endif
`, `,
}, },
{
// Unsupported function case because that doesn't work in bp
desc: "error for unsupported functions",
in: `
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(filter-out filter-out-file.java ,$(call all-java-files-under, src))
LOCAL_PACKAGE_NAME := foo
include $(BUILD_PACKAGE)
`,
expected: `
android_app {
name: "foo",
srcs: ["UNSUPPORTED FUNCTION:filter-out filter-out-file.java src/**/*.java"],
}
`,
},
{ {
desc: "ignore all-makefiles-under", desc: "ignore all-makefiles-under",
in: ` in: `

View file

@ -14,9 +14,7 @@
package parser package parser
import ( import "strings"
"strings"
)
type Scope interface { type Scope interface {
Get(name string) string Get(name string) string
@ -88,7 +86,7 @@ func (v Variable) EvalFunction(scope Scope) ([]string, bool) {
if fname == "call" { if fname == "call" {
return scope.Call(argVals[0], argVals[1:]), true return scope.Call(argVals[0], argVals[1:]), true
} else { } else {
return []string{"__builtin_func:" + fname + " " + strings.Join(argVals, " ")}, true return []string{"UNSUPPORTED FUNCTION:" + fname + " " + strings.Join(argVals, " ")}, true
} }
} }
} }