Correct genrule path references
Test: b build `bmod robolectric_tzdata`
Test: go test bp2build tests
Change-Id: I98333f2b9f480019ddca11944b455d484a47cf8e
diff --git a/bp2build/genrule_conversion_test.go b/bp2build/genrule_conversion_test.go
index 3490881..5cf4fb2 100644
--- a/bp2build/genrule_conversion_test.go
+++ b/bp2build/genrule_conversion_test.go
@@ -49,6 +49,7 @@
srcs: ["other_tool.in"],
cmd: "cp $(in) $(out)",
}`, genruleTarget, genruleTarget),
+ "other/file.txt": "",
}
}
@@ -293,17 +294,20 @@
bp := `%s {
name: "foo",
out: ["foo.out"],
- srcs: [":other.tool"],
+ srcs: [":other.tool", "other/file.txt",],
tool_files: [":foo.tool"],
- cmd: "$(locations :foo.tool) -s $(out) $(location :other.tool)",
+ cmd: "$(locations :foo.tool) $(location other/file.txt) -s $(out) $(location :other.tool)",
bazel_module: { bp2build_available: true },
}`
for _, tc := range testCases {
moduleAttrs := AttrNameToString{
- "cmd": `"$(locations //other:foo.tool) -s $(OUTS) $(location //other:other.tool)"`,
- "outs": `["foo.out"]`,
- "srcs": `["//other:other.tool"]`,
+ "cmd": `"$(locations //other:foo.tool) $(location //other:file.txt) -s $(OUTS) $(location //other:other.tool)"`,
+ "outs": `["foo.out"]`,
+ "srcs": `[
+ "//other:other.tool",
+ "//other:file.txt",
+ ]`,
"tools": `["//other:foo.tool"]`,
}