summaryrefslogtreecommitdiff
path: root/java/platform_bootclasspath.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r--java/platform_bootclasspath.go26
1 files changed, 14 insertions, 12 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go
index 5db2efe40..df0ba2a42 100644
--- a/java/platform_bootclasspath.go
+++ b/java/platform_bootclasspath.go
@@ -279,21 +279,12 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.
return
}
- flagFileInfo := b.properties.Hidden_api.hiddenAPIFlagFileInfo(ctx)
- for _, fragment := range fragments {
- if ctx.OtherModuleHasProvider(fragment, hiddenAPIFlagFileInfoProvider) {
- info := ctx.OtherModuleProvider(fragment, hiddenAPIFlagFileInfoProvider).(hiddenAPIFlagFileInfo)
- flagFileInfo.append(info)
- }
- }
+ monolithicInfo := b.createAndProvideMonolithicHiddenAPIInfo(ctx, fragments)
- // Store the information for testing.
- ctx.SetProvider(hiddenAPIFlagFileInfoProvider, flagFileInfo)
+ sdkKindToStubPaths := hiddenAPIGatherStubLibDexJarPaths(ctx, nil)
hiddenAPIModules := gatherHiddenAPIModuleFromContents(ctx, modules)
- sdkKindToStubPaths := hiddenAPIGatherStubLibDexJarPaths(ctx, nil)
-
// Generate the monolithic stub-flags.csv file.
bootDexJars := extractBootDexJarsFromHiddenAPIModules(ctx, hiddenAPIModules)
stubFlags := hiddenAPISingletonPaths(ctx).stubFlags
@@ -309,7 +300,7 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.
// Generate the monotlithic hiddenapi-flags.csv file.
allFlags := hiddenAPISingletonPaths(ctx).flags
- buildRuleToGenerateHiddenApiFlags(ctx, "hiddenAPIFlagsFile", "hiddenapi flags", allFlags, stubFlags, annotationFlags, &flagFileInfo)
+ buildRuleToGenerateHiddenApiFlags(ctx, "hiddenAPIFlagsFile", "hiddenapi flags", allFlags, stubFlags, annotationFlags, monolithicInfo.FlagsFilesByCategory, monolithicInfo.AllFlagsPaths)
// Generate an intermediate monolithic hiddenapi-metadata.csv file directly from the annotations
// in the source code.
@@ -328,6 +319,17 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.
buildRuleToGenerateIndex(ctx, "monolithic hidden API index", classesJars, indexCSV)
}
+// createAndProvideMonolithicHiddenAPIInfo creates a MonolithicHiddenAPIInfo and provides it for
+// testing.
+func (b *platformBootclasspathModule) createAndProvideMonolithicHiddenAPIInfo(ctx android.ModuleContext, fragments []android.Module) MonolithicHiddenAPIInfo {
+ flagFileInfo := b.properties.Hidden_api.hiddenAPIFlagFileInfo(ctx)
+ monolithicInfo := newMonolithicHiddenAPIInfo(ctx, flagFileInfo.FlagFilesByCategory, fragments)
+
+ // Store the information for testing.
+ ctx.SetProvider(monolithicHiddenAPIInfoProvider, monolithicInfo)
+ return monolithicInfo
+}
+
func (b *platformBootclasspathModule) buildRuleMergeCSV(ctx android.ModuleContext, desc string, inputPaths android.Paths, outputPath android.WritablePath) {
rule := android.NewRuleBuilder(pctx, ctx)
rule.Command().