diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 524af1b314..b279c693ea 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -198,6 +198,7 @@ knit { dependencies { allLibraries() allFeatures() + implementation(projects.libraries.matrix.impl) implementation(projects.tests.uitests) implementation(projects.anvilannotations) anvil(projects.anvilcodegen) diff --git a/app/src/main/kotlin/io/element/android/x/initializer/MatrixInitializer.kt b/app/src/main/kotlin/io/element/android/x/initializer/MatrixInitializer.kt index 9af7738fa8..78f82daee2 100644 --- a/app/src/main/kotlin/io/element/android/x/initializer/MatrixInitializer.kt +++ b/app/src/main/kotlin/io/element/android/x/initializer/MatrixInitializer.kt @@ -18,8 +18,8 @@ package io.element.android.x.initializer import android.content.Context import androidx.startup.Initializer +import io.element.android.libraries.matrix.impl.tracing.setupTracing import io.element.android.libraries.matrix.tracing.TracingConfigurations -import io.element.android.libraries.matrix.tracing.setupTracing import io.element.android.x.BuildConfig class MatrixInitializer : Initializer { diff --git a/features/login/build.gradle.kts b/features/login/build.gradle.kts index f4f8ca4844..076a299e77 100644 --- a/features/login/build.gradle.kts +++ b/features/login/build.gradle.kts @@ -36,7 +36,7 @@ dependencies { anvil(projects.anvilcodegen) implementation(projects.libraries.core) implementation(projects.libraries.architecture) - implementation(projects.libraries.matrix) + implementation(projects.libraries.matrix.api) implementation(projects.libraries.designsystem) implementation(projects.libraries.elementresources) implementation(projects.libraries.testtags) diff --git a/features/logout/build.gradle.kts b/features/logout/build.gradle.kts index 2935965b80..8d4f43cb73 100644 --- a/features/logout/build.gradle.kts +++ b/features/logout/build.gradle.kts @@ -35,7 +35,7 @@ dependencies { anvil(projects.anvilcodegen) implementation(projects.libraries.architecture) implementation(projects.libraries.core) - implementation(projects.libraries.matrix) + implementation(projects.libraries.matrix.api) implementation(projects.libraries.designsystem) implementation(projects.libraries.elementresources) implementation(projects.libraries.uiStrings) diff --git a/features/messages/build.gradle.kts b/features/messages/build.gradle.kts index 1eb054d3d0..cb9c0bd11e 100644 --- a/features/messages/build.gradle.kts +++ b/features/messages/build.gradle.kts @@ -35,7 +35,7 @@ dependencies { anvil(projects.anvilcodegen) implementation(projects.libraries.core) implementation(projects.libraries.architecture) - implementation(projects.libraries.matrix) + implementation(projects.libraries.matrix.api) implementation(projects.libraries.matrixui) implementation(projects.libraries.designsystem) implementation(projects.libraries.textcomposer) diff --git a/features/roomlist/build.gradle.kts b/features/roomlist/build.gradle.kts index fe8112fb81..409af4c97a 100644 --- a/features/roomlist/build.gradle.kts +++ b/features/roomlist/build.gradle.kts @@ -36,7 +36,7 @@ dependencies { implementation(projects.libraries.core) implementation(projects.libraries.architecture) - implementation(projects.libraries.matrix) + implementation(projects.libraries.matrix.api) implementation(projects.libraries.matrixui) implementation(projects.libraries.designsystem) implementation(projects.libraries.elementresources) @@ -51,7 +51,7 @@ dependencies { testImplementation(libs.test.turbine) testImplementation(projects.libraries.matrixtest) - testImplementation(testFixtures(projects.libraries.matrix)) + //testImplementation(testFixtures(projects.libraries.matrix)) androidTestImplementation(libs.test.junitext) diff --git a/features/template/build.gradle.kts b/features/template/build.gradle.kts index 47cf8f490c..13a97eb770 100644 --- a/features/template/build.gradle.kts +++ b/features/template/build.gradle.kts @@ -37,7 +37,7 @@ dependencies { implementation(projects.libraries.core) implementation(projects.libraries.architecture) - implementation(projects.libraries.matrix) + implementation(projects.libraries.matrix.api) implementation(projects.libraries.matrixui) implementation(projects.libraries.designsystem) implementation(projects.libraries.elementresources) diff --git a/libraries/matrix/build.gradle.kts b/libraries/matrix/api/build.gradle.kts similarity index 95% rename from libraries/matrix/build.gradle.kts rename to libraries/matrix/api/build.gradle.kts index 42876cbbb1..9d5b2584d3 100644 --- a/libraries/matrix/build.gradle.kts +++ b/libraries/matrix/api/build.gradle.kts @@ -23,7 +23,7 @@ plugins { } android { - namespace = "io.element.android.libraries.matrix" + namespace = "io.element.android.libraries.matrix.api" } anvil { diff --git a/libraries/matrix/src/main/AndroidManifest.xml b/libraries/matrix/api/src/main/AndroidManifest.xml similarity index 100% rename from libraries/matrix/src/main/AndroidManifest.xml rename to libraries/matrix/api/src/main/AndroidManifest.xml diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/MatrixClient.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/MatrixClient.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/MatrixClient.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/MatrixClient.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/auth/MatrixAuthenticationService.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/auth/MatrixAuthenticationService.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/auth/MatrixAuthenticationService.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/auth/MatrixAuthenticationService.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/EventId.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/EventId.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/EventId.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/EventId.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/MatrixPatterns.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/MatrixPatterns.kt similarity index 99% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/MatrixPatterns.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/MatrixPatterns.kt index b2043d216b..1463e9a64c 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/MatrixPatterns.kt +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/MatrixPatterns.kt @@ -16,7 +16,7 @@ package io.element.android.libraries.matrix.core -import io.element.android.libraries.matrix.BuildConfig +import io.element.android.libraries.matrix.api.BuildConfig import timber.log.Timber /** diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/RoomId.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/RoomId.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/RoomId.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/RoomId.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/SessionId.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/SessionId.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/SessionId.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/SessionId.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/UserId.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/UserId.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/core/UserId.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/core/UserId.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/media/MediaResolver.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/media/MediaResolver.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/media/MediaResolver.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/media/MediaResolver.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/permalink/MatrixToConverter.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/permalink/MatrixToConverter.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/permalink/MatrixToConverter.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/permalink/MatrixToConverter.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/permalink/PermalinkData.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/permalink/PermalinkData.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/permalink/PermalinkData.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/permalink/PermalinkData.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/permalink/PermalinkParser.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/permalink/PermalinkParser.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/permalink/PermalinkParser.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/permalink/PermalinkParser.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/MatrixRoom.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/MatrixRoom.kt similarity index 99% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/MatrixRoom.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/MatrixRoom.kt index 76a2a91882..90b0bcf10a 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/MatrixRoom.kt +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/MatrixRoom.kt @@ -46,5 +46,4 @@ interface MatrixRoom { suspend fun replyMessage(eventId: EventId, message: String): Result suspend fun redactEvent(eventId: EventId, reason: String? = null): Result - } diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummary.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummary.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummary.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummary.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/LogTag.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummaryDataSource.kt similarity index 68% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/LogTag.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummaryDataSource.kt index 85c1e6010e..8afcdcd352 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/LogTag.kt +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummaryDataSource.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 New Vector Ltd + * Copyright (c) 2023 New Vector Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,11 @@ * limitations under the License. */ -package io.element.android.libraries.matrix +package io.element.android.libraries.matrix.room -internal const val LOG_TAG = "Matrix" +import kotlinx.coroutines.flow.StateFlow + +interface RoomSummaryDataSource { + fun roomSummaries(): StateFlow> + fun setSlidingSyncRange(range: IntRange) +} diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/message/RoomMessage.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/message/RoomMessage.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/message/RoomMessage.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/room/message/RoomMessage.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimeline.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimeline.kt similarity index 100% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimeline.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimeline.kt diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimelineItem.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimelineItem.kt similarity index 75% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimelineItem.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimelineItem.kt index 2d31d400a7..d0344a3b76 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimelineItem.kt +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimelineItem.kt @@ -18,7 +18,6 @@ package io.element.android.libraries.matrix.timeline import io.element.android.libraries.matrix.core.EventId import org.matrix.rustcomponents.sdk.EventTimelineItem -import org.matrix.rustcomponents.sdk.TimelineItem import org.matrix.rustcomponents.sdk.VirtualTimelineItem sealed interface MatrixTimelineItem { @@ -31,14 +30,3 @@ sealed interface MatrixTimelineItem { object Other : MatrixTimelineItem } -fun TimelineItem.asMatrixTimelineItem(): MatrixTimelineItem { - val asEvent = asEvent() - if (asEvent != null) { - return MatrixTimelineItem.Event(asEvent) - } - val asVirtual = asVirtual() - if (asVirtual != null) { - return MatrixTimelineItem.Virtual(asVirtual) - } - return MatrixTimelineItem.Other -} diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/tracing/TracingConfiguration.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/tracing/TracingConfiguration.kt similarity index 93% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/tracing/TracingConfiguration.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/tracing/TracingConfiguration.kt index 747b93f287..3f40420949 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/tracing/TracingConfiguration.kt +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/tracing/TracingConfiguration.kt @@ -74,12 +74,6 @@ sealed class LogLevel(val filter: String) { object Error : LogLevel("error") } -fun setupTracing(tracingConfiguration: TracingConfiguration) { - val filter = tracingConfiguration.filter - Timber.v("Tracing config filter = $filter") - org.matrix.rustcomponents.sdk.setupTracing(filter) -} - object TracingConfigurations { val release = TracingConfiguration(overrides = mapOf(Target.Common to LogLevel.Info)) val debug = TracingConfiguration(overrides = mapOf(Target.Common to LogLevel.Info)) diff --git a/libraries/matrix/impl/build.gradle.kts b/libraries/matrix/impl/build.gradle.kts new file mode 100644 index 0000000000..49f18be870 --- /dev/null +++ b/libraries/matrix/impl/build.gradle.kts @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// TODO: Remove once https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed +@Suppress("DSL_SCOPE_VIOLATION") +plugins { + id("io.element.android-library") + alias(libs.plugins.anvil) + kotlin("plugin.serialization") version "1.8.10" +} + +android { + namespace = "io.element.android.libraries.matrix.impl" +} + +anvil { + generateDaggerFactories.set(true) +} + +dependencies { + // api(projects.libraries.rustsdk) + api(libs.matrix.sdk) + implementation(projects.libraries.di) + implementation(projects.libraries.matrix.api) + implementation(libs.dagger) + implementation(projects.libraries.core) + implementation("net.java.dev.jna:jna:5.13.0@aar") + implementation(libs.androidx.datastore.preferences) + implementation(libs.serialization.json) +} diff --git a/libraries/matrix/impl/src/main/AndroidManifest.xml b/libraries/matrix/impl/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..dc2b81fddc --- /dev/null +++ b/libraries/matrix/impl/src/main/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/RustMatrixClient.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt similarity index 94% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/RustMatrixClient.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt index c36aec7107..cfb93d1d15 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/RustMatrixClient.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt @@ -14,18 +14,19 @@ * limitations under the License. */ -package io.element.android.libraries.matrix +package io.element.android.libraries.matrix.impl import io.element.android.libraries.core.coroutine.CoroutineDispatchers +import io.element.android.libraries.matrix.MatrixClient import io.element.android.libraries.matrix.core.RoomId import io.element.android.libraries.matrix.core.UserId +import io.element.android.libraries.matrix.impl.media.RustMediaResolver +import io.element.android.libraries.matrix.impl.room.RustMatrixRoom +import io.element.android.libraries.matrix.impl.room.RustRoomSummaryDataSource +import io.element.android.libraries.matrix.impl.sync.SlidingSyncObserverProxy import io.element.android.libraries.matrix.media.MediaResolver -import io.element.android.libraries.matrix.media.RustMediaResolver import io.element.android.libraries.matrix.room.MatrixRoom import io.element.android.libraries.matrix.room.RoomSummaryDataSource -import io.element.android.libraries.matrix.room.RustMatrixRoom -import io.element.android.libraries.matrix.room.RustRoomSummaryDataSource -import io.element.android.libraries.matrix.sync.SlidingSyncObserverProxy import io.element.android.libraries.sessionstorage.SessionStore import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.withContext diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/auth/RustMatrixAuthenticationService.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt similarity index 94% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/auth/RustMatrixAuthenticationService.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt index 1354cf8571..73bfc3edb3 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/auth/RustMatrixAuthenticationService.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt @@ -14,18 +14,19 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.auth +package io.element.android.libraries.matrix.impl.auth import com.squareup.anvil.annotations.ContributesBinding import io.element.android.libraries.core.coroutine.CoroutineDispatchers import io.element.android.libraries.di.AppScope import io.element.android.libraries.matrix.MatrixClient -import io.element.android.libraries.matrix.RustMatrixClient +import io.element.android.libraries.matrix.auth.MatrixAuthenticationService import io.element.android.libraries.matrix.core.SessionId import io.element.android.libraries.matrix.core.UserId +import io.element.android.libraries.matrix.impl.RustMatrixClient +import io.element.android.libraries.matrix.impl.util.logError import io.element.android.libraries.matrix.session.SessionData import io.element.android.libraries.sessionstorage.SessionStore -import io.element.android.libraries.matrix.util.logError import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.withContext diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/di/MatrixModule.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/di/MatrixModule.kt similarity index 95% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/di/MatrixModule.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/di/MatrixModule.kt index 5cb654faf7..c6919e78d5 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/di/MatrixModule.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/di/MatrixModule.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.di +package io.element.android.libraries.matrix.impl.di import com.squareup.anvil.annotations.ContributesTo import dagger.Module diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/media/RustMediaResolver.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/media/RustMediaResolver.kt similarity index 79% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/media/RustMediaResolver.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/media/RustMediaResolver.kt index bdc5b85203..1a40f92f81 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/media/RustMediaResolver.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/media/RustMediaResolver.kt @@ -14,9 +14,10 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.media +package io.element.android.libraries.matrix.impl.media import io.element.android.libraries.matrix.MatrixClient +import io.element.android.libraries.matrix.media.MediaResolver import org.matrix.rustcomponents.sdk.mediaSourceFromUrl internal class RustMediaResolver(private val client: MatrixClient) : MediaResolver { @@ -28,13 +29,14 @@ internal class RustMediaResolver(private val client: MatrixClient) : MediaResolv } override suspend fun resolve(meta: MediaResolver.Meta): ByteArray? { - if (meta.source == null) return null - return when (meta.kind) { - is MediaResolver.Kind.Content -> client.loadMediaContentForSource(meta.source) + val source = meta.source ?: return null + val kind = meta.kind + return when (kind) { + is MediaResolver.Kind.Content -> client.loadMediaContentForSource(source) is MediaResolver.Kind.Thumbnail -> client.loadMediaThumbnailForSource( - meta.source, - meta.kind.width.toLong(), - meta.kind.height.toLong() + source, + kind.width.toLong(), + kind.height.toLong() ) }.getOrNull() } diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummaryDetailsFactory.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RoomSummaryDetailsFactory.kt similarity index 90% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummaryDetailsFactory.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RoomSummaryDetailsFactory.kt index d295f9848e..0c944d1e79 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummaryDetailsFactory.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RoomSummaryDetailsFactory.kt @@ -14,10 +14,11 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.room +package io.element.android.libraries.matrix.impl.room +import io.element.android.libraries.matrix.impl.room.message.RoomMessageFactory import io.element.android.libraries.matrix.core.RoomId -import io.element.android.libraries.matrix.room.message.RoomMessageFactory +import io.element.android.libraries.matrix.room.RoomSummaryDetails import org.matrix.rustcomponents.sdk.Room import org.matrix.rustcomponents.sdk.SlidingSyncRoom diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RustMatrixRoom.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt similarity index 96% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RustMatrixRoom.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt index 99c21931c4..21d31d1a98 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RustMatrixRoom.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt @@ -14,13 +14,14 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.room +package io.element.android.libraries.matrix.impl.room import io.element.android.libraries.core.coroutine.CoroutineDispatchers +import io.element.android.libraries.matrix.impl.timeline.RustMatrixTimeline import io.element.android.libraries.matrix.core.EventId import io.element.android.libraries.matrix.core.RoomId +import io.element.android.libraries.matrix.room.MatrixRoom import io.element.android.libraries.matrix.timeline.MatrixTimeline -import io.element.android.libraries.matrix.timeline.RustMatrixTimeline import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.filter @@ -32,7 +33,6 @@ import org.matrix.rustcomponents.sdk.SlidingSyncRoom import org.matrix.rustcomponents.sdk.UpdateSummary import org.matrix.rustcomponents.sdk.genTransactionId import org.matrix.rustcomponents.sdk.messageEventContentFromMarkdown -import timber.log.Timber class RustMatrixRoom( private val slidingSyncUpdateFlow: Flow, diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummaryDataSource.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustRoomSummaryDataSource.kt similarity index 95% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummaryDataSource.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustRoomSummaryDataSource.kt index 7bbc70fdd0..ac47424c85 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/RoomSummaryDataSource.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustRoomSummaryDataSource.kt @@ -14,11 +14,13 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.room +package io.element.android.libraries.matrix.impl.room import io.element.android.libraries.core.coroutine.CoroutineDispatchers -import io.element.android.libraries.matrix.sync.roomListDiff -import io.element.android.libraries.matrix.sync.state +import io.element.android.libraries.matrix.impl.sync.roomListDiff +import io.element.android.libraries.matrix.impl.sync.state +import io.element.android.libraries.matrix.room.RoomSummary +import io.element.android.libraries.matrix.room.RoomSummaryDataSource import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.cancel @@ -39,11 +41,6 @@ import timber.log.Timber import java.io.Closeable import java.util.UUID -interface RoomSummaryDataSource { - fun roomSummaries(): StateFlow> - fun setSlidingSyncRange(range: IntRange) -} - internal class RustRoomSummaryDataSource( private val slidingSyncUpdateFlow: Flow, private val slidingSync: SlidingSync, diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/message/RoomMessageFactory.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/message/RoomMessageFactory.kt similarity index 90% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/message/RoomMessageFactory.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/message/RoomMessageFactory.kt index ebeb1d6eb0..020a16e919 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/room/message/RoomMessageFactory.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/message/RoomMessageFactory.kt @@ -14,10 +14,11 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.room.message +package io.element.android.libraries.matrix.impl.room.message import io.element.android.libraries.matrix.core.EventId import io.element.android.libraries.matrix.core.UserId +import io.element.android.libraries.matrix.room.message.RoomMessage import org.matrix.rustcomponents.sdk.EventTimelineItem class RoomMessageFactory { diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/sync/SlidingSyncObserverProxy.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/sync/SlidingSyncObserverProxy.kt similarity index 96% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/sync/SlidingSyncObserverProxy.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/sync/SlidingSyncObserverProxy.kt index 1922eb985f..6c62171a65 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/sync/SlidingSyncObserverProxy.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/sync/SlidingSyncObserverProxy.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.sync +package io.element.android.libraries.matrix.impl.sync import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.MutableSharedFlow diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/sync/SlidingSyncViewFlows.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/sync/SlidingSyncViewFlows.kt similarity index 94% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/sync/SlidingSyncViewFlows.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/sync/SlidingSyncViewFlows.kt index a3d323b8d0..8665705095 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/sync/SlidingSyncViewFlows.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/sync/SlidingSyncViewFlows.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.sync +package io.element.android.libraries.matrix.impl.sync -import io.element.android.libraries.matrix.util.mxCallbackFlow +import io.element.android.libraries.matrix.impl.util.mxCallbackFlow import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.launch diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimelineDiffProcessor.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/MatrixTimelineDiffProcessor.kt similarity index 95% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimelineDiffProcessor.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/MatrixTimelineDiffProcessor.kt index afea46f2ff..4973fe0341 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/MatrixTimelineDiffProcessor.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/MatrixTimelineDiffProcessor.kt @@ -14,8 +14,10 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.timeline +package io.element.android.libraries.matrix.impl.timeline +import io.element.android.libraries.matrix.timeline.MatrixTimeline +import io.element.android.libraries.matrix.timeline.MatrixTimelineItem import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.MutableStateFlow diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/MatrixTimelineItem.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/MatrixTimelineItem.kt new file mode 100644 index 0000000000..da15f1de98 --- /dev/null +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/MatrixTimelineItem.kt @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.matrix.impl.timeline + +import io.element.android.libraries.matrix.timeline.MatrixTimelineItem +import org.matrix.rustcomponents.sdk.TimelineItem + +fun TimelineItem.asMatrixTimelineItem(): MatrixTimelineItem { + val asEvent = asEvent() + if (asEvent != null) { + return MatrixTimelineItem.Event(asEvent) + } + val asVirtual = asVirtual() + if (asVirtual != null) { + return MatrixTimelineItem.Virtual(asVirtual) + } + return MatrixTimelineItem.Other +} diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/RustMatrixTimeline.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/RustMatrixTimeline.kt similarity index 95% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/RustMatrixTimeline.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/RustMatrixTimeline.kt index 60ccb7420b..8152888b7d 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/timeline/RustMatrixTimeline.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/RustMatrixTimeline.kt @@ -14,12 +14,14 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.timeline +package io.element.android.libraries.matrix.impl.timeline import io.element.android.libraries.core.coroutine.CoroutineDispatchers +import io.element.android.libraries.matrix.impl.util.TaskHandleBag import io.element.android.libraries.matrix.core.EventId import io.element.android.libraries.matrix.room.MatrixRoom -import io.element.android.libraries.matrix.util.TaskHandleBag +import io.element.android.libraries.matrix.timeline.MatrixTimeline +import io.element.android.libraries.matrix.timeline.MatrixTimelineItem import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/tracing/TracingConfiguration.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/tracing/TracingConfiguration.kt new file mode 100644 index 0000000000..e83bb1f67a --- /dev/null +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/tracing/TracingConfiguration.kt @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.matrix.impl.tracing + +import io.element.android.libraries.matrix.tracing.TracingConfiguration +import timber.log.Timber + +fun setupTracing(tracingConfiguration: TracingConfiguration) { + val filter = tracingConfiguration.filter + Timber.v("Tracing config filter = $filter") + org.matrix.rustcomponents.sdk.setupTracing(filter) +} diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/util/CallbackFlow.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/util/CallbackFlow.kt similarity index 95% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/util/CallbackFlow.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/util/CallbackFlow.kt index 9cf36f1db1..a347973e89 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/util/CallbackFlow.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/util/CallbackFlow.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.util +package io.element.android.libraries.matrix.impl.util import kotlinx.coroutines.channels.ProducerScope import kotlinx.coroutines.channels.awaitClose diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/util/Error.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/util/Error.kt similarity index 94% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/util/Error.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/util/Error.kt index d480262f81..4910445bee 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/util/Error.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/util/Error.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.util +package io.element.android.libraries.matrix.impl.util import org.matrix.rustcomponents.sdk.ClientException import timber.log.Timber diff --git a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/util/TaskHandleBag.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/util/TaskHandleBag.kt similarity index 95% rename from libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/util/TaskHandleBag.kt rename to libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/util/TaskHandleBag.kt index f4f75d0e8e..ad2c6ccddd 100644 --- a/libraries/matrix/src/main/kotlin/io/element/android/libraries/matrix/util/TaskHandleBag.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/util/TaskHandleBag.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.libraries.matrix.util +package io.element.android.libraries.matrix.impl.util import org.matrix.rustcomponents.sdk.TaskHandle import java.util.concurrent.CopyOnWriteArraySet diff --git a/libraries/matrix/test/build.gradle.kts b/libraries/matrix/test/build.gradle.kts new file mode 100644 index 0000000000..4a39cb1340 --- /dev/null +++ b/libraries/matrix/test/build.gradle.kts @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// TODO: Remove once https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed +@Suppress("DSL_SCOPE_VIOLATION") +plugins { + id("io.element.android-library") + alias(libs.plugins.anvil) + kotlin("plugin.serialization") version "1.8.10" +} + +android { + namespace = "io.element.android.libraries.matrix.test" +} + +anvil { + generateDaggerFactories.set(true) +} + +dependencies { + implementation(projects.libraries.di) + implementation(projects.libraries.matrix.api) +} diff --git a/libraries/matrix/test/src/main/AndroidManifest.xml b/libraries/matrix/test/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..dc2b81fddc --- /dev/null +++ b/libraries/matrix/test/src/main/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/libraries/matrixtest/build.gradle.kts b/libraries/matrixtest/build.gradle.kts index 39641e7eed..7eedee1b28 100644 --- a/libraries/matrixtest/build.gradle.kts +++ b/libraries/matrixtest/build.gradle.kts @@ -25,6 +25,6 @@ android { } dependencies { - api(projects.libraries.matrix) + api(projects.libraries.matrix.api) api(libs.coroutines.core) } diff --git a/libraries/matrixui/build.gradle.kts b/libraries/matrixui/build.gradle.kts index 39b2b677d8..c9dead5eb4 100644 --- a/libraries/matrixui/build.gradle.kts +++ b/libraries/matrixui/build.gradle.kts @@ -35,7 +35,7 @@ dependencies { anvil(projects.anvilcodegen) implementation(projects.libraries.di) implementation(projects.libraries.architecture) - implementation(projects.libraries.matrix) + implementation(projects.libraries.matrix.api) implementation(projects.libraries.designsystem) implementation(projects.libraries.core) implementation(libs.coil.compose) diff --git a/libraries/textcomposer/build.gradle.kts b/libraries/textcomposer/build.gradle.kts index 6f15fefa42..dca13603be 100644 --- a/libraries/textcomposer/build.gradle.kts +++ b/libraries/textcomposer/build.gradle.kts @@ -34,7 +34,7 @@ dependencies { implementation(projects.libraries.uiStrings) implementation(projects.libraries.androidutils) implementation(projects.libraries.core) - implementation(projects.libraries.matrix) + implementation(projects.libraries.matrix.api) implementation(projects.libraries.designsystem) implementation(libs.wysiwyg) implementation(libs.androidx.constraintlayout) diff --git a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt index f751a73f27..8d8f574cb1 100644 --- a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt +++ b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt @@ -51,7 +51,7 @@ fun DependencyHandlerScope.composeDependencies(libs: LibrariesForLibs) { fun DependencyHandlerScope.allLibraries() { implementation(project(":libraries:designsystem")) - implementation(project(":libraries:matrix")) + implementation(project(":libraries:matrix:api")) implementation(project(":libraries:matrixui")) implementation(project(":libraries:core")) implementation(project(":libraries:architecture")) diff --git a/samples/minimal/build.gradle.kts b/samples/minimal/build.gradle.kts index 05d8ed17a2..13686e7e61 100644 --- a/samples/minimal/build.gradle.kts +++ b/samples/minimal/build.gradle.kts @@ -47,7 +47,8 @@ android { dependencies { implementation(libs.androidx.activity.compose) - implementation(projects.libraries.matrix) + implementation(projects.libraries.matrix.api) + implementation(projects.libraries.matrix.impl) implementation(projects.libraries.designsystem) implementation(projects.libraries.architecture) implementation(projects.libraries.core) diff --git a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/MainActivity.kt b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/MainActivity.kt index bc7131de01..f5e470a44b 100644 --- a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/MainActivity.kt +++ b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/MainActivity.kt @@ -29,8 +29,8 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.core.view.WindowCompat import io.element.android.libraries.designsystem.theme.ElementTheme +import io.element.android.libraries.matrix.impl.auth.RustMatrixAuthenticationService import io.element.android.libraries.matrix.auth.MatrixAuthenticationService -import io.element.android.libraries.matrix.auth.RustMatrixAuthenticationService import kotlinx.coroutines.runBlocking import org.matrix.rustcomponents.sdk.AuthenticationService import java.io.File diff --git a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/Singleton.kt b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/Singleton.kt index fb74d2bacb..2cb4045a61 100644 --- a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/Singleton.kt +++ b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/Singleton.kt @@ -17,8 +17,8 @@ package io.element.android.samples.minimal import io.element.android.libraries.core.coroutine.CoroutineDispatchers +import io.element.android.libraries.matrix.impl.tracing.setupTracing import io.element.android.libraries.matrix.tracing.TracingConfigurations -import io.element.android.libraries.matrix.tracing.setupTracing import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.MainScope diff --git a/settings.gradle.kts b/settings.gradle.kts index e1be2fdb39..5031d83c89 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -39,7 +39,9 @@ rootProject.name = "ElementX" include(":app") include(":libraries:core") include(":libraries:rustsdk") -include(":libraries:matrix") +include(":libraries:matrix:api") +include(":libraries:matrix:impl") +include(":libraries:matrix:test") include(":libraries:matrixui") include(":libraries:textcomposer") include(":libraries:dateformatter")