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
This commit is contained in:
@@ -909,7 +909,7 @@ func NormalizePathForTesting(path Path) string {
|
||||
}
|
||||
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 @@ func PathRelativeToTop(path Path) string {
|
||||
}
|
||||
p := path.String()
|
||||
if w, ok := path.(WritablePath); ok {
|
||||
buildDir := w.buildDir()
|
||||
buildDir := w.getBuildDir()
|
||||
return StringPathRelativeToTop(buildDir, p)
|
||||
}
|
||||
return p
|
||||
|
Reference in New Issue
Block a user