From bd73d0db41ac84144c60e7719df106bda8efb663 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 26 Jul 2024 12:00:33 -0700 Subject: [PATCH] Move RelativeToTop out of basePath RelativeToTop is documented as returning the same concrete type that was passed in, which wasn't true for SourcePath. Implement it in SourcePath and delete it from basePath. Test: all soong tests pass Flag: EXEMPT refactor Change-Id: I5f2fd1237b964aa10565f7c6b34122dd6972fda9 --- android/paths.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/android/paths.go b/android/paths.go index 0661b7697..dad70f770 100644 --- a/android/paths.go +++ b/android/paths.go @@ -1119,11 +1119,6 @@ func (p basePath) withRel(rel string) basePath { return p } -func (p basePath) RelativeToTop() Path { - ensureTestOnly() - return p -} - // SourcePath is a Path representing a file path rooted from SrcDir type SourcePath struct { basePath @@ -1136,6 +1131,11 @@ func (p SourcePath) withRel(rel string) SourcePath { return p } +func (p SourcePath) RelativeToTop() Path { + ensureTestOnly() + return p +} + // safePathForSource is for paths that we expect are safe -- only for use by go // code that is embedding ninja variables in paths func safePathForSource(ctx PathContext, pathComponents ...string) (SourcePath, error) {