Revert^2 "Initial implementation of the bazel sandwich"

c13fad8181

Change-Id: I478562c8fd89e62983feb5b52b62aad851d40f00
This commit is contained in:
Cole Faust
2023-08-01 16:38:55 +00:00
parent 09195f4ffd
commit bc65a3fea8
8 changed files with 328 additions and 14 deletions

View File

@@ -1029,16 +1029,16 @@ 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
}
func (p SourcePath) RelativeToTop() Path {
ensureTestOnly()
return p
}
var _ Path = SourcePath{}
func (p SourcePath) withRel(rel string) SourcePath {
@@ -1126,6 +1126,16 @@ func PathForSource(ctx PathContext, pathComponents ...string) SourcePath {
return path
}
// PathForArbitraryOutput creates a path for the given components. Unlike PathForOutput,
// the path is relative to the root of the output folder, not the out/soong folder.
func PathForArbitraryOutput(ctx PathContext, pathComponents ...string) Path {
p, err := validatePath(pathComponents...)
if err != nil {
reportPathError(ctx, err)
}
return basePath{path: filepath.Join(ctx.Config().OutDir(), p)}
}
// MaybeExistentPathForSource joins the provided path components and validates that the result
// neither escapes the source dir nor is in the out dir.
// It does not validate whether the path exists.