Add handle to enforce_product_packages_exist

Bug: 229132189
Test: go test
Change-Id: I76804354051f0866c8cad48c1189b36de4f73e23
This commit is contained in:
Cole Faust
2022-04-13 13:53:48 -07:00
parent 5e7455996e
commit 6c41b8a729
2 changed files with 4 additions and 4 deletions

View File

@@ -80,7 +80,7 @@ var knownFunctions = map[string]interface {
"copy-files": &simpleCallParser{name: baseName + ".copy_files", returnType: starlarkTypeList},
"dir": &simpleCallParser{name: baseName + ".dir", returnType: starlarkTypeString},
"dist-for-goals": &simpleCallParser{name: baseName + ".mkdist_for_goals", returnType: starlarkTypeVoid, addGlobals: true},
"enforce-product-packages-exist": &simpleCallParser{name: baseName + ".enforce_product_packages_exist", returnType: starlarkTypeVoid},
"enforce-product-packages-exist": &simpleCallParser{name: baseName + ".enforce_product_packages_exist", returnType: starlarkTypeVoid, addHandle: true},
"error": &makeControlFuncParser{name: baseName + ".mkerror"},
"findstring": &simpleCallParser{name: baseName + ".findstring", returnType: starlarkTypeInt},
"find-copy-subdir-files": &simpleCallParser{name: baseName + ".find_and_copy", returnType: starlarkTypeList},
@@ -1241,7 +1241,7 @@ func (ctx *parseContext) maybeParseFunctionCall(node mkparser.Node, ref *mkparse
}
name = words[0].Dump()
if len(words) < 2 {
args = &mkparser.MakeString{}
args = mkparser.SimpleMakeString("", words[0].Pos())
} else {
args = words[1]
}

View File

@@ -773,8 +773,8 @@ $(call add-product-dex-preopt-module-config,MyModule,disable)
def init(g, handle):
cfg = rblf.cfg(handle)
rblf.enforce_product_packages_exist("")
rblf.enforce_product_packages_exist("foo")
rblf.enforce_product_packages_exist(handle, "")
rblf.enforce_product_packages_exist(handle, "foo")
rblf.require_artifacts_in_path(handle, "foo", "bar")
rblf.require_artifacts_in_path_relaxed(handle, "foo", "bar")
rblf.mkdist_for_goals(g, "goal", "from:to")