Merge changes from topic "bb_201948713"

* changes:
  Revert "Support generating sdk snapshot for specific build release"
  Revert "Separate hidden API flags needed in sdk snapshots for S and T"
This commit is contained in:
Salmax Chang
2021-10-04 07:53:19 +00:00
committed by Gerrit Code Review
8 changed files with 51 additions and 255 deletions

View File

@@ -767,20 +767,14 @@ type bootclasspathFragmentSdkMemberProperties struct {
// The path to the generated index.csv file.
Index_path android.OptionalPath
// The path to the generated signature-patterns.csv file.
Signature_patterns_path android.OptionalPath
// The path to the generated stub-flags.csv file.
Stub_flags_path android.OptionalPath `supported_build_releases:"S"`
Stub_flags_path android.OptionalPath
// The path to the generated all-flags.csv file.
All_flags_path android.OptionalPath `supported_build_releases:"S"`
// The path to the generated signature-patterns.csv file.
Signature_patterns_path android.OptionalPath `supported_build_releases:"T+"`
// The path to the generated filtered-stub-flags.csv file.
Filtered_stub_flags_path android.OptionalPath `supported_build_releases:"T+"`
// The path to the generated filtered-flags.csv file.
Filtered_flags_path android.OptionalPath `supported_build_releases:"T+"`
All_flags_path android.OptionalPath
}
func (b *bootclasspathFragmentSdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) {
@@ -799,13 +793,10 @@ func (b *bootclasspathFragmentSdkMemberProperties) PopulateFromVariant(ctx andro
b.Metadata_path = android.OptionalPathForPath(hiddenAPIInfo.MetadataPath)
b.Index_path = android.OptionalPathForPath(hiddenAPIInfo.IndexPath)
b.Signature_patterns_path = android.OptionalPathForPath(hiddenAPIInfo.SignaturePatternsPath)
b.Stub_flags_path = android.OptionalPathForPath(hiddenAPIInfo.StubFlagsPath)
b.All_flags_path = android.OptionalPathForPath(hiddenAPIInfo.AllFlagsPath)
b.Signature_patterns_path = android.OptionalPathForPath(hiddenAPIInfo.SignaturePatternsPath)
b.Filtered_stub_flags_path = android.OptionalPathForPath(hiddenAPIInfo.FilteredStubFlagsPath)
b.Filtered_flags_path = android.OptionalPathForPath(hiddenAPIInfo.FilteredFlagsPath)
// Copy stub_libs properties.
b.Stub_libs = module.properties.Api.Stub_libs
b.Core_platform_stub_libs = module.properties.Core_platform_api.Stub_libs
@@ -870,13 +861,9 @@ func (b *bootclasspathFragmentSdkMemberProperties) AddToPropertySet(ctx android.
copyOptionalPath(b.Annotation_flags_path, "annotation_flags")
copyOptionalPath(b.Metadata_path, "metadata")
copyOptionalPath(b.Index_path, "index")
copyOptionalPath(b.Signature_patterns_path, "signature_patterns")
copyOptionalPath(b.Stub_flags_path, "stub_flags")
copyOptionalPath(b.All_flags_path, "all_flags")
copyOptionalPath(b.Signature_patterns_path, "signature_patterns")
copyOptionalPath(b.Filtered_stub_flags_path, "filtered_stub_flags")
copyOptionalPath(b.Filtered_flags_path, "filtered_flags")
}
var _ android.SdkMemberType = (*bootclasspathFragmentMemberType)(nil)
@@ -902,12 +889,6 @@ type prebuiltBootclasspathFragmentProperties struct {
// The path to the all-flags.csv file created by the bootclasspath_fragment.
All_flags *string `android:"path"`
// The path to the filtered-stub-flags.csv file created by the bootclasspath_fragment.
Filtered_stub_flags *string `android:"path"`
// The path to the filtered-flags.csv file created by the bootclasspath_fragment.
Filtered_flags *string `android:"path"`
}
}
@@ -934,7 +915,7 @@ func (module *prebuiltBootclasspathFragmentModule) Name() string {
// produceHiddenAPIOutput returns a path to the prebuilt all-flags.csv or nil if none is specified.
func (module *prebuiltBootclasspathFragmentModule) produceHiddenAPIOutput(ctx android.ModuleContext, contents []android.Module, input HiddenAPIFlagInput) *HiddenAPIOutput {
pathForOptionalSrc := func(src *string, defaultPath android.Path) android.Path {
pathForOptionalSrc := func(src *string) android.Path {
if src == nil {
return nil
}
@@ -957,19 +938,13 @@ func (module *prebuiltBootclasspathFragmentModule) produceHiddenAPIOutput(ctx an
AnnotationFlagsPath: pathForSrc("hidden_api.annotation_flags", module.prebuiltProperties.Hidden_api.Annotation_flags),
MetadataPath: pathForSrc("hidden_api.metadata", module.prebuiltProperties.Hidden_api.Metadata),
IndexPath: pathForSrc("hidden_api.index", module.prebuiltProperties.Hidden_api.Index),
SignaturePatternsPath: pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Signature_patterns, nil),
// TODO: Temporarily handle stub_flags/all_flags properties until prebuilts have been updated.
StubFlagsPath: pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Stub_flags, nil),
AllFlagsPath: pathForOptionalSrc(module.prebuiltProperties.Hidden_api.All_flags, nil),
SignaturePatternsPath: pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Signature_patterns),
StubFlagsPath: pathForSrc("hidden_api.stub_flags", module.prebuiltProperties.Hidden_api.Stub_flags),
AllFlagsPath: pathForSrc("hidden_api.all_flags", module.prebuiltProperties.Hidden_api.All_flags),
},
EncodedBootDexFilesByModule: encodedBootDexJarsByModule,
}
// TODO: Temporarily fallback to stub_flags/all_flags properties until prebuilts have been updated.
output.FilteredStubFlagsPath = pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Filtered_stub_flags, output.StubFlagsPath)
output.FilteredFlagsPath = pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Filtered_flags, output.AllFlagsPath)
return &output
}

View File

@@ -548,18 +548,18 @@ func (i *HiddenAPIInfo) mergeFromFragmentDeps(ctx android.ModuleContext, fragmen
}
}
// StubFlagSubset returns a SignatureCsvSubset that contains a path to a filtered-stub-flags.csv
// file and a path to a signature-patterns.csv file that defines a subset of the monolithic stub
// flags file, i.e. out/soong/hiddenapi/hiddenapi-stub-flags.txt, against which it will be compared.
// StubFlagSubset returns a SignatureCsvSubset that contains a path to a stub-flags.csv file and a
// path to a signature-patterns.csv file that defines a subset of the monolithic stub flags file,
// i.e. out/soong/hiddenapi/hiddenapi-stub-flags.txt, against which it will be compared.
func (i *HiddenAPIInfo) StubFlagSubset() SignatureCsvSubset {
return SignatureCsvSubset{i.FilteredStubFlagsPath, i.SignaturePatternsPath}
return SignatureCsvSubset{i.StubFlagsPath, i.SignaturePatternsPath}
}
// FlagSubset returns a SignatureCsvSubset that contains a path to a filtered-flags.csv file and a
// FlagSubset returns a SignatureCsvSubset that contains a path to an all-flags.csv file and a
// path to a signature-patterns.csv file that defines a subset of the monolithic flags file, i.e.
// out/soong/hiddenapi/hiddenapi-flags.csv, against which it will be compared.
func (i *HiddenAPIInfo) FlagSubset() SignatureCsvSubset {
return SignatureCsvSubset{i.FilteredFlagsPath, i.SignaturePatternsPath}
return SignatureCsvSubset{i.AllFlagsPath, i.SignaturePatternsPath}
}
var HiddenAPIInfoProvider = blueprint.NewProvider(HiddenAPIInfo{})
@@ -784,6 +784,9 @@ func (i *HiddenAPIFlagInput) transitiveStubDexJarsByScope() StubDexJarsByModule
// HiddenAPIFlagOutput contains paths to output files from the hidden API flag generation for a
// bootclasspath_fragment module.
type HiddenAPIFlagOutput struct {
// The path to the generated stub-flags.csv file.
StubFlagsPath android.Path
// The path to the generated annotation-flags.csv file.
AnnotationFlagsPath android.Path
@@ -793,21 +796,12 @@ type HiddenAPIFlagOutput struct {
// The path to the generated index.csv file.
IndexPath android.Path
// The path to the generated stub-flags.csv file.
StubFlagsPath android.Path
// The path to the generated all-flags.csv file.
AllFlagsPath android.Path
// The path to the generated signature-patterns.txt file which defines the subset of the
// monolithic hidden API files provided in this.
SignaturePatternsPath android.Path
// The path to the generated filtered-stub-flags.csv file.
FilteredStubFlagsPath android.Path
// The path to the generated filtered-flags.csv file.
FilteredFlagsPath android.Path
}
// bootDexJarByModule is a map from base module name (without prebuilt_ prefix) to the boot dex
@@ -1073,13 +1067,11 @@ func hiddenAPIRulesForBootclasspathFragment(ctx android.ModuleContext, contents
// Store the paths in the info for use by other modules and sdk snapshot generation.
output := HiddenAPIOutput{
HiddenAPIFlagOutput: HiddenAPIFlagOutput{
AnnotationFlagsPath: annotationFlagsCSV,
MetadataPath: metadataCSV,
IndexPath: indexCSV,
StubFlagsPath: stubFlagsCSV,
AllFlagsPath: allFlagsCSV,
FilteredStubFlagsPath: filteredStubFlagsCSV,
FilteredFlagsPath: filteredFlagsCSV,
StubFlagsPath: filteredStubFlagsCSV,
AnnotationFlagsPath: annotationFlagsCSV,
MetadataPath: metadataCSV,
IndexPath: indexCSV,
AllFlagsPath: filteredFlagsCSV,
},
EncodedBootDexFilesByModule: encodedBootDexJarsByModule,
}