Add OutputPath.ReplaceExtension()
Add a helper method that returns a new OutputPath with the
extension replaced.
Test: paths_test.go
Change-Id: I7f93b3475031a19b53652022740488373a1b7d97
diff --git a/android/paths_test.go b/android/paths_test.go
index 1ed0734..1972591 100644
--- a/android/paths_test.go
+++ b/android/paths_test.go
@@ -691,3 +691,15 @@
})
}
}
+
+func ExampleOutputPath_ReplaceExtension() {
+ ctx := &configErrorWrapper{
+ config: TestConfig("out", nil),
+ }
+ p := PathForOutput(ctx, "system/framework/boot.art")
+ p2 := p.ReplaceExtension(ctx, "oat")
+ fmt.Println(p, p2)
+
+ // Output:
+ // out/system/framework/boot.art out/system/framework/boot.oat
+}