From 6b73fcb2009371f2d46bcbcab0865aabc4d8dc24 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Mon, 20 Mar 2023 20:20:58 +0000 Subject: [PATCH] Export the name of stub java Soong modules build/make has several hardcoded references to these modules. In preparation for switching between stubs generated from .txt files, export these module names to Make. This prevents duplication of stub selection logic in multiple places. Test: TH Change-Id: I5b1ef27aaea269d60aa7953787ea10d1b2a793f2 --- android/sdk_version.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/android/sdk_version.go b/android/sdk_version.go index cace88a01..842b84957 100644 --- a/android/sdk_version.go +++ b/android/sdk_version.go @@ -350,3 +350,18 @@ func (s SdkSpec) ValidateSystemSdk(ctx EarlyModuleContext) bool { } return true } + +func init() { + RegisterMakeVarsProvider(pctx, javaSdkMakeVars) +} + +// Export the name of the soong modules representing the various Java API surfaces. +func javaSdkMakeVars(ctx MakeVarsContext) { + ctx.Strict("ANDROID_PUBLIC_STUBS", SdkPublic.JavaLibraryName(ctx.Config())) + ctx.Strict("ANDROID_SYSTEM_STUBS", SdkSystem.JavaLibraryName(ctx.Config())) + ctx.Strict("ANDROID_TEST_STUBS", SdkTest.JavaLibraryName(ctx.Config())) + ctx.Strict("ANDROID_MODULE_LIB_STUBS", SdkModule.JavaLibraryName(ctx.Config())) + ctx.Strict("ANDROID_SYSTEM_SERVER_STUBS", SdkSystemServer.JavaLibraryName(ctx.Config())) + // TODO (jihoonkang): Create a .txt equivalent for core.current.stubs + ctx.Strict("ANDROID_CORE_STUBS", SdkCore.JavaLibraryName(ctx.Config())) +}