From 4a0d2cd42d170c4dac073fe596fa5baa6736c9b9 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Sat, 11 Jun 2022 13:29:47 +0100 Subject: [PATCH] prepping for kotlin 1.7.0 release, removing compose from modules that don't need it --- build.gradle | 23 +++++++++++-------- core/build.gradle | 2 +- dependencies.gradle | 2 +- design-library/build.gradle | 2 +- domains/android/core/build.gradle | 2 +- features/directory/build.gradle | 2 +- features/home/build.gradle | 2 +- features/login/build.gradle | 2 +- features/messenger/build.gradle | 2 +- features/profile/build.gradle | 2 +- features/settings/build.gradle | 2 +- features/verification/build.gradle | 2 +- .../crypto/internal/VerificationHandler.kt | 3 +++ test-harness/src/test/kotlin/SmokeTest.kt | 3 +++ 14 files changed, 31 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index 7826dc6..34aec41 100644 --- a/build.gradle +++ b/build.gradle @@ -24,8 +24,8 @@ subprojects { kotlinOptions { jvmTarget = "1.8" freeCompilerArgs = [ - '-Xopt-in=kotlin.contracts.ExperimentalContracts', - '-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi', + '-opt-in=kotlin.contracts.ExperimentalContracts', + '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi', ] } } @@ -52,7 +52,7 @@ ext.applyLibraryPlugins = { project -> project.apply plugin: 'kotlin-android' } -ext.androidSdkVersion = 31 +ext.androidSdkVersion = 32 ext.applyCommonAndroidParameters = { project -> def android = project.android @@ -66,11 +66,6 @@ ext.applyCommonAndroidParameters = { project -> minSdkVersion 24 targetSdkVersion androidSdkVersion } - - android.buildFeatures.compose = true - android.composeOptions { - kotlinCompilerExtensionVersion = Dependencies.google.kotlinCompilerExtensionVersion - } } ext.applyLibraryModuleOptimisations = { project -> @@ -101,13 +96,23 @@ ext.applyCompose = { project -> dependencies.implementation Dependencies.google.androidxComposeMaterial dependencies.implementation Dependencies.google.androidxComposeIconsExtended dependencies.implementation Dependencies.google.androidxActivityCompose + + def android = project.android + android.buildFeatures.compose = true + android.composeOptions { + kotlinCompilerExtensionVersion = Dependencies.google.kotlinCompilerExtensionVersion + } +} + +ext.applyAndroidComposeLibraryModule = { project -> + applyAndroidLibraryModule(project) + applyCompose(project) } ext.applyAndroidLibraryModule = { project -> applyLibraryPlugins(project) applyCommonAndroidParameters(project) applyLibraryModuleOptimisations(project) - applyCompose(project) } ext.applyCrashlyticsIfRelease = { project -> diff --git a/core/build.gradle b/core/build.gradle index 23fca28..b573f32 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -4,7 +4,7 @@ plugins { } dependencies { - implementation Dependencies.mavenCentral.kotlinCoroutinesCore + api Dependencies.mavenCentral.kotlinCoroutinesCore testFixturesImplementation Dependencies.mavenCentral.kotlinCoroutinesCore testFixturesImplementation Dependencies.mavenCentral.kluent testFixturesImplementation Dependencies.mavenCentral.mockk diff --git a/dependencies.gradle b/dependencies.gradle index 981a591..ed24235 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -90,7 +90,7 @@ ext.Dependencies.with { def kotlinVer = "1.6.10" def sqldelightVer = "1.5.3" - def composeVer = "1.1.0" + def composeVer = "1.1.1" def ktorVer = "2.0.2" google = new DependenciesContainer() diff --git a/design-library/build.gradle b/design-library/build.gradle index aa3a0d4..578435a 100644 --- a/design-library/build.gradle +++ b/design-library/build.gradle @@ -1,4 +1,4 @@ -applyAndroidLibraryModule(project) +applyAndroidComposeLibraryModule(project) dependencies { implementation project(":core") diff --git a/domains/android/core/build.gradle b/domains/android/core/build.gradle index 896c7c4..13b56b1 100644 --- a/domains/android/core/build.gradle +++ b/domains/android/core/build.gradle @@ -1,4 +1,4 @@ -applyAndroidLibraryModule(project) +applyAndroidComposeLibraryModule(project) dependencies { implementation project(":core") diff --git a/features/directory/build.gradle b/features/directory/build.gradle index f51aaab..d84aa60 100644 --- a/features/directory/build.gradle +++ b/features/directory/build.gradle @@ -1,4 +1,4 @@ -applyAndroidLibraryModule(project) +applyAndroidComposeLibraryModule(project) dependencies { implementation project(":matrix:services:sync") diff --git a/features/home/build.gradle b/features/home/build.gradle index 0c30581..5b8b568 100644 --- a/features/home/build.gradle +++ b/features/home/build.gradle @@ -1,4 +1,4 @@ -applyAndroidLibraryModule(project) +applyAndroidComposeLibraryModule(project) dependencies { implementation project(":matrix:services:profile") diff --git a/features/login/build.gradle b/features/login/build.gradle index 0913f47..fb18845 100644 --- a/features/login/build.gradle +++ b/features/login/build.gradle @@ -1,4 +1,4 @@ -applyAndroidLibraryModule(project) +applyAndroidComposeLibraryModule(project) dependencies { implementation project(":domains:android:core") diff --git a/features/messenger/build.gradle b/features/messenger/build.gradle index 21b929f..111189f 100644 --- a/features/messenger/build.gradle +++ b/features/messenger/build.gradle @@ -1,4 +1,4 @@ -applyAndroidLibraryModule(project) +applyAndroidComposeLibraryModule(project) apply plugin: 'kotlin-parcelize' dependencies { diff --git a/features/profile/build.gradle b/features/profile/build.gradle index 1e02634..3bae99b 100644 --- a/features/profile/build.gradle +++ b/features/profile/build.gradle @@ -1,4 +1,4 @@ -applyAndroidLibraryModule(project) +applyAndroidComposeLibraryModule(project) dependencies { implementation project(":matrix:services:sync") diff --git a/features/settings/build.gradle b/features/settings/build.gradle index 4a91dc2..1eb2599 100644 --- a/features/settings/build.gradle +++ b/features/settings/build.gradle @@ -1,4 +1,4 @@ -applyAndroidLibraryModule(project) +applyAndroidComposeLibraryModule(project) dependencies { implementation project(":matrix:services:sync") diff --git a/features/verification/build.gradle b/features/verification/build.gradle index 8a489fc..1239004 100644 --- a/features/verification/build.gradle +++ b/features/verification/build.gradle @@ -1,4 +1,4 @@ -applyAndroidLibraryModule(project) +applyAndroidComposeLibraryModule(project) dependencies { implementation project(":matrix:services:crypto") diff --git a/matrix/services/crypto/src/main/kotlin/app/dapk/st/matrix/crypto/internal/VerificationHandler.kt b/matrix/services/crypto/src/main/kotlin/app/dapk/st/matrix/crypto/internal/VerificationHandler.kt index 035709f..47d6594 100644 --- a/matrix/services/crypto/src/main/kotlin/app/dapk/st/matrix/crypto/internal/VerificationHandler.kt +++ b/matrix/services/crypto/src/main/kotlin/app/dapk/st/matrix/crypto/internal/VerificationHandler.kt @@ -182,6 +182,9 @@ internal class VerificationHandler( sendToDevice(ToDevicePayload.VerificationDone(verificationTransaction.transactionId)) stateFlow.emit(Verification.State.Done) } + is Verification.Event.Done -> { + // TODO + } } } diff --git a/test-harness/src/test/kotlin/SmokeTest.kt b/test-harness/src/test/kotlin/SmokeTest.kt index b4831e3..5ed1bae 100644 --- a/test-harness/src/test/kotlin/SmokeTest.kt +++ b/test-harness/src/test/kotlin/SmokeTest.kt @@ -172,5 +172,8 @@ fun testAfterInitialSync(block: suspend MatrixTestScope.(TestMatrix, TestMatrix) private fun Flow.automaticVerification(testMatrix: TestMatrix) = this.onEach { when (it) { is Verification.State.WaitingForMatchConfirmation -> testMatrix.client.cryptoService().verificationAction(Verification.Action.AcknowledgeMatch) + else -> { + // do nothing + } } } \ No newline at end of file