Add test data dependencies to APEX.
Test: soong go tests
Bug: 155820504
Change-Id: If96d82c27f19953e34efb31f2111f1643c0c4008
diff --git a/apex/apex.go b/apex/apex.go
index fa71ffa..c3f73ee 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1214,6 +1214,7 @@
module android.Module
// list of symlinks that will be created in installDir that point to this apexFile
symlinks []string
+ dataPaths android.Paths
transitiveDep bool
moduleDir string
@@ -1249,16 +1250,20 @@
return af.builtFile != nil && af.builtFile.String() != ""
}
+func (af *apexFile) apexRelativePath(path string) string {
+ return filepath.Join(af.installDir, path)
+}
+
// Path() returns path of this apex file relative to the APEX root
func (af *apexFile) Path() string {
- return filepath.Join(af.installDir, af.builtFile.Base())
+ return af.apexRelativePath(af.builtFile.Base())
}
// SymlinkPaths() returns paths of the symlinks (if any) relative to the APEX root
func (af *apexFile) SymlinkPaths() []string {
var ret []string
for _, symlink := range af.symlinks {
- ret = append(ret, filepath.Join(af.installDir, symlink))
+ ret = append(ret, af.apexRelativePath(symlink))
}
return ret
}
@@ -1664,6 +1669,7 @@
fileToCopy := cc.OutputFile().Path()
af := newApexFile(ctx, fileToCopy, cc.Name(), dirInApex, nativeExecutable, cc)
af.symlinks = cc.Symlinks()
+ af.dataPaths = cc.DataPaths()
return af
}