summaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2020-11-16 17:32:30 -0800
committerColin Cross <ccross@android.com>2020-12-01 16:22:16 -0800
commitf1a035e6be35d5678ce2e86bf3bc83fd5e4b4dc2 (patch)
tree097d3f1f4bf617eb5596166ee1803e3fd4b738c4 /java/hiddenapi_singleton.go
parent33e17630944359f752cb4abcc80f79b2273645b8 (diff)
Pass pctx and ctx to NewRuleBuilder
Enable the RuleBuilder and RuleBuilderCommand methods to access the BuilderContext by passing it to NewRuleBuilder instead of RuleBuilder.Build. Test: genrule_test.go Test: rule_builder_test.go Test: m checkbuild Change-Id: I63e6597e19167393876dc2259d6f521363b7dabc
Diffstat (limited to 'java/hiddenapi_singleton.go')
-rw-r--r--java/hiddenapi_singleton.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index 8f0e09cbd..ce8410ed4 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -189,7 +189,7 @@ func stubFlagsRule(ctx android.SingletonContext) {
}
// Singleton rule which applies hiddenapi on all boot class path dex files.
- rule := android.NewRuleBuilder()
+ rule := android.NewRuleBuilder(pctx, ctx)
outputPath := hiddenAPISingletonPaths(ctx).stubFlags
tempPath := android.PathForOutput(ctx, outputPath.Rel()+".tmp")
@@ -208,7 +208,7 @@ func stubFlagsRule(ctx android.SingletonContext) {
commitChangeForRestat(rule, tempPath, outputPath)
- rule.Build(pctx, ctx, "hiddenAPIStubFlagsFile", "hiddenapi stub flags")
+ rule.Build("hiddenAPIStubFlagsFile", "hiddenapi stub flags")
}
// flagsRule creates a rule to build hiddenapi-flags.csv out of flags.csv files generated for boot image modules and
@@ -236,7 +236,7 @@ func flagsRule(ctx android.SingletonContext) android.Path {
ctx.Errorf("Failed to find combined-removed-dex.")
}
- rule := android.NewRuleBuilder()
+ rule := android.NewRuleBuilder(pctx, ctx)
outputPath := hiddenAPISingletonPaths(ctx).flags
tempPath := android.PathForOutput(ctx, outputPath.Rel()+".tmp")
@@ -266,7 +266,7 @@ func flagsRule(ctx android.SingletonContext) android.Path {
commitChangeForRestat(rule, tempPath, outputPath)
- rule.Build(pctx, ctx, "hiddenAPIFlagsFile", "hiddenapi flags")
+ rule.Build("hiddenAPIFlagsFile", "hiddenapi flags")
return outputPath
}
@@ -274,14 +274,14 @@ func flagsRule(ctx android.SingletonContext) android.Path {
// emptyFlagsRule creates a rule to build an empty hiddenapi-flags.csv, which is needed by master-art-host builds that
// have a partial manifest without frameworks/base but still need to build a boot image.
func emptyFlagsRule(ctx android.SingletonContext) android.Path {
- rule := android.NewRuleBuilder()
+ rule := android.NewRuleBuilder(pctx, ctx)
outputPath := hiddenAPISingletonPaths(ctx).flags
rule.Command().Text("rm").Flag("-f").Output(outputPath)
rule.Command().Text("touch").Output(outputPath)
- rule.Build(pctx, ctx, "emptyHiddenAPIFlagsFile", "empty hiddenapi flags")
+ rule.Build("emptyHiddenAPIFlagsFile", "empty hiddenapi flags")
return outputPath
}
@@ -299,16 +299,16 @@ func metadataRule(ctx android.SingletonContext) android.Path {
}
})
- rule := android.NewRuleBuilder()
+ rule := android.NewRuleBuilder(pctx, ctx)
outputPath := hiddenAPISingletonPaths(ctx).metadata
rule.Command().
- BuiltTool(ctx, "merge_csv").
+ BuiltTool("merge_csv").
FlagWithOutput("--output=", outputPath).
Inputs(metadataCSV)
- rule.Build(pctx, ctx, "hiddenAPIGreylistMetadataFile", "hiddenapi greylist metadata")
+ rule.Build("hiddenAPIGreylistMetadataFile", "hiddenapi greylist metadata")
return outputPath
}
@@ -399,13 +399,13 @@ func (h *hiddenAPIIndexSingleton) GenerateBuildActions(ctx android.SingletonCont
}
})
- rule := android.NewRuleBuilder()
+ rule := android.NewRuleBuilder(pctx, ctx)
rule.Command().
- BuiltTool(ctx, "merge_csv").
+ BuiltTool("merge_csv").
FlagWithArg("--header=", "signature,file,startline,startcol,endline,endcol,properties").
FlagWithOutput("--output=", hiddenAPISingletonPaths(ctx).index).
Inputs(indexes)
- rule.Build(pctx, ctx, "singleton-merged-hiddenapi-index", "Singleton merged Hidden API index")
+ rule.Build("singleton-merged-hiddenapi-index", "Singleton merged Hidden API index")
h.index = hiddenAPISingletonPaths(ctx).index
}