diff options
author | 2025-01-10 22:26:01 +0000 | |
---|---|---|
committer | 2025-01-10 22:27:14 +0000 | |
commit | c0a3630e4d807be5f2e0d0d1e61cad8d67de610c (patch) | |
tree | 4bab08284604019662b3378c52710a95b128990f /java/java.go | |
parent | 460cf3783713a82c0f8c41d97c76f3e92451f3e6 (diff) |
Convert checkSdkVersions to use ModuleProxy.
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I5d7150feb8dbb84ac4e01059e76f451fbfc5f7eb
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index 25be93b46..1689aeeb7 100644 --- a/java/java.go +++ b/java/java.go @@ -276,6 +276,11 @@ type ModuleWithUsesLibraryInfo struct { UsesLibrary *usesLibrary } +type ModuleWithSdkDepInfo struct { + SdkLinkType sdkLinkType + Stubs bool +} + // JavaInfo contains information about a java module for use by modules that depend on it. type JavaInfo struct { // HeaderJars is a list of jars that can be passed as the javac classpath in order to link @@ -364,10 +369,16 @@ type JavaInfo struct { ProvidesUsesLibInfo *ProvidesUsesLibInfo ModuleWithUsesLibraryInfo *ModuleWithUsesLibraryInfo + + ModuleWithSdkDepInfo *ModuleWithSdkDepInfo } var JavaInfoProvider = blueprint.NewProvider[*JavaInfo]() +type JavaLibraryInfo struct{} + +var JavaLibraryInfoProvider = blueprint.NewProvider[JavaLibraryInfo]() + // SyspropPublicStubInfo contains info about the sysprop public stub library that corresponds to // the sysprop implementation library. type SyspropPublicStubInfo struct { @@ -1047,6 +1058,8 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { TopLevelTarget: j.sourceProperties.Top_level_test_target, }) + android.SetProvider(ctx, JavaLibraryInfoProvider, JavaLibraryInfo{}) + if javaInfo != nil { setExtraJavaInfo(ctx, j, javaInfo) android.SetProvider(ctx, JavaInfoProvider, javaInfo) @@ -3542,4 +3555,12 @@ func setExtraJavaInfo(ctx android.ModuleContext, module android.Module, javaInfo UsesLibrary: mwul.UsesLibrary(), } } + + if mwsd, ok := module.(moduleWithSdkDep); ok { + linkType, stubs := mwsd.getSdkLinkType(ctx, ctx.ModuleName()) + javaInfo.ModuleWithSdkDepInfo = &ModuleWithSdkDepInfo{ + SdkLinkType: linkType, + Stubs: stubs, + } + } } |