diff options
author | 2023-03-20 18:52:50 +0000 | |
---|---|---|
committer | 2023-03-20 20:50:03 +0000 | |
commit | 626a8ad9348066fdca52aefe25ce004d8ae56e44 (patch) | |
tree | 1ef9dd45be6ab9d173d7c21f8e0083473a83e034 /java/sdk.go | |
parent | 44ac6dad279f320f6c5cae445b5aded0ae5dd847 (diff) |
Cleanup hardcoded references to android_*stubs_current
These hardcoded refs will need to be updated when we start using .txt
stub equivalent (single-tree/multi-tree). Instead of strewing this logic
all over the codebase, create a helper function that contains the
replacement logic. All other places should call this helper function
instead of calculating the name of .txt equivalent soong module by
itself.
(Will do a similar cleanup in build/make)
Test: no change in ninja file
Change-Id: I6bf999eb4aeaba6ac2a44b9016bae4ec8c79ce19
Diffstat (limited to 'java/sdk.go')
-rw-r--r-- | java/sdk.go | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/java/sdk.go b/java/sdk.go index 1e7727b49..72a50067c 100644 --- a/java/sdk.go +++ b/java/sdk.go @@ -191,12 +191,8 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext android.SdkContext) bootclasspath: corePlatformBootclasspathLibraries(ctx), noFrameworksLibs: true, } - case android.SdkPublic: - return toModule("android_stubs_current", sdkFrameworkAidlPath(ctx)) - case android.SdkSystem: - return toModule("android_system_stubs_current", sdkFrameworkAidlPath(ctx)) - case android.SdkTest: - return toModule("android_test_stubs_current", sdkFrameworkAidlPath(ctx)) + case android.SdkPublic, android.SdkSystem, android.SdkTest: + return toModule(sdkVersion.Kind.JavaLibraryName(ctx.Config()), sdkFrameworkAidlPath(ctx)) case android.SdkCore: return sdkDep{ useModule: true, @@ -206,10 +202,10 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext android.SdkContext) } case android.SdkModule: // TODO(146757305): provide .apk and .aidl that have more APIs for modules - return toModule("android_module_lib_stubs_current", nonUpdatableFrameworkAidlPath(ctx)) + return toModule(sdkVersion.Kind.JavaLibraryName(ctx.Config()), nonUpdatableFrameworkAidlPath(ctx)) case android.SdkSystemServer: // TODO(146757305): provide .apk and .aidl that have more APIs for modules - return toModule("android_system_server_stubs_current", sdkFrameworkAidlPath(ctx)) + return toModule(sdkVersion.Kind.JavaLibraryName(ctx.Config()), sdkFrameworkAidlPath(ctx)) default: panic(fmt.Errorf("invalid sdk %q", sdkVersion.Raw)) } @@ -272,9 +268,9 @@ func (sdkSingleton) GenerateBuildActions(ctx android.SingletonContext) { // Create framework.aidl by extracting anything that implements android.os.Parcelable from the SDK stubs modules. func createSdkFrameworkAidl(ctx android.SingletonContext) { stubsModules := []string{ - "android_stubs_current", - "android_test_stubs_current", - "android_system_stubs_current", + android.SdkPublic.JavaLibraryName(ctx.Config()), + android.SdkTest.JavaLibraryName(ctx.Config()), + android.SdkSystem.JavaLibraryName(ctx.Config()), } combinedAidl := sdkFrameworkAidlPath(ctx) @@ -289,7 +285,7 @@ func createSdkFrameworkAidl(ctx android.SingletonContext) { // Creates a version of framework.aidl for the non-updatable part of the platform. func createNonUpdatableFrameworkAidl(ctx android.SingletonContext) { - stubsModules := []string{"android_module_lib_stubs_current"} + stubsModules := []string{android.SdkModule.JavaLibraryName(ctx.Config())} combinedAidl := nonUpdatableFrameworkAidlPath(ctx) tempPath := tempPathForRestat(ctx, combinedAidl) |