Add more paths helper methods
Add PathsForOutput to convert multiple strings into WritablePaths. Add OutputPath.InSameDir to build a new OutputPath pointing to a file in the same directory as an existing OutputPath. Add WritablePathForTesting and WritablePathsForTesting that mirror PathForTesting and PathsForTesting but return WritablePaths. Add PathContextForTesting to return a minimal PathContext implementation. Test: paths_test.go Change-Id: I9708eb164b273514a96dae0a260ef9a963fb9bcf
This commit is contained in:
@@ -703,3 +703,15 @@ func ExampleOutputPath_ReplaceExtension() {
|
||||
// Output:
|
||||
// out/system/framework/boot.art out/system/framework/boot.oat
|
||||
}
|
||||
|
||||
func ExampleOutputPath_FileInSameDir() {
|
||||
ctx := &configErrorWrapper{
|
||||
config: TestConfig("out", nil),
|
||||
}
|
||||
p := PathForOutput(ctx, "system/framework/boot.art")
|
||||
p2 := p.InSameDir(ctx, "oat", "arm", "boot.vdex")
|
||||
fmt.Println(p, p2)
|
||||
|
||||
// Output:
|
||||
// out/system/framework/boot.art out/system/framework/oat/arm/boot.vdex
|
||||
}
|
||||
|
Reference in New Issue
Block a user