Fix copy_files implementation
It has to copy all the files into the same directory, stripping the
relative path from the source file.
Bug: 193540681
Test: rbcrun build/make/tests/run.rbc
Change-Id: I2d61d966ad94d73131c7ad6016ce319f8d2ae509
diff --git a/tests/device.rbc b/tests/device.rbc
index c91a487..feefcf7 100644
--- a/tests/device.rbc
+++ b/tests/device.rbc
@@ -48,6 +48,8 @@
cfg["PRODUCT_COPY_FILES"] += (rblf.find_and_copy("audio_platform_info*.xml", "device/google/redfin", "||VENDOR-PATH-PH||/etc") +
["xyz:/etc/xyz"])
cfg["PRODUCT_COPY_FILES"] += rblf.copy_files("x.xml y.xml", "/etc")
+ cfg["PRODUCT_COPY_FILES"] += rblf.copy_files(["from/sub/x", "from/sub/y"], "to")
+
rblf.add_soong_config_namespace(g, "NS1")
rblf.add_soong_config_var_value(g, "NS1", "v1", "abc")
rblf.add_soong_config_var_value(g, "NS1", "v2", "def")
diff --git a/tests/run.rbc b/tests/run.rbc
index e392e47..4d7166a 100644
--- a/tests/run.rbc
+++ b/tests/run.rbc
@@ -57,6 +57,8 @@
"xyz:/etc/xyz",
"x.xml:/etc/x.xml",
"y.xml:/etc/y.xml",
+ "from/sub/x:to/x",
+ "from/sub/y:to/y",
],
"PRODUCT_HOST_PACKAGES": ["host"],
"PRODUCT_PACKAGES": [