summaryrefslogtreecommitdiff
path: root/java/hiddenapi.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2023-02-14 17:50:31 -0800
committer Cole Faust <colefaust@google.com> 2023-02-14 17:50:31 -0800
commita5f64f03968266f14c81c5ef47609adc6fe07520 (patch)
tree223ba2270b452343086bbfe3016418a260d50e69 /java/hiddenapi.go
parent1d09ec6fcaf14bd1ecd0cb3b0f8070234eef0d2a (diff)
Convert RuleBuilder to static rule in buildRuleToGenerateIndex
This saves ~34kb from the build.ninja file. Test: Presubmits Change-Id: I8fa4974e4f1509be7938c774e536d15a63534753
Diffstat (limited to 'java/hiddenapi.go')
-rw-r--r--java/hiddenapi.go29
1 files changed, 17 insertions, 12 deletions
diff --git a/java/hiddenapi.go b/java/hiddenapi.go
index cf9c7ad7a..c4fc65f2e 100644
--- a/java/hiddenapi.go
+++ b/java/hiddenapi.go
@@ -20,10 +20,17 @@ import (
"android/soong/android"
)
-var hiddenAPIGenerateCSVRule = pctx.AndroidStaticRule("hiddenAPIGenerateCSV", blueprint.RuleParams{
- Command: "${config.Class2NonSdkList} --stub-api-flags ${stubAPIFlags} $in $outFlag $out",
- CommandDeps: []string{"${config.Class2NonSdkList}"},
-}, "outFlag", "stubAPIFlags")
+var (
+ hiddenAPIGenerateCSVRule = pctx.AndroidStaticRule("hiddenAPIGenerateCSV", blueprint.RuleParams{
+ Command: "${config.Class2NonSdkList} --stub-api-flags ${stubAPIFlags} $in $outFlag $out",
+ CommandDeps: []string{"${config.Class2NonSdkList}"},
+ }, "outFlag", "stubAPIFlags")
+
+ hiddenAPIGenerateIndexRule = pctx.AndroidStaticRule("hiddenAPIGenerateIndex", blueprint.RuleParams{
+ Command: "${config.MergeCsvCommand} --zip_input --key_field signature --output=$out $in",
+ CommandDeps: []string{"${config.MergeCsvCommand}"},
+ })
+)
type hiddenAPI struct {
// True if the module containing this structure contributes to the hiddenapi information or has
@@ -216,14 +223,12 @@ func buildRuleToGenerateMetadata(ctx android.ModuleContext, desc string, classes
// created by the unsupported app usage annotation processor during compilation of the class
// implementation jar.
func buildRuleToGenerateIndex(ctx android.ModuleContext, desc string, classesJars android.Paths, indexCSV android.WritablePath) {
- rule := android.NewRuleBuilder(pctx, ctx)
- rule.Command().
- BuiltTool("merge_csv").
- Flag("--zip_input").
- Flag("--key_field signature").
- FlagWithOutput("--output=", indexCSV).
- Inputs(classesJars)
- rule.Build(desc, desc)
+ ctx.Build(pctx, android.BuildParams{
+ Rule: hiddenAPIGenerateIndexRule,
+ Description: desc,
+ Inputs: classesJars,
+ Output: indexCSV,
+ })
}
var hiddenAPIEncodeDexRule = pctx.AndroidStaticRule("hiddenAPIEncodeDex", blueprint.RuleParams{