summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2025-02-13 10:12:52 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-02-13 10:12:52 -0800
commit3f603bd3f188cd779edff3fa2a1080d4bf3bfe1a (patch)
tree95337048dda8cd920cd3508ac0ac6ca597e37a68 /rust
parentcc5cf314dde14d579d8b347f09ca485be4c40d80 (diff)
parentf1806039ea089186042c01df1141633fc3cf7f5a (diff)
Merge "Support DepIsInSameApex using provider." into main
Diffstat (limited to 'rust')
-rw-r--r--rust/rust.go30
1 files changed, 23 insertions, 7 deletions
diff --git a/rust/rust.go b/rust/rust.go
index 4eec5d254..4fd800282 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -2115,12 +2115,28 @@ func (mod *Module) AlwaysRequiresPlatformApexVariant() bool {
}
// Implements android.ApexModule
-func (mod *Module) OutgoingDepIsInSameApex(depTag blueprint.DependencyTag) bool {
+type RustDepInSameApexChecker struct {
+ Static bool
+ HasStubsVariants bool
+ ApexExclude bool
+ Host bool
+}
+
+func (mod *Module) GetDepInSameApexChecker() android.DepInSameApexChecker {
+ return RustDepInSameApexChecker{
+ Static: mod.Static(),
+ HasStubsVariants: mod.HasStubsVariants(),
+ ApexExclude: mod.ApexExclude(),
+ Host: mod.Host(),
+ }
+}
+
+func (r RustDepInSameApexChecker) OutgoingDepIsInSameApex(depTag blueprint.DependencyTag) bool {
if depTag == procMacroDepTag || depTag == customBindgenDepTag {
return false
}
- if mod.Static() && cc.IsSharedDepTag(depTag) {
+ if r.Static && cc.IsSharedDepTag(depTag) {
// shared_lib dependency from a static lib is considered as crossing
// the APEX boundary because the dependency doesn't actually is
// linked; the dependency is used only during the compilation phase.
@@ -2137,23 +2153,23 @@ func (mod *Module) OutgoingDepIsInSameApex(depTag blueprint.DependencyTag) bool
}
// TODO(b/362509506): remove once all apex_exclude uses are switched to stubs.
- if mod.ApexExclude() {
+ if r.ApexExclude {
return false
}
return true
}
-func (mod *Module) IncomingDepIsInSameApex(depTag blueprint.DependencyTag) bool {
- if mod.Host() {
+func (r RustDepInSameApexChecker) IncomingDepIsInSameApex(depTag blueprint.DependencyTag) bool {
+ if r.Host {
return false
}
// TODO(b/362509506): remove once all apex_exclude uses are switched to stubs.
- if mod.ApexExclude() {
+ if r.ApexExclude {
return false
}
- if mod.HasStubsVariants() {
+ if r.HasStubsVariants {
if cc.IsSharedDepTag(depTag) && !cc.IsExplicitImplSharedDepTag(depTag) {
// dynamic dep to a stubs lib crosses APEX boundary
return false