diff options
author | 2021-04-08 20:12:41 +0100 | |
---|---|---|
committer | 2021-04-12 11:04:24 +0100 | |
commit | 702210b804b91bf3fbfa62c3305abf65a3630267 (patch) | |
tree | f7a48ad1b64e79d5690d8a34aa84b88c0ac54882 /java/platform_bootclasspath.go | |
parent | c6bb7cf8d709d0bcfb8f90071dd34c779d16a888 (diff) |
Move generation of global hidden API flags to platform_bootclasspath
This change moves the generation of the global hidden API flags from
the singleton to the platform_bootclasspath module. It involves:
1. Moving the ruleToGenerateHiddenApiFlags to hiddenapi_modular.go.
2. Adding HiddenAPIAugmentationProperties to be used by the
platform_bootclasspath type.
3. Moving the file paths into the platform-bootclasspath module
definition in frameworks/base/boot/Android.bp.
The flagsRule is kept as a placeholder for now. The emptyFlagsRule is
also kept so that builds continue to work even when the frameworks/base
repository is not present.
Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
by this change
Change-Id: Idf4dd414a016831bfe04a01f93234c1c33819881
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r-- | java/platform_bootclasspath.go | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go index 95d19b96e..e292d8057 100644 --- a/java/platform_bootclasspath.go +++ b/java/platform_bootclasspath.go @@ -84,10 +84,11 @@ type ApexVariantReference struct { } type platformBootclasspathProperties struct { - // The names of the bootclasspath_fragment modules that form part of this // platform_bootclasspath. Fragments []ApexVariantReference + + Hidden_api HiddenAPIAugmentationProperties } func platformBootclasspathFactory() android.Module { @@ -191,6 +192,8 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo } }) + b.generateHiddenAPIBuildActions(ctx, b.configuredModules) + // Nothing to do if skipping the dexpreopt of boot image jars. if SkipDexpreoptBootJars(ctx) { return @@ -215,3 +218,24 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo func (b *platformBootclasspathModule) getImageConfig(ctx android.EarlyModuleContext) *bootImageConfig { return defaultBootImageConfig(ctx) } + +// generateHiddenAPIBuildActions generates all the hidden API related build rules. +func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.ModuleContext, modules []android.Module) { + + moduleSpecificFlagsPaths := android.Paths{} + for _, module := range modules { + if h, ok := module.(hiddenAPIIntf); ok { + if csv := h.flagsCSV(); csv != nil { + moduleSpecificFlagsPaths = append(moduleSpecificFlagsPaths, csv) + } + } else { + ctx.ModuleErrorf("module %s of type %s does not implement hiddenAPIIntf", module, ctx.OtherModuleType(module)) + } + } + + augmentationInfo := b.properties.Hidden_api.hiddenAPIAugmentationInfo(ctx) + + outputPath := hiddenAPISingletonPaths(ctx).flags + baseFlagsPath := hiddenAPISingletonPaths(ctx).stubFlags + ruleToGenerateHiddenApiFlags(ctx, outputPath, baseFlagsPath, moduleSpecificFlagsPaths, augmentationInfo) +} |