mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-05 12:54:35 +00:00
Give the native call component its view of Matrix
The factory lives in libraries/matrix/impl because that is the only module compiled against the Rust SDK, and is app-scoped because a call is started for whichever account it belongs to rather than the one on screen. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,16 +20,47 @@ android {
|
||||
|
||||
setupDependencyInjection()
|
||||
|
||||
// Temporary: `-PelementCallLocalVersion` points this at a locally published build of
|
||||
// element-call-android, because the library has no remote repository yet. Goes with the mavenLocal
|
||||
// block in settings.gradle.kts. Only the BOM carries a version; every other artifact follows it.
|
||||
val elementCallVersion: String = providers.gradleProperty("elementCallLocalVersion")
|
||||
.getOrElse(libs.versions.element.call.get())
|
||||
|
||||
val usesLocalRustSdk = file("${rootDir.path}/libraries/rustsdk/matrix-rust-sdk.aar").exists()
|
||||
|
||||
if (usesLocalRustSdk) {
|
||||
// element-call-matrix declares the Rust SDK as an ordinary Maven dependency, so with the local
|
||||
// AAR in place a debug classpath would carry two copies of org.matrix.rustcomponents.sdk.
|
||||
// Point the library's dependency at the same local AAR the app is using.
|
||||
configurations.matching { it.name.startsWith("debug") }.configureEach {
|
||||
resolutionStrategy.dependencySubstitution {
|
||||
substitute(module("org.matrix.rustcomponents:sdk-android"))
|
||||
.using(project(":libraries:rustsdk"))
|
||||
.because("the local Rust SDK AAR replaces the published one on debug builds")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
releaseImplementation(libs.matrix.sdk)
|
||||
if (file("${rootDir.path}/libraries/rustsdk/matrix-rust-sdk.aar").exists()) {
|
||||
println("\nNote: Using local binary of the Rust SDK.\n")
|
||||
if (usesLocalRustSdk) {
|
||||
println(
|
||||
"\nNote: Using local binary of the Rust SDK." +
|
||||
"\n element-call-matrix is substituted onto it as well, so the native call runs" +
|
||||
"\n against this SDK rather than the one it was published against.\n"
|
||||
)
|
||||
debugImplementation(projects.libraries.rustsdk)
|
||||
} else {
|
||||
debugImplementation(libs.matrix.sdk)
|
||||
}
|
||||
implementation(variantOf(libs.rustls.platform.verifier) { artifactType("aar") })
|
||||
|
||||
// The native call's Matrix transport. Only this module may hand it a raw SDK client.
|
||||
implementation(platform("io.element.android:element-call-bom:$elementCallVersion"))
|
||||
implementation(libs.element.call.api)
|
||||
implementation(projects.features.callnative.api)
|
||||
implementation(libs.element.call.matrix)
|
||||
|
||||
implementation(projects.appconfig)
|
||||
implementation(projects.features.enterprise.api)
|
||||
implementation(projects.libraries.androidutils)
|
||||
|
||||
Reference in New Issue
Block a user