Merge "Add ModuleLibHiddenAPIScope for hidden API processing" into sc-dev

This commit is contained in:
Paul Duffin 2021-06-25 18:30:40 +00:00 committed by Android (Google) Code Review
commit 5c6f03cfbf
2 changed files with 14 additions and 7 deletions

View File

@ -848,6 +848,7 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) {
quuzPublicStubs := getDexJarPath(result, "quuz.stubs") quuzPublicStubs := getDexJarPath(result, "quuz.stubs")
quuzSystemStubs := getDexJarPath(result, "quuz.stubs.system") quuzSystemStubs := getDexJarPath(result, "quuz.stubs.system")
quuzTestStubs := getDexJarPath(result, "quuz.stubs.test") quuzTestStubs := getDexJarPath(result, "quuz.stubs.test")
quuzModuleLibStubs := getDexJarPath(result, "quuz.stubs.module_lib")
// Make sure that the fragment uses the quuz stub dex jars when generating the hidden API flags. // Make sure that the fragment uses the quuz stub dex jars when generating the hidden API flags.
fragment := result.ModuleForTests("mybootclasspathfragment", "android_common_apex10000") fragment := result.ModuleForTests("mybootclasspathfragment", "android_common_apex10000")
@ -858,7 +859,7 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) {
// Make sure that the quuz stubs are available for resolving references from the implementation // Make sure that the quuz stubs are available for resolving references from the implementation
// boot dex jars provided by this module. // boot dex jars provided by this module.
android.AssertStringDoesContain(t, "quuz widest", command, "--dependency-stub-dex="+quuzTestStubs) android.AssertStringDoesContain(t, "quuz widest", command, "--dependency-stub-dex="+quuzModuleLibStubs)
// Make sure that the quuz stubs are available for resolving references from the different API // Make sure that the quuz stubs are available for resolving references from the different API
// stubs provided by this module. // stubs provided by this module.

View File

@ -64,6 +64,10 @@ var (
sdkKind: android.SdkTest, sdkKind: android.SdkTest,
hiddenAPIListOption: "--test-stub-classpath", hiddenAPIListOption: "--test-stub-classpath",
}) })
ModuleLibHiddenAPIScope = initHiddenAPIScope(&HiddenAPIScope{
name: "module-lib",
sdkKind: android.SdkModule,
})
CorePlatformHiddenAPIScope = initHiddenAPIScope(&HiddenAPIScope{ CorePlatformHiddenAPIScope = initHiddenAPIScope(&HiddenAPIScope{
name: "core-platform", name: "core-platform",
sdkKind: android.SdkCorePlatform, sdkKind: android.SdkCorePlatform,
@ -76,19 +80,20 @@ var (
// These are roughly in order from narrowest API surface to widest. Widest means the API stubs // These are roughly in order from narrowest API surface to widest. Widest means the API stubs
// with the biggest API surface, e.g. test is wider than system is wider than public. // with the biggest API surface, e.g. test is wider than system is wider than public.
// //
// Core platform is considered wider than system because those modules that provide core platform // Core platform is considered wider than system/module-lib because those modules that provide
// APIs either do not have any system APIs at all, or if they do it is because the core platform // core platform APIs either do not have any system/module-lib APIs at all, or if they do it is
// API is being converted to system APIs. In either case the system API is a subset of core // because the core platform API is being converted to system/module-lib APIs. In either case the
// platform API. // system/module-lib APIs are subsets of the core platform API.
// //
// This is not strictly in order from narrowest to widest as the Test API is wider than system but // This is not strictly in order from narrowest to widest as the Test API is wider than system but
// is neither wider or narrower than the core platform API. However, this works well enough at the // is neither wider or narrower than the module-lib or core platform APIs. However, this works
// moment. // well enough at the moment.
// TODO(b/191644675): Correctly reflect the sub/superset relationships between APIs. // TODO(b/191644675): Correctly reflect the sub/superset relationships between APIs.
hiddenAPIScopes = []*HiddenAPIScope{ hiddenAPIScopes = []*HiddenAPIScope{
PublicHiddenAPIScope, PublicHiddenAPIScope,
SystemHiddenAPIScope, SystemHiddenAPIScope,
TestHiddenAPIScope, TestHiddenAPIScope,
ModuleLibHiddenAPIScope,
CorePlatformHiddenAPIScope, CorePlatformHiddenAPIScope,
} }
@ -100,6 +105,7 @@ var (
PublicHiddenAPIScope, PublicHiddenAPIScope,
SystemHiddenAPIScope, SystemHiddenAPIScope,
TestHiddenAPIScope, TestHiddenAPIScope,
ModuleLibHiddenAPIScope,
} }
// The HiddenAPIScope instances that are supported by the `hiddenapi list`. // The HiddenAPIScope instances that are supported by the `hiddenapi list`.