diff options
author | Paul Duffin <paulduffin@google.com> | 2021-04-08 23:01:37 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2021-04-16 00:29:53 +0100 |
commit | 9b381ef2b898156bea070edd045d7e86d79b4fb3 (patch) | |
tree | bb6f1f1886b8e0ddeb026d4e6cd9a43698ee6645 /java/platform_bootclasspath.go | |
parent | 192131e36b528e90e35960f60abc9475cbe8f0ff (diff) |
platform_bootclasspath: aggregate hidden API flag files from fragments
Aggregates hidden API flag files from the bootclasspath_fragments which
will allow the hidden API flag files in frameworks/base/boot/hiddenapi
to be modularized and moved to the appropriate repo.
Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
by this change
also verified that changes to the fragment provided files do
affect the monolithic files.
Change-Id: Ifce14c9ef24c58c7ab1085475d85b61cfbfefecd
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r-- | java/platform_bootclasspath.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go index cb8ad683b..ba758ddfb 100644 --- a/java/platform_bootclasspath.go +++ b/java/platform_bootclasspath.go @@ -258,7 +258,7 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo } }) - b.generateHiddenAPIBuildActions(ctx, b.configuredModules) + b.generateHiddenAPIBuildActions(ctx, b.configuredModules, b.fragments) // Nothing to do if skipping the dexpreopt of boot image jars. if SkipDexpreoptBootJars(ctx) { @@ -286,7 +286,7 @@ func (b *platformBootclasspathModule) getImageConfig(ctx android.EarlyModuleCont } // generateHiddenAPIBuildActions generates all the hidden API related build rules. -func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.ModuleContext, modules []android.Module) { +func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.ModuleContext, modules []android.Module, fragments []android.Module) { // Save the paths to the monolithic files for retrieval via OutputFiles(). b.hiddenAPIFlagsCSV = hiddenAPISingletonPaths(ctx).flags @@ -338,11 +338,20 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android. moduleSpecificFlagsPaths = append(moduleSpecificFlagsPaths, module.flagsCSV()) } - augmentationInfo := b.properties.Hidden_api.hiddenAPIFlagFileInfo(ctx) + 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) + } + } + + // Store the information for testing. + ctx.SetProvider(hiddenAPIFlagFileInfoProvider, flagFileInfo) outputPath := hiddenAPISingletonPaths(ctx).flags baseFlagsPath := hiddenAPISingletonPaths(ctx).stubFlags - ruleToGenerateHiddenApiFlags(ctx, outputPath, baseFlagsPath, moduleSpecificFlagsPaths, augmentationInfo) + ruleToGenerateHiddenApiFlags(ctx, outputPath, baseFlagsPath, moduleSpecificFlagsPaths, flagFileInfo) b.generateHiddenAPIIndexRules(ctx, hiddenAPISupportingModules) b.generatedHiddenAPIMetadataRules(ctx, hiddenAPISupportingModules) |