From 2a815b6d8ea8f29b54f780b1219c28b0c8c977aa Mon Sep 17 00:00:00 2001 From: Yu Liu Date: Fri, 21 Feb 2025 20:46:25 +0000 Subject: Convert the following singletons to use ModuleProxy: buildTargetSingleton exportedJavaDeclarationsLibrarySingleton javaFuzzPackager kytheExtractAllSingleton kytheExtractJavaSingleton kytheExtractRustSingleton lintSingleton logtagsSingleton makeVarsSingleton ndkAbiDiffSingleton ndkAbiDumpSingleton phonySingleton platformCompatConfigSingleton sdkSingleton Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I625ac8a209ca93755b2ba232202cfb44ecefde0a --- rust/rust.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'rust/rust.go') diff --git a/rust/rust.go b/rust/rust.go index 4eebda301..d8a044423 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -60,6 +60,7 @@ type RustInfo struct { CompilerInfo *CompilerInfo SnapshotInfo *cc.SnapshotInfo SourceProviderInfo *SourceProviderInfo + XrefRustFiles android.Paths } var RustInfoProvider = blueprint.NewProvider[*RustInfo]() @@ -1171,6 +1172,7 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { AndroidMkSuffix: mod.AndroidMkSuffix(), RustSubName: mod.Properties.RustSubName, TransitiveAndroidMkSharedLibs: mod.transitiveAndroidMkSharedLibs, + XrefRustFiles: mod.XrefRustFiles(), } if mod.compiler != nil { rustInfo.CompilerInfo = &CompilerInfo{ @@ -2236,9 +2238,9 @@ type kytheExtractRustSingleton struct { func (k kytheExtractRustSingleton) GenerateBuildActions(ctx android.SingletonContext) { var xrefTargets android.Paths - ctx.VisitAllModules(func(module android.Module) { - if rustModule, ok := module.(xref); ok { - xrefTargets = append(xrefTargets, rustModule.XrefRustFiles()...) + ctx.VisitAllModuleProxies(func(module android.ModuleProxy) { + if rustModule, ok := android.OtherModuleProvider(ctx, module, RustInfoProvider); ok { + xrefTargets = append(xrefTargets, rustModule.XrefRustFiles...) } }) if len(xrefTargets) > 0 { -- cgit v1.2.3-59-g8ed1b