Ignore variant dependencies in rust-project.json

Source-generated library modules will have a dependency on the source
variant. This creates a cycle in the dependency graph which triggers a
warning from rust-analyzer. Ignore this type of dependency.

Test: m nothing
Change-Id: I13365093ebb88b00f6a72734b01114ec3e9a320e
This commit is contained in:
Thiébaud Weksteen
2020-11-25 16:09:32 +01:00
parent b26070efef
commit 3c5905b0cb
2 changed files with 20 additions and 0 deletions

View File

@@ -109,6 +109,10 @@ func (singleton *projectGeneratorSingleton) mergeDependencies(ctx android.Single
if !ok {
return
}
// Skip intra-module dependencies (i.e., generated-source library depending on the source variant).
if module.Name() == child.Name() {
return
}
if _, ok = deps[ctx.ModuleName(child)]; ok {
return
}