Install data_libs using relative_install_path property
Test: Added to data_libs tests
Test: Manually verified with bionic-unit-tests
Test: Treehugger
Change-Id: I28a8e08e3409f1e7c7bb72f4351310b57f35f513
diff --git a/apex/androidmk.go b/apex/androidmk.go
index b9bcc3a..10cc4b6 100644
--- a/apex/androidmk.go
+++ b/apex/androidmk.go
@@ -116,9 +116,9 @@
if len(fi.symlinks) > 0 {
fmt.Fprintln(w, "LOCAL_MODULE_SYMLINKS :=", strings.Join(fi.symlinks, " "))
}
- newDataPaths := []android.Path{}
+ newDataPaths := []android.DataPath{}
for _, path := range fi.dataPaths {
- dataOutPath := modulePath + ":" + path.Rel()
+ dataOutPath := modulePath + ":" + path.SrcPath.Rel()
if ok := seenDataOutPaths[dataOutPath]; !ok {
newDataPaths = append(newDataPaths, path)
seenDataOutPaths[dataOutPath] = true
diff --git a/apex/apex.go b/apex/apex.go
index b29017d..aa0f906 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1145,7 +1145,7 @@
module android.Module
// list of symlinks that will be created in installDir that point to this apexFile
symlinks []string
- dataPaths android.Paths
+ dataPaths []android.DataPath
transitiveDep bool
moduleDir string
diff --git a/apex/builder.go b/apex/builder.go
index 49e4642..81f8131 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -403,16 +403,16 @@
}
for _, d := range fi.dataPaths {
// TODO(eakammer): This is now the third repetition of ~this logic for test paths, refactoring should be possible
- relPath := d.Rel()
- dataPath := d.String()
+ relPath := d.SrcPath.Rel()
+ dataPath := d.SrcPath.String()
if !strings.HasSuffix(dataPath, relPath) {
panic(fmt.Errorf("path %q does not end with %q", dataPath, relPath))
}
dataDest := android.PathForModuleOut(ctx, "image"+suffix, fi.apexRelativePath(relPath)).String()
- copyCommands = append(copyCommands, "cp -f "+d.String()+" "+dataDest)
- implicitInputs = append(implicitInputs, d)
+ copyCommands = append(copyCommands, "cp -f "+d.SrcPath.String()+" "+dataDest)
+ implicitInputs = append(implicitInputs, d.SrcPath)
}
}
@@ -473,7 +473,7 @@
if f.installDir == "bin" || strings.HasPrefix(f.installDir, "bin/") {
executablePaths = append(executablePaths, pathInApex)
for _, d := range f.dataPaths {
- readOnlyPaths = append(readOnlyPaths, filepath.Join(f.installDir, d.Rel()))
+ readOnlyPaths = append(readOnlyPaths, filepath.Join(f.installDir, d.SrcPath.Rel()))
}
for _, s := range f.symlinks {
executablePaths = append(executablePaths, filepath.Join(f.installDir, s))