Add buildDir to WritablePath implementations
First, the buildDir() method was renamed to getBuildDir() to avoid
clashing with the buildDir field.
Then, a buildDir was added to both `OutputPath` and `InstallPath` but
not to `PhonyPath` as it does not contain any path components. Instead
the `PhonyPath.getBuildDir()` was changed to simply return "".
Bug: 183650682
Test: m droid
Change-Id: I12e1854c829b980c5c01205753c62c00dc0a4774
diff --git a/android/testing.go b/android/testing.go
index 1436f0b..c077678 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -909,7 +909,7 @@
}
p := path.String()
if w, ok := path.(WritablePath); ok {
- rel, err := filepath.Rel(w.buildDir(), p)
+ rel, err := filepath.Rel(w.getBuildDir(), p)
if err != nil {
panic(err)
}
@@ -944,7 +944,7 @@
}
p := path.String()
if w, ok := path.(WritablePath); ok {
- buildDir := w.buildDir()
+ buildDir := w.getBuildDir()
return StringPathRelativeToTop(buildDir, p)
}
return p