summaryrefslogtreecommitdiff
path: root/java/hiddenapi_modular.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-08-10 16:14:16 +0100
committer Paul Duffin <paulduffin@google.com> 2021-10-05 15:27:42 +0100
commit191be3a186a0face85909b92b28e3dc8a27940be (patch)
tree6842811bfc3f15132fd1e73203b6acfd949af34a /java/hiddenapi_modular.go
parent6e06f911a573c61b6dd529fdbc1d9fafe4bfa50a (diff)
Retry: Separate hidden API flags needed in sdk snapshots for S and T
Previous change that was reverted: https://r.android.com/1835222 An additional test was added that revealed a bug in the previous change which has been fixed here. Previously, the behavior of the stub_flags and all_flags properties was different between S and T. In S they contained paths for the complete set of stub flags and all the encoded flags. However, in T they contained filtered sets of flags which if used in S would prevent build checks from detecting possible inconsistencies. Also, a new signature_patterns property was added in T that is not supported in S. This change creates separate properties/files for T and reverts the behavior of the properties/files that were added in S back to how they behaved in S. The new properties are called filtered_stub_flags and filtered_flags. The S and T properties are tagged with the appropriate supported_build_releases tag to ensure that they are only output when specifically targeted. Bug: 197842263 Test: m nothing Change-Id: I1ce0a3d6623dabf73e32af1a7457b9b444fc3b7c
Diffstat (limited to 'java/hiddenapi_modular.go')
-rw-r--r--java/hiddenapi_modular.go36
1 files changed, 22 insertions, 14 deletions
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go
index b9a1ca74d..f1e30f320 100644
--- a/java/hiddenapi_modular.go
+++ b/java/hiddenapi_modular.go
@@ -548,18 +548,18 @@ func (i *HiddenAPIInfo) mergeFromFragmentDeps(ctx android.ModuleContext, fragmen
}
}
-// 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.
+// 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.
func (i *HiddenAPIInfo) StubFlagSubset() SignatureCsvSubset {
- return SignatureCsvSubset{i.StubFlagsPath, i.SignaturePatternsPath}
+ return SignatureCsvSubset{i.FilteredStubFlagsPath, i.SignaturePatternsPath}
}
-// FlagSubset returns a SignatureCsvSubset that contains a path to an all-flags.csv file and a
+// FlagSubset returns a SignatureCsvSubset that contains a path to a filtered-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.AllFlagsPath, i.SignaturePatternsPath}
+ return SignatureCsvSubset{i.FilteredFlagsPath, i.SignaturePatternsPath}
}
var HiddenAPIInfoProvider = blueprint.NewProvider(HiddenAPIInfo{})
@@ -784,9 +784,6 @@ 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
@@ -796,12 +793,21 @@ 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
@@ -1067,11 +1073,13 @@ 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{
- StubFlagsPath: filteredStubFlagsCSV,
- AnnotationFlagsPath: annotationFlagsCSV,
- MetadataPath: metadataCSV,
- IndexPath: indexCSV,
- AllFlagsPath: filteredFlagsCSV,
+ AnnotationFlagsPath: annotationFlagsCSV,
+ MetadataPath: metadataCSV,
+ IndexPath: indexCSV,
+ StubFlagsPath: stubFlagsCSV,
+ AllFlagsPath: allFlagsCSV,
+ FilteredStubFlagsPath: filteredStubFlagsCSV,
+ FilteredFlagsPath: filteredFlagsCSV,
},
EncodedBootDexFilesByModule: encodedBootDexJarsByModule,
}