diff options
| author | 2021-05-14 18:51:10 +0000 | |
|---|---|---|
| committer | 2021-05-14 18:51:10 +0000 | |
| commit | 2bc8b3a646001a79409ecdd40584c762c4ed40b5 (patch) | |
| tree | 903cdc29357f248e72b8c3213e0e7869acdef00e /java/hiddenapi_modular.go | |
| parent | b0f20d134fb6b661ba15ae3735efe90101d3112e (diff) | |
| parent | 850e61f23478b7b2b333e5dc62a6f805114bd625 (diff) | |
Merge "Dedup hidden API rule generation"
Diffstat (limited to 'java/hiddenapi_modular.go')
| -rw-r--r-- | java/hiddenapi_modular.go | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go index b3a3735d9..9989ab149 100644 --- a/java/hiddenapi_modular.go +++ b/java/hiddenapi_modular.go @@ -522,42 +522,15 @@ func hiddenAPIGenerateAllFlagsForBootclasspathFragment(ctx android.ModuleContext // Generate the set of flags from the annotations in the source code. annotationFlagsCSV := android.PathForModuleOut(ctx, hiddenApiSubDir, "annotation-flags.csv") - ctx.Build(pctx, android.BuildParams{ - Rule: hiddenAPIGenerateCSVRule, - Description: "modular hiddenapi annotation flags", - Inputs: classesJars, - Output: annotationFlagsCSV, - Implicit: stubFlagsCSV, - Args: map[string]string{ - "outFlag": "--write-flags-csv", - "stubAPIFlags": stubFlagsCSV.String(), - }, - }) + buildRuleToGenerateAnnotationFlags(ctx, "modular hiddenapi annotation flags", classesJars, stubFlagsCSV, annotationFlagsCSV) // Generate the metadata from the annotations in the source code. metadataCSV := android.PathForModuleOut(ctx, hiddenApiSubDir, "metadata.csv") - ctx.Build(pctx, android.BuildParams{ - Rule: hiddenAPIGenerateCSVRule, - Description: "modular hiddenapi metadata", - Inputs: classesJars, - Output: metadataCSV, - Implicit: stubFlagsCSV, - Args: map[string]string{ - "outFlag": "--write-metadata-csv", - "stubAPIFlags": stubFlagsCSV.String(), - }, - }) + buildRuleToGenerateMetadata(ctx, "modular hiddenapi metadata", classesJars, stubFlagsCSV, metadataCSV) // Generate the index file from the annotations in the source code. indexCSV := android.PathForModuleOut(ctx, hiddenApiSubDir, "index.csv") - rule = android.NewRuleBuilder(pctx, ctx) - rule.Command(). - BuiltTool("merge_csv"). - Flag("--zip_input"). - Flag("--key_field signature"). - FlagWithOutput("--output=", indexCSV). - Inputs(classesJars) - rule.Build("modular-hiddenapi-index", "modular hiddenapi index") + buildRuleToGenerateIndex(ctx, "modular hiddenapi index", classesJars, indexCSV) // Removed APIs need to be marked and in order to do that the flagFileInfo needs to specify files // containing dex signatures of all the removed APIs. In the monolithic files that is done by |