summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go21
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,
+ }
+ }
}