summaryrefslogtreecommitdiff
path: root/java/hiddenapi.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-01-27 15:11:42 +0000
committer Paul Duffin <paulduffin@google.com> 2021-01-29 13:22:31 +0000
commit34982f109652742aa0686fc4e156cc21dff991b8 (patch)
tree39a5771daa01a0288c25c7faeb70bec9bb5beafa /java/hiddenapi.go
parentff774a04ad9208d91d483e6468e9d21cdb8f98aa (diff)
Move creation of paths into hiddenAPIGenerateCSV
A minor refactoring to simplify the generation of the CSV files. Test: m nothing Bug: 178361284 Change-Id: If79d21c7cebc6643a404973d3e0e5f174d7b0bb1
Diffstat (limited to 'java/hiddenapi.go')
-rw-r--r--java/hiddenapi.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/java/hiddenapi.go b/java/hiddenapi.go
index c7dac8fec..2cd025e43 100644
--- a/java/hiddenapi.go
+++ b/java/hiddenapi.go
@@ -108,11 +108,9 @@ func (h *hiddenAPI) hiddenAPI(ctx android.ModuleContext, name string, primary bo
// not on the list then that will cause failures in the CtsHiddenApiBlacklist...
// tests.
if inList(bootJarName, ctx.Config().BootJars()) {
- // Derive the greylist from classes jar.
- flagsCSV := android.PathForModuleOut(ctx, "hiddenapi", "flags.csv")
- metadataCSV := android.PathForModuleOut(ctx, "hiddenapi", "metadata.csv")
- indexCSV := android.PathForModuleOut(ctx, "hiddenapi", "index.csv")
- h.hiddenAPIGenerateCSV(ctx, flagsCSV, metadataCSV, indexCSV, implementationJar)
+ // Create ninja rules to generate various CSV files needed by hiddenapi and store the paths
+ // in the hiddenAPI structure.
+ h.hiddenAPIGenerateCSV(ctx, implementationJar)
// If this module is actually on the boot jars list and not providing
// hiddenapi information for a module on the boot jars list then encode
@@ -136,9 +134,10 @@ func (h *hiddenAPI) hiddenAPI(ctx android.ModuleContext, name string, primary bo
return dexJar
}
-func (h *hiddenAPI) hiddenAPIGenerateCSV(ctx android.ModuleContext, flagsCSV, metadataCSV, indexCSV android.WritablePath, classesJar android.Path) {
+func (h *hiddenAPI) hiddenAPIGenerateCSV(ctx android.ModuleContext, classesJar android.Path) {
stubFlagsCSV := hiddenAPISingletonPaths(ctx).stubFlags
+ flagsCSV := android.PathForModuleOut(ctx, "hiddenapi", "flags.csv")
ctx.Build(pctx, android.BuildParams{
Rule: hiddenAPIGenerateCSVRule,
Description: "hiddenapi flags",
@@ -152,6 +151,7 @@ func (h *hiddenAPI) hiddenAPIGenerateCSV(ctx android.ModuleContext, flagsCSV, me
})
h.flagsCSVPath = flagsCSV
+ metadataCSV := android.PathForModuleOut(ctx, "hiddenapi", "metadata.csv")
ctx.Build(pctx, android.BuildParams{
Rule: hiddenAPIGenerateCSVRule,
Description: "hiddenapi metadata",
@@ -165,6 +165,7 @@ func (h *hiddenAPI) hiddenAPIGenerateCSV(ctx android.ModuleContext, flagsCSV, me
})
h.metadataCSVPath = metadataCSV
+ indexCSV := android.PathForModuleOut(ctx, "hiddenapi", "index.csv")
rule := android.NewRuleBuilder(pctx, ctx)
rule.Command().
BuiltTool("merge_csv").