Merge "Propagate intermediateCacheFiles in java modules and filegroup" into main
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
package android
|
package android
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"maps"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
@@ -97,6 +98,25 @@ func (fg *fileGroup) GenerateAndroidBuildActions(ctx ModuleContext) {
|
|||||||
}
|
}
|
||||||
SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: fg.srcs.Strings()})
|
SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: fg.srcs.Strings()})
|
||||||
CollectDependencyAconfigFiles(ctx, &fg.mergedAconfigFiles)
|
CollectDependencyAconfigFiles(ctx, &fg.mergedAconfigFiles)
|
||||||
|
|
||||||
|
var aconfigDeclarations []string
|
||||||
|
var intermediateCacheOutputPaths Paths
|
||||||
|
var srcjars Paths
|
||||||
|
modeInfos := make(map[string]ModeInfo)
|
||||||
|
ctx.VisitDirectDeps(func(module Module) {
|
||||||
|
if dep, ok := OtherModuleProvider(ctx, module, CodegenInfoProvider); ok {
|
||||||
|
aconfigDeclarations = append(aconfigDeclarations, dep.AconfigDeclarations...)
|
||||||
|
intermediateCacheOutputPaths = append(intermediateCacheOutputPaths, dep.IntermediateCacheOutputPaths...)
|
||||||
|
srcjars = append(srcjars, dep.Srcjars...)
|
||||||
|
maps.Copy(modeInfos, dep.ModeInfos)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
SetProvider(ctx, CodegenInfoProvider, CodegenInfo{
|
||||||
|
AconfigDeclarations: aconfigDeclarations,
|
||||||
|
IntermediateCacheOutputPaths: intermediateCacheOutputPaths,
|
||||||
|
Srcjars: srcjars,
|
||||||
|
ModeInfos: modeInfos,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fg *fileGroup) Srcs() Paths {
|
func (fg *fileGroup) Srcs() Paths {
|
||||||
|
53
java/base.go
53
java/base.go
@@ -1219,14 +1219,15 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
|
|||||||
}
|
}
|
||||||
|
|
||||||
android.SetProvider(ctx, JavaInfoProvider, JavaInfo{
|
android.SetProvider(ctx, JavaInfoProvider, JavaInfo{
|
||||||
HeaderJars: android.PathsIfNonNil(j.headerJarFile),
|
HeaderJars: android.PathsIfNonNil(j.headerJarFile),
|
||||||
TransitiveLibsHeaderJars: j.transitiveLibsHeaderJars,
|
TransitiveLibsHeaderJars: j.transitiveLibsHeaderJars,
|
||||||
TransitiveStaticLibsHeaderJars: j.transitiveStaticLibsHeaderJars,
|
TransitiveStaticLibsHeaderJars: j.transitiveStaticLibsHeaderJars,
|
||||||
AidlIncludeDirs: j.exportAidlIncludeDirs,
|
AidlIncludeDirs: j.exportAidlIncludeDirs,
|
||||||
ExportedPlugins: j.exportedPluginJars,
|
ExportedPlugins: j.exportedPluginJars,
|
||||||
ExportedPluginClasses: j.exportedPluginClasses,
|
ExportedPluginClasses: j.exportedPluginClasses,
|
||||||
ExportedPluginDisableTurbine: j.exportedDisableTurbine,
|
ExportedPluginDisableTurbine: j.exportedDisableTurbine,
|
||||||
StubsLinkType: j.stubsLinkType,
|
StubsLinkType: j.stubsLinkType,
|
||||||
|
AconfigIntermediateCacheOutputPaths: deps.aconfigProtoFiles,
|
||||||
})
|
})
|
||||||
|
|
||||||
j.outputFile = j.headerJarFile
|
j.outputFile = j.headerJarFile
|
||||||
@@ -1729,22 +1730,23 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
|
|||||||
android.CollectDependencyAconfigFiles(ctx, &j.mergedAconfigFiles)
|
android.CollectDependencyAconfigFiles(ctx, &j.mergedAconfigFiles)
|
||||||
|
|
||||||
android.SetProvider(ctx, JavaInfoProvider, JavaInfo{
|
android.SetProvider(ctx, JavaInfoProvider, JavaInfo{
|
||||||
HeaderJars: android.PathsIfNonNil(j.headerJarFile),
|
HeaderJars: android.PathsIfNonNil(j.headerJarFile),
|
||||||
RepackagedHeaderJars: android.PathsIfNonNil(j.repackagedHeaderJarFile),
|
RepackagedHeaderJars: android.PathsIfNonNil(j.repackagedHeaderJarFile),
|
||||||
TransitiveLibsHeaderJars: j.transitiveLibsHeaderJars,
|
TransitiveLibsHeaderJars: j.transitiveLibsHeaderJars,
|
||||||
TransitiveStaticLibsHeaderJars: j.transitiveStaticLibsHeaderJars,
|
TransitiveStaticLibsHeaderJars: j.transitiveStaticLibsHeaderJars,
|
||||||
ImplementationAndResourcesJars: android.PathsIfNonNil(j.implementationAndResourcesJar),
|
ImplementationAndResourcesJars: android.PathsIfNonNil(j.implementationAndResourcesJar),
|
||||||
ImplementationJars: android.PathsIfNonNil(j.implementationJarFile),
|
ImplementationJars: android.PathsIfNonNil(j.implementationJarFile),
|
||||||
ResourceJars: android.PathsIfNonNil(j.resourceJar),
|
ResourceJars: android.PathsIfNonNil(j.resourceJar),
|
||||||
AidlIncludeDirs: j.exportAidlIncludeDirs,
|
AidlIncludeDirs: j.exportAidlIncludeDirs,
|
||||||
SrcJarArgs: j.srcJarArgs,
|
SrcJarArgs: j.srcJarArgs,
|
||||||
SrcJarDeps: j.srcJarDeps,
|
SrcJarDeps: j.srcJarDeps,
|
||||||
TransitiveSrcFiles: j.transitiveSrcFiles,
|
TransitiveSrcFiles: j.transitiveSrcFiles,
|
||||||
ExportedPlugins: j.exportedPluginJars,
|
ExportedPlugins: j.exportedPluginJars,
|
||||||
ExportedPluginClasses: j.exportedPluginClasses,
|
ExportedPluginClasses: j.exportedPluginClasses,
|
||||||
ExportedPluginDisableTurbine: j.exportedDisableTurbine,
|
ExportedPluginDisableTurbine: j.exportedDisableTurbine,
|
||||||
JacocoReportClassesFile: j.jacocoReportClassesFile,
|
JacocoReportClassesFile: j.jacocoReportClassesFile,
|
||||||
StubsLinkType: j.stubsLinkType,
|
StubsLinkType: j.stubsLinkType,
|
||||||
|
AconfigIntermediateCacheOutputPaths: deps.aconfigProtoFiles,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Save the output file with no relative path so that it doesn't end up in a subdirectory when used as a resource
|
// Save the output file with no relative path so that it doesn't end up in a subdirectory when used as a resource
|
||||||
@@ -2295,6 +2297,7 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
|
|||||||
// annotation processor that generates API is incompatible with the turbine
|
// annotation processor that generates API is incompatible with the turbine
|
||||||
// optimization.
|
// optimization.
|
||||||
deps.disableTurbine = deps.disableTurbine || dep.ExportedPluginDisableTurbine
|
deps.disableTurbine = deps.disableTurbine || dep.ExportedPluginDisableTurbine
|
||||||
|
deps.aconfigProtoFiles = append(deps.aconfigProtoFiles, dep.AconfigIntermediateCacheOutputPaths...)
|
||||||
case pluginTag:
|
case pluginTag:
|
||||||
if plugin, ok := module.(*Plugin); ok {
|
if plugin, ok := module.(*Plugin); ok {
|
||||||
if plugin.pluginProperties.Processor_class != nil {
|
if plugin.pluginProperties.Processor_class != nil {
|
||||||
@@ -2353,6 +2356,8 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
|
|||||||
deps.staticJars = append(deps.staticJars, dep.Srcs()...)
|
deps.staticJars = append(deps.staticJars, dep.Srcs()...)
|
||||||
deps.staticHeaderJars = append(deps.staticHeaderJars, dep.Srcs()...)
|
deps.staticHeaderJars = append(deps.staticHeaderJars, dep.Srcs()...)
|
||||||
}
|
}
|
||||||
|
} else if dep, ok := android.OtherModuleProvider(ctx, module, android.CodegenInfoProvider); ok {
|
||||||
|
deps.aconfigProtoFiles = append(deps.aconfigProtoFiles, dep.IntermediateCacheOutputPaths...)
|
||||||
} else {
|
} else {
|
||||||
switch tag {
|
switch tag {
|
||||||
case bootClasspathTag:
|
case bootClasspathTag:
|
||||||
|
@@ -309,6 +309,10 @@ type JavaInfo struct {
|
|||||||
// implementation jars. If the provider is set by java_sdk_library, the link type is "unknown"
|
// implementation jars. If the provider is set by java_sdk_library, the link type is "unknown"
|
||||||
// and selection between the stub jar vs implementation jar is deferred to SdkLibrary.sdkJars(...)
|
// and selection between the stub jar vs implementation jar is deferred to SdkLibrary.sdkJars(...)
|
||||||
StubsLinkType StubsLinkType
|
StubsLinkType StubsLinkType
|
||||||
|
|
||||||
|
// AconfigIntermediateCacheOutputPaths is a path to the cache files collected from the
|
||||||
|
// java_aconfig_library modules that are statically linked to this module.
|
||||||
|
AconfigIntermediateCacheOutputPaths android.Paths
|
||||||
}
|
}
|
||||||
|
|
||||||
var JavaInfoProvider = blueprint.NewProvider[JavaInfo]()
|
var JavaInfoProvider = blueprint.NewProvider[JavaInfo]()
|
||||||
|
Reference in New Issue
Block a user