summaryrefslogtreecommitdiff
path: root/java/sdk.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-04-21 22:12:35 +0100
committer Paul Duffin <paulduffin@google.com> 2021-04-21 23:26:57 +0100
commitd3c1513df94c1494aa84f3c4cdfb29bb6b9d8252 (patch)
treef85c1bdd7c772e0e9ca05acffb77c3af1e5a497d /java/sdk.go
parenteaa432d4703030087f9d78ed78547aee486c4625 (diff)
Add tempPathForRestat to improve consistency
Previously, there were two approaches used to construct the temporary path needed by the commitChangeForRestat method and neither was suitable for general use. One was: android.PathForOutput(ctx, outputPath.Rel()+".tmp") The other was: combinedAidl.ReplaceExtension(ctx, "aidl.tmp") The first approach would not work if the supplied path had been created by PathForModuleOut() or similar as it would drop the module directory. That could lead to the same path being used for multiple rules. The second approach would not work for files with a different extension. The tempPathForRestat combines the two approaches so it can be used generally with any WritablePath. Bug: 179354495 Test: verified that the ninja rules that used these files were not changed by these changes. Change-Id: I4439dea0a823512c281eeb1366522fb49dceb4e3
Diffstat (limited to 'java/sdk.go')
-rw-r--r--java/sdk.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/java/sdk.go b/java/sdk.go
index d6e20a78f..1c097d5b7 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -247,7 +247,7 @@ func createSdkFrameworkAidl(ctx android.SingletonContext) {
}
combinedAidl := sdkFrameworkAidlPath(ctx)
- tempPath := combinedAidl.ReplaceExtension(ctx, "aidl.tmp")
+ tempPath := tempPathForRestat(ctx, combinedAidl)
rule := createFrameworkAidl(stubsModules, tempPath, ctx)
@@ -261,7 +261,7 @@ func createNonUpdatableFrameworkAidl(ctx android.SingletonContext) {
stubsModules := []string{"android_module_lib_stubs_current"}
combinedAidl := nonUpdatableFrameworkAidlPath(ctx)
- tempPath := combinedAidl.ReplaceExtension(ctx, "aidl.tmp")
+ tempPath := tempPathForRestat(ctx, combinedAidl)
rule := createFrameworkAidl(stubsModules, tempPath, ctx)
@@ -270,7 +270,7 @@ func createNonUpdatableFrameworkAidl(ctx android.SingletonContext) {
rule.Build("framework_non_updatable_aidl", "generate framework_non_updatable.aidl")
}
-func createFrameworkAidl(stubsModules []string, path android.OutputPath, ctx android.SingletonContext) *android.RuleBuilder {
+func createFrameworkAidl(stubsModules []string, path android.WritablePath, ctx android.SingletonContext) *android.RuleBuilder {
stubsJars := make([]android.Paths, len(stubsModules))
ctx.VisitAllModules(func(module android.Module) {