Rename hidden API types ..Augmentation.. to ..FlagFile..

Augmentation was too abstract this makes it clearer.

Bug: 177892522
Test: m nothinge
Change-Id: I60ad005e68d9e15b01bcb46bc6a9b7f84d8bfd43
This commit is contained in:
Paul Duffin
2021-04-14 15:01:56 +01:00
parent e3dc6608cb
commit 4616977948
2 changed files with 28 additions and 28 deletions

View File

@@ -20,9 +20,9 @@ import (
// Contains support for processing hiddenAPI in a modular fashion. // Contains support for processing hiddenAPI in a modular fashion.
// HiddenAPIAugmentationProperties contains paths to the files that can be used to augment the information // HiddenAPIFlagFileProperties contains paths to the flag files that can be used to augment the
// obtained from annotations within the source code in order to create the complete set of flags // information obtained from annotations within the source code in order to create the complete set
// that should be applied to the dex implementation jars on the bootclasspath. // of flags that should be applied to the dex implementation jars on the bootclasspath.
// //
// Each property contains a list of paths. With the exception of the Unsupported_packages the paths // Each property contains a list of paths. With the exception of the Unsupported_packages the paths
// of each property reference a plain text file that contains a java signature per line. The flags // of each property reference a plain text file that contains a java signature per line. The flags
@@ -31,7 +31,7 @@ import (
// The Unsupported_packages property contains a list of paths, each of which is a plain text file // The Unsupported_packages property contains a list of paths, each of which is a plain text file
// with one Java package per line. All members of all classes within that package (but not nested // with one Java package per line. All members of all classes within that package (but not nested
// packages) will be updated in a property specific way. // packages) will be updated in a property specific way.
type HiddenAPIAugmentationProperties struct { type HiddenAPIFlagFileProperties struct {
// Marks each signature in the referenced files as being unsupported. // Marks each signature in the referenced files as being unsupported.
Unsupported []string `android:"path"` Unsupported []string `android:"path"`
@@ -60,8 +60,8 @@ type HiddenAPIAugmentationProperties struct {
Unsupported_packages []string `android:"path"` Unsupported_packages []string `android:"path"`
} }
func (p *HiddenAPIAugmentationProperties) hiddenAPIAugmentationInfo(ctx android.ModuleContext) hiddenAPIAugmentationInfo { func (p *HiddenAPIFlagFileProperties) hiddenAPIFlagFileInfo(ctx android.ModuleContext) hiddenAPIFlagFileInfo {
info := hiddenAPIAugmentationInfo{categoryToPaths: map[*hiddenAPIFlagFileCategory]android.Paths{}} info := hiddenAPIFlagFileInfo{categoryToPaths: map[*hiddenAPIFlagFileCategory]android.Paths{}}
for _, category := range hiddenAPIFlagFileCategories { for _, category := range hiddenAPIFlagFileCategories {
paths := android.PathsForModuleSrc(ctx, category.propertyAccessor(p)) paths := android.PathsForModuleSrc(ctx, category.propertyAccessor(p))
info.categoryToPaths[category] = paths info.categoryToPaths[category] = paths
@@ -75,7 +75,7 @@ type hiddenAPIFlagFileCategory struct {
// propertyAccessor retrieves the value of the property for this category from the set of // propertyAccessor retrieves the value of the property for this category from the set of
// properties. // properties.
propertyAccessor func(properties *HiddenAPIAugmentationProperties) []string propertyAccessor func(properties *HiddenAPIFlagFileProperties) []string
// commandMutator adds the appropriate command line options for this category to the supplied // commandMutator adds the appropriate command line options for this category to the supplied
// command // command
@@ -83,80 +83,80 @@ type hiddenAPIFlagFileCategory struct {
} }
var hiddenAPIFlagFileCategories = []*hiddenAPIFlagFileCategory{ var hiddenAPIFlagFileCategories = []*hiddenAPIFlagFileCategory{
// See HiddenAPIAugmentationProperties.Unsupported // See HiddenAPIFlagFileProperties.Unsupported
{ {
propertyName: "unsupported", propertyName: "unsupported",
propertyAccessor: func(properties *HiddenAPIAugmentationProperties) []string { propertyAccessor: func(properties *HiddenAPIFlagFileProperties) []string {
return properties.Unsupported return properties.Unsupported
}, },
commandMutator: func(command *android.RuleBuilderCommand, path android.Path) { commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
command.FlagWithInput("--unsupported ", path) command.FlagWithInput("--unsupported ", path)
}, },
}, },
// See HiddenAPIAugmentationProperties.Removed // See HiddenAPIFlagFileProperties.Removed
{ {
propertyName: "removed", propertyName: "removed",
propertyAccessor: func(properties *HiddenAPIAugmentationProperties) []string { propertyAccessor: func(properties *HiddenAPIFlagFileProperties) []string {
return properties.Removed return properties.Removed
}, },
commandMutator: func(command *android.RuleBuilderCommand, path android.Path) { commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
command.FlagWithInput("--unsupported ", path).Flag("--ignore-conflicts ").FlagWithArg("--tag ", "removed") command.FlagWithInput("--unsupported ", path).Flag("--ignore-conflicts ").FlagWithArg("--tag ", "removed")
}, },
}, },
// See HiddenAPIAugmentationProperties.Max_target_r_low_priority // See HiddenAPIFlagFileProperties.Max_target_r_low_priority
{ {
propertyName: "max_target_r_low_priority", propertyName: "max_target_r_low_priority",
propertyAccessor: func(properties *HiddenAPIAugmentationProperties) []string { propertyAccessor: func(properties *HiddenAPIFlagFileProperties) []string {
return properties.Max_target_r_low_priority return properties.Max_target_r_low_priority
}, },
commandMutator: func(command *android.RuleBuilderCommand, path android.Path) { commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
command.FlagWithInput("--max-target-r ", path).FlagWithArg("--tag ", "lo-prio") command.FlagWithInput("--max-target-r ", path).FlagWithArg("--tag ", "lo-prio")
}, },
}, },
// See HiddenAPIAugmentationProperties.Max_target_q // See HiddenAPIFlagFileProperties.Max_target_q
{ {
propertyName: "max_target_q", propertyName: "max_target_q",
propertyAccessor: func(properties *HiddenAPIAugmentationProperties) []string { propertyAccessor: func(properties *HiddenAPIFlagFileProperties) []string {
return properties.Max_target_q return properties.Max_target_q
}, },
commandMutator: func(command *android.RuleBuilderCommand, path android.Path) { commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
command.FlagWithInput("--max-target-q ", path) command.FlagWithInput("--max-target-q ", path)
}, },
}, },
// See HiddenAPIAugmentationProperties.Max_target_p // See HiddenAPIFlagFileProperties.Max_target_p
{ {
propertyName: "max_target_p", propertyName: "max_target_p",
propertyAccessor: func(properties *HiddenAPIAugmentationProperties) []string { propertyAccessor: func(properties *HiddenAPIFlagFileProperties) []string {
return properties.Max_target_p return properties.Max_target_p
}, },
commandMutator: func(command *android.RuleBuilderCommand, path android.Path) { commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
command.FlagWithInput("--max-target-p ", path) command.FlagWithInput("--max-target-p ", path)
}, },
}, },
// See HiddenAPIAugmentationProperties.Max_target_o_low_priority // See HiddenAPIFlagFileProperties.Max_target_o_low_priority
{ {
propertyName: "max_target_o_low_priority", propertyName: "max_target_o_low_priority",
propertyAccessor: func(properties *HiddenAPIAugmentationProperties) []string { propertyAccessor: func(properties *HiddenAPIFlagFileProperties) []string {
return properties.Max_target_o_low_priority return properties.Max_target_o_low_priority
}, },
commandMutator: func(command *android.RuleBuilderCommand, path android.Path) { commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
command.FlagWithInput("--max-target-o ", path).Flag("--ignore-conflicts ").FlagWithArg("--tag ", "lo-prio") command.FlagWithInput("--max-target-o ", path).Flag("--ignore-conflicts ").FlagWithArg("--tag ", "lo-prio")
}, },
}, },
// See HiddenAPIAugmentationProperties.Blocked // See HiddenAPIFlagFileProperties.Blocked
{ {
propertyName: "blocked", propertyName: "blocked",
propertyAccessor: func(properties *HiddenAPIAugmentationProperties) []string { propertyAccessor: func(properties *HiddenAPIFlagFileProperties) []string {
return properties.Blocked return properties.Blocked
}, },
commandMutator: func(command *android.RuleBuilderCommand, path android.Path) { commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
command.FlagWithInput("--blocked ", path) command.FlagWithInput("--blocked ", path)
}, },
}, },
// See HiddenAPIAugmentationProperties.Unsupported_packages // See HiddenAPIFlagFileProperties.Unsupported_packages
{ {
propertyName: "unsupported_packages", propertyName: "unsupported_packages",
propertyAccessor: func(properties *HiddenAPIAugmentationProperties) []string { propertyAccessor: func(properties *HiddenAPIFlagFileProperties) []string {
return properties.Unsupported_packages return properties.Unsupported_packages
}, },
commandMutator: func(command *android.RuleBuilderCommand, path android.Path) { commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
@@ -165,8 +165,8 @@ var hiddenAPIFlagFileCategories = []*hiddenAPIFlagFileCategory{
}, },
} }
// hiddenAPIAugmentationInfo contains paths resolved from HiddenAPIAugmentationProperties // hiddenAPIFlagFileInfo contains paths resolved from HiddenAPIFlagFileProperties
type hiddenAPIAugmentationInfo struct { type hiddenAPIFlagFileInfo struct {
// categoryToPaths maps from the flag file category to the paths containing information for that // categoryToPaths maps from the flag file category to the paths containing information for that
// category. // category.
categoryToPaths map[*hiddenAPIFlagFileCategory]android.Paths categoryToPaths map[*hiddenAPIFlagFileCategory]android.Paths
@@ -196,7 +196,7 @@ type hiddenAPIAugmentationInfo struct {
// //
// augmentationInfo is a struct containing paths to files that augment the information provided by // augmentationInfo is a struct containing paths to files that augment the information provided by
// the moduleSpecificFlagsPaths. // the moduleSpecificFlagsPaths.
func ruleToGenerateHiddenApiFlags(ctx android.BuilderContext, outputPath android.WritablePath, baseFlagsPath android.Path, moduleSpecificFlagsPaths android.Paths, augmentationInfo hiddenAPIAugmentationInfo) { func ruleToGenerateHiddenApiFlags(ctx android.BuilderContext, outputPath android.WritablePath, baseFlagsPath android.Path, moduleSpecificFlagsPaths android.Paths, augmentationInfo hiddenAPIFlagFileInfo) {
tempPath := android.PathForOutput(ctx, outputPath.Rel()+".tmp") tempPath := android.PathForOutput(ctx, outputPath.Rel()+".tmp")
rule := android.NewRuleBuilder(pctx, ctx) rule := android.NewRuleBuilder(pctx, ctx)
command := rule.Command(). command := rule.Command().

View File

@@ -99,7 +99,7 @@ type platformBootclasspathProperties struct {
// platform_bootclasspath. // platform_bootclasspath.
Fragments []ApexVariantReference Fragments []ApexVariantReference
Hidden_api HiddenAPIAugmentationProperties Hidden_api HiddenAPIFlagFileProperties
} }
func platformBootclasspathFactory() android.Module { func platformBootclasspathFactory() android.Module {
@@ -334,7 +334,7 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.
moduleSpecificFlagsPaths = append(moduleSpecificFlagsPaths, module.flagsCSV()) moduleSpecificFlagsPaths = append(moduleSpecificFlagsPaths, module.flagsCSV())
} }
augmentationInfo := b.properties.Hidden_api.hiddenAPIAugmentationInfo(ctx) augmentationInfo := b.properties.Hidden_api.hiddenAPIFlagFileInfo(ctx)
outputPath := hiddenAPISingletonPaths(ctx).flags outputPath := hiddenAPISingletonPaths(ctx).flags
baseFlagsPath := hiddenAPISingletonPaths(ctx).stubFlags baseFlagsPath := hiddenAPISingletonPaths(ctx).stubFlags