Merge "Clarify genrule error message" am: 1f7ce200a7

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1997150

Change-Id: Ic802169f936db1ed07b919a724de754cd2629ffb
This commit is contained in:
Anton Hansson
2022-02-23 19:56:51 +00:00
committed by Automerger Merge Worker
2 changed files with 4 additions and 4 deletions

View File

@@ -496,7 +496,7 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
} }
return paths[0], nil return paths[0], nil
} else { } else {
return reportError("unknown location label %q", label) return reportError("unknown location label %q is not in srcs, out, tools or tool_files.", label)
} }
} else if strings.HasPrefix(name, "locations ") { } else if strings.HasPrefix(name, "locations ") {
label := strings.TrimSpace(strings.TrimPrefix(name, "locations ")) label := strings.TrimSpace(strings.TrimPrefix(name, "locations "))
@@ -507,7 +507,7 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
} }
return strings.Join(paths, " "), nil return strings.Join(paths, " "), nil
} else { } else {
return reportError("unknown locations label %q", label) return reportError("unknown locations label %q is not in srcs, out, tools or tool_files.", label)
} }
} else { } else {
return reportError("unknown variable '$(%s)'", name) return reportError("unknown variable '$(%s)'", name)

View File

@@ -341,7 +341,7 @@ func TestGenruleCmd(t *testing.T) {
out: ["out"], out: ["out"],
cmd: "echo foo > $(location missing)", cmd: "echo foo > $(location missing)",
`, `,
err: `unknown location label "missing"`, err: `unknown location label "missing" is not in srcs, out, tools or tool_files.`,
}, },
{ {
name: "error locations", name: "error locations",
@@ -349,7 +349,7 @@ func TestGenruleCmd(t *testing.T) {
out: ["out"], out: ["out"],
cmd: "echo foo > $(locations missing)", cmd: "echo foo > $(locations missing)",
`, `,
err: `unknown locations label "missing"`, err: `unknown locations label "missing" is not in srcs, out, tools or tool_files`,
}, },
{ {
name: "error location no files", name: "error location no files",