From ea9db58de9dd13088d816a2a9a63d37b92f254e6 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Mon, 21 Mar 2022 17:50:05 -0700 Subject: [PATCH] Add the handle to artifact path requirement functions Bug: 188079133 Test: go test Change-Id: I320f4f14fb47414cb14ebb404efab4bceb1fa1e4 --- mk2rbc/mk2rbc.go | 4 ++-- mk2rbc/mk2rbc_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mk2rbc/mk2rbc.go b/mk2rbc/mk2rbc.go index 35d7d4de4..1b1de3215 100644 --- a/mk2rbc/mk2rbc.go +++ b/mk2rbc/mk2rbc.go @@ -106,8 +106,8 @@ var knownFunctions = map[string]interface { "my-dir": &myDirCallParser{}, "patsubst": &substCallParser{fname: "patsubst"}, "product-copy-files-by-pattern": &simpleCallParser{name: baseName + ".product_copy_files_by_pattern", returnType: starlarkTypeList}, - "require-artifacts-in-path": &simpleCallParser{name: baseName + ".require_artifacts_in_path", returnType: starlarkTypeVoid}, - "require-artifacts-in-path-relaxed": &simpleCallParser{name: baseName + ".require_artifacts_in_path_relaxed", returnType: starlarkTypeVoid}, + "require-artifacts-in-path": &simpleCallParser{name: baseName + ".require_artifacts_in_path", returnType: starlarkTypeVoid, addHandle: true}, + "require-artifacts-in-path-relaxed": &simpleCallParser{name: baseName + ".require_artifacts_in_path_relaxed", returnType: starlarkTypeVoid, addHandle: true}, // TODO(asmundak): remove it once all calls are removed from configuration makefiles. see b/183161002 "shell": &shellCallParser{}, "strip": &simpleCallParser{name: baseName + ".mkstrip", returnType: starlarkTypeString}, diff --git a/mk2rbc/mk2rbc_test.go b/mk2rbc/mk2rbc_test.go index 408466041..98f75e7dc 100644 --- a/mk2rbc/mk2rbc_test.go +++ b/mk2rbc/mk2rbc_test.go @@ -755,8 +755,8 @@ def init(g, handle): cfg = rblf.cfg(handle) rblf.enforce_product_packages_exist("") rblf.enforce_product_packages_exist("foo") - rblf.require_artifacts_in_path("foo", "bar") - rblf.require_artifacts_in_path_relaxed("foo", "bar") + 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") rblf.add_product_dex_preopt_module_config(handle, "MyModule", "disable") `,