summaryrefslogtreecommitdiff
path: root/rust/project_json.go
diff options
context:
space:
mode:
author ThiƩbaud Weksteen <tweek@google.com> 2020-11-25 16:09:32 +0100
committer ThiƩbaud Weksteen <tweek@google.com> 2020-11-25 16:11:49 +0100
commit3c5905b0cbed94c2b8f5543a14cdc1af2db8acaf (patch)
treed0ba3be62576780f20a25f805ff19e62d3ec63dc /rust/project_json.go
parentb26070efef296bdd26c9d2ddadd0b4083587c484 (diff)
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
Diffstat (limited to 'rust/project_json.go')
-rw-r--r--rust/project_json.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/rust/project_json.go b/rust/project_json.go
index 569740831..8d9e50ca9 100644
--- a/rust/project_json.go
+++ b/rust/project_json.go
@@ -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
}