From e339a2d9a3674c0577e87d2004c6327e56e0f00f Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Thu, 30 Mar 2023 02:59:22 +0000 Subject: [PATCH] Rename core stubs to .txt stubs if applicable In scope: - core.current.stubs - system modules generated for core's public stubs - system modules generated for core's module_lib stubs The system modules generated for core_platform api surface will be handled in aosp/2514755 Test: go build ./java Change-Id: I34134f79c8ae6e5b218d0b85553de5a748a8cc3f --- java/base.go | 2 +- java/sdk.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/java/base.go b/java/base.go index 1bcff2ed5..991132321 100644 --- a/java/base.go +++ b/java/base.go @@ -1923,7 +1923,7 @@ type moduleWithSdkDep interface { func (m *Module) getSdkLinkType(ctx android.BaseModuleContext, name string) (ret sdkLinkType, stubs bool) { switch name { - case "core.current.stubs", "legacy.core.platform.api.stubs", "stable.core.platform.api.stubs", + case android.SdkCore.JavaLibraryName(ctx.Config()), "legacy.core.platform.api.stubs", "stable.core.platform.api.stubs", "stub-annotations", "private-stub-annotations-jar", "core-lambda-stubs", "core-generated-annotation-stubs": return javaCore, true diff --git a/java/sdk.go b/java/sdk.go index 72a50067c..1b18ba40a 100644 --- a/java/sdk.go +++ b/java/sdk.go @@ -148,10 +148,11 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext android.SdkContext) toModule := func(module string, aidl android.Path) sdkDep { // Select the kind of system modules needed for the sdk version. systemModulesKind := systemModuleKind(sdkVersion.Kind, android.FutureApiLevel) + systemModules := android.JavaApiLibraryName(ctx.Config(), fmt.Sprintf("core-%s-stubs-system-modules", systemModulesKind)) return sdkDep{ useModule: true, bootclasspath: []string{module, config.DefaultLambdaStubsLibrary}, - systemModules: fmt.Sprintf("core-%s-stubs-system-modules", systemModulesKind), + systemModules: systemModules, java9Classpath: []string{module}, frameworkResModule: "framework-res", aidl: android.OptionalPathForPath(aidl), @@ -196,8 +197,8 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext android.SdkContext) case android.SdkCore: return sdkDep{ useModule: true, - bootclasspath: []string{"core.current.stubs", config.DefaultLambdaStubsLibrary}, - systemModules: "core-public-stubs-system-modules", + bootclasspath: []string{android.SdkCore.JavaLibraryName(ctx.Config()), config.DefaultLambdaStubsLibrary}, + systemModules: android.JavaApiLibraryName(ctx.Config(), "core-public-stubs-system-modules"), noFrameworksLibs: true, } case android.SdkModule: