Add test data dependencies to APEX.
Test: soong go tests
Bug: 155820504
Change-Id: If96d82c27f19953e34efb31f2111f1643c0c4008
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 671adb5..3ce1a89 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -149,7 +149,7 @@
return []android.AndroidMkEntries{entries}
}
-func androidMkWriteTestData(data android.Paths, ctx AndroidMkContext, entries *android.AndroidMkEntries) {
+func AndroidMkDataPaths(data android.Paths) []string {
var testFiles []string
for _, d := range data {
rel := d.Rel()
@@ -160,6 +160,11 @@
path = strings.TrimSuffix(path, rel)
testFiles = append(testFiles, path+":"+rel)
}
+ return testFiles
+}
+
+func androidMkWriteTestData(data android.Paths, ctx AndroidMkContext, entries *android.AndroidMkEntries) {
+ testFiles := AndroidMkDataPaths(data)
if len(testFiles) > 0 {
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
entries.AddStrings("LOCAL_TEST_DATA", testFiles...)