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
This commit is contained in:
Paul Duffin
2021-04-08 23:01:37 +01:00
parent 192131e36b
commit 9b381ef2b8
4 changed files with 128 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ package java
import (
"android/soong/android"
"github.com/google/blueprint"
)
// Contains support for processing hiddenAPI in a modular fashion.
@@ -172,6 +173,14 @@ type hiddenAPIFlagFileInfo struct {
categoryToPaths map[*hiddenAPIFlagFileCategory]android.Paths
}
func (i *hiddenAPIFlagFileInfo) append(other hiddenAPIFlagFileInfo) {
for _, category := range hiddenAPIFlagFileCategories {
i.categoryToPaths[category] = append(i.categoryToPaths[category], other.categoryToPaths[category]...)
}
}
var hiddenAPIFlagFileInfoProvider = blueprint.NewProvider(hiddenAPIFlagFileInfo{})
// ruleToGenerateHiddenApiFlags creates a rule to create the monolithic hidden API flags from the
// flags from all the modules, the stub flags, augmented with some additional configuration files.
//