Add HiddenAPIScope to replace use of SdkKind
Previously, the hidden API processing used SdkKind to identify the API scopes, e.g. public, system, etc. that are of interest for hidden API processing. Unfortunately, there is a mismatch between the SdkKind and what hidden API processing needs. e.g. SdkKind includes values that are not used by hidden API processing and hidden API processing needs additional API scope specific information not provided by SdkKind. The apiScope struct used in sdk_library.go is also not a suitable representation for similar reasons. This change adds the HiddenAPIScope (following a similar approach as apiScope) that rectifies that and uses it as a replacement for SdkKind in most parts of the hidden API processing. The SdkKind is still used for retrieving information from java_sdk_library[_import] modules. Follow up changes will extend the HiddenAPIScope with more information. Bug: 179354495 Test: m out/soong/hiddenapi/hiddenapi-flags.csv - make sure that this change has no effect on the generated flags. Change-Id: I97968f58535121652852b8d25217aa288afd2bfd
This commit is contained in:
@@ -121,6 +121,7 @@ type bootclasspathFragmentProperties struct {
|
||||
BootclasspathFragmentCoverageAffectedProperties
|
||||
Coverage BootclasspathFragmentCoverageAffectedProperties
|
||||
|
||||
// Hidden API related properties.
|
||||
Hidden_api HiddenAPIFlagFileProperties
|
||||
|
||||
// Properties that allow a fragment to depend on other fragments. This is needed for hidden API
|
||||
@@ -378,7 +379,7 @@ func (b *BootclasspathFragmentModule) ComponentDepsMutator(ctx android.BottomUpM
|
||||
func (b *BootclasspathFragmentModule) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
// Add dependencies onto all the modules that provide the API stubs for classes on this
|
||||
// bootclasspath fragment.
|
||||
hiddenAPIAddStubLibDependencies(ctx, b.properties.sdkKindToStubLibs())
|
||||
hiddenAPIAddStubLibDependencies(ctx, b.properties.apiScopeToStubLibs())
|
||||
|
||||
if SkipDexpreoptBootJars(ctx) {
|
||||
return
|
||||
@@ -595,7 +596,7 @@ func (b *BootclasspathFragmentModule) generateHiddenAPIBuildActions(ctx android.
|
||||
// Other bootclasspath_fragments that depend on this need the transitive set of stub dex jars
|
||||
// from this to resolve any references from their code to classes provided by this fragment
|
||||
// and the fragments this depends upon.
|
||||
TransitiveStubDexJarsByKind: input.transitiveStubDexJarsByKind(),
|
||||
TransitiveStubDexJarsByScope: input.transitiveStubDexJarsByScope(),
|
||||
}
|
||||
|
||||
// The monolithic hidden API processing also needs access to all the output files produced by
|
||||
@@ -640,7 +641,7 @@ func (b *BootclasspathFragmentModule) createHiddenAPIFlagInput(ctx android.Modul
|
||||
input.extractFlagFilesFromProperties(ctx, &b.properties.Hidden_api)
|
||||
|
||||
// Store the stub dex jars from this module's fragment dependencies.
|
||||
input.DependencyStubDexJarsByKind = dependencyHiddenApiInfo.TransitiveStubDexJarsByKind
|
||||
input.DependencyStubDexJarsByScope = dependencyHiddenApiInfo.TransitiveStubDexJarsByScope
|
||||
|
||||
return input
|
||||
}
|
||||
|
Reference in New Issue
Block a user