Merge branch 'main' into message-tests

This commit is contained in:
Adam Brown 2022-06-11 21:44:10 +01:00
commit 34423b2d50
27 changed files with 70 additions and 37 deletions

View File

@ -13,7 +13,17 @@ android {
def versionJson = new groovy.json.JsonSlurper().parseText(rootProject.file('version.json').text) def versionJson = new groovy.json.JsonSlurper().parseText(rootProject.file('version.json').text)
versionCode versionJson.code versionCode versionJson.code
versionName versionJson.name versionName versionJson.name
resConfigs "en"
if (isDebugBuild) {
resConfigs "en", "xxhdpi"
variantFilter { variant ->
if (variant.buildType.name == "release") {
setIgnore(true)
}
}
} else {
resConfigs "en"
}
} }
bundle { bundle {
@ -24,7 +34,7 @@ android {
buildTypes { buildTypes {
debug { debug {
versionNameSuffix =" [debug]" versionNameSuffix = " [debug]"
matchingFallbacks = ['release'] matchingFallbacks = ['release']
signingConfig.storeFile rootProject.file("tools/debug.keystore") signingConfig.storeFile rootProject.file("tools/debug.keystore")
} }

View File

@ -18,14 +18,16 @@ def launchTask = getGradle()
.getTaskRequests() .getTaskRequests()
.toString() .toString()
.toLowerCase() .toLowerCase()
def isReleaseBuild = launchTask.contains("release")
ext.isDebugBuild = !isReleaseBuild
subprojects { subprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "1.8"
freeCompilerArgs = [ freeCompilerArgs = [
'-Xopt-in=kotlin.contracts.ExperimentalContracts', '-opt-in=kotlin.contracts.ExperimentalContracts',
'-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi', '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
] ]
} }
} }
@ -52,7 +54,7 @@ ext.applyLibraryPlugins = { project ->
project.apply plugin: 'kotlin-android' project.apply plugin: 'kotlin-android'
} }
ext.androidSdkVersion = 31 ext.androidSdkVersion = 32
ext.applyCommonAndroidParameters = { project -> ext.applyCommonAndroidParameters = { project ->
def android = project.android def android = project.android
@ -66,11 +68,6 @@ ext.applyCommonAndroidParameters = { project ->
minSdkVersion 24 minSdkVersion 24
targetSdkVersion androidSdkVersion targetSdkVersion androidSdkVersion
} }
android.buildFeatures.compose = true
android.composeOptions {
kotlinCompilerExtensionVersion = Dependencies.google.kotlinCompilerExtensionVersion
}
} }
ext.applyLibraryModuleOptimisations = { project -> ext.applyLibraryModuleOptimisations = { project ->
@ -101,17 +98,26 @@ ext.applyCompose = { project ->
dependencies.implementation Dependencies.google.androidxComposeMaterial dependencies.implementation Dependencies.google.androidxComposeMaterial
dependencies.implementation Dependencies.google.androidxComposeIconsExtended dependencies.implementation Dependencies.google.androidxComposeIconsExtended
dependencies.implementation Dependencies.google.androidxActivityCompose 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 -> ext.applyAndroidLibraryModule = { project ->
applyLibraryPlugins(project) applyLibraryPlugins(project)
applyCommonAndroidParameters(project) applyCommonAndroidParameters(project)
applyLibraryModuleOptimisations(project) applyLibraryModuleOptimisations(project)
applyCompose(project)
} }
ext.applyCrashlyticsIfRelease = { project -> ext.applyCrashlyticsIfRelease = { project ->
def isReleaseBuild = launchTask.contains("release")
if (isReleaseBuild) { if (isReleaseBuild) {
project.apply plugin: 'com.google.firebase.crashlytics' project.apply plugin: 'com.google.firebase.crashlytics'
project.afterEvaluate { project.afterEvaluate {

View File

@ -4,7 +4,7 @@ plugins {
} }
dependencies { dependencies {
implementation Dependencies.mavenCentral.kotlinCoroutinesCore api Dependencies.mavenCentral.kotlinCoroutinesCore
testFixturesImplementation Dependencies.mavenCentral.kotlinCoroutinesCore testFixturesImplementation Dependencies.mavenCentral.kotlinCoroutinesCore
testFixturesImplementation Dependencies.mavenCentral.kluent testFixturesImplementation Dependencies.mavenCentral.kluent
testFixturesImplementation Dependencies.mavenCentral.mockk testFixturesImplementation Dependencies.mavenCentral.mockk

View File

@ -90,19 +90,19 @@ ext.Dependencies.with {
def kotlinVer = "1.6.10" def kotlinVer = "1.6.10"
def sqldelightVer = "1.5.3" def sqldelightVer = "1.5.3"
def composeVer = "1.1.0" def composeVer = "1.1.1"
def ktorVer = "2.0.2" def ktorVer = "2.0.2"
google = new DependenciesContainer() google = new DependenciesContainer()
google.with { google.with {
androidGradlePlugin = "com.android.tools.build:gradle:7.1.2" androidGradlePlugin = "com.android.tools.build:gradle:7.2.1"
androidxComposeUi = "androidx.compose.ui:ui:${composeVer}" androidxComposeUi = "androidx.compose.ui:ui:${composeVer}"
androidxComposeFoundation = "androidx.compose.foundation:foundation:${composeVer}" androidxComposeFoundation = "androidx.compose.foundation:foundation:${composeVer}"
androidxComposeMaterial = "androidx.compose.material:material:${composeVer}" androidxComposeMaterial = "androidx.compose.material:material:${composeVer}"
androidxComposeIconsExtended = "androidx.compose.material:material-icons-extended:${composeVer}" androidxComposeIconsExtended = "androidx.compose.material:material-icons-extended:${composeVer}"
androidxActivityCompose = "androidx.activity:activity-compose:1.4.0" androidxActivityCompose = "androidx.activity:activity-compose:1.4.0"
kotlinCompilerExtensionVersion = "1.1.0-rc02" kotlinCompilerExtensionVersion = "${composeVer}"
} }
mavenCentral = new DependenciesContainer() mavenCentral = new DependenciesContainer()

View File

@ -1,4 +1,4 @@
applyAndroidLibraryModule(project) applyAndroidComposeLibraryModule(project)
dependencies { dependencies {
implementation project(":core") implementation project(":core")

View File

@ -0,0 +1,7 @@
applyAndroidComposeLibraryModule(project)
dependencies {
implementation project(":core")
implementation project(":features:navigator")
api project(":domains:android:core")
}

View File

@ -1,6 +1,7 @@
applyAndroidLibraryModule(project) plugins { id 'kotlin' }
dependencies { dependencies {
compileOnly project(":domains:android:stub")
implementation project(":core") implementation project(":core")
implementation project(":features:navigator") implementation project(":features:navigator")
} }

View File

@ -13,6 +13,8 @@ if (localProperties.exists()) {
dependencies { dependencies {
def androidVer = androidSdkVersion def androidVer = androidSdkVersion
api files("${properties.getProperty("sdk.dir")}/platforms/android-${androidVer}/android.jar")
kotlinFixtures(it) kotlinFixtures(it)
testFixturesImplementation testFixtures(project(":core")) testFixturesImplementation testFixtures(project(":core"))
testFixturesImplementation files("${properties.getProperty("sdk.dir")}/platforms/android-${androidVer}/android.jar") testFixturesImplementation files("${properties.getProperty("sdk.dir")}/platforms/android-${androidVer}/android.jar")

View File

@ -1,6 +1,7 @@
applyAndroidLibraryModule(project) plugins { id 'kotlin' }
dependencies { dependencies {
compileOnly project(":domains:android:stub")
implementation project(':core') implementation project(':core')
implementation project(':domains:android:core') implementation project(':domains:android:core')
} }

View File

@ -1,10 +1,10 @@
applyAndroidLibraryModule(project) applyAndroidComposeLibraryModule(project)
dependencies { dependencies {
implementation project(":matrix:services:sync") implementation project(":matrix:services:sync")
implementation project(":matrix:services:message") implementation project(":matrix:services:message")
implementation project(":matrix:services:room") implementation project(":matrix:services:room")
implementation project(":domains:android:core") implementation project(":domains:android:compose-core")
implementation project(":domains:android:viewmodel") implementation project(":domains:android:viewmodel")
implementation project(":features:messenger") implementation project(":features:messenger")
implementation project(":core") implementation project(":core")

View File

@ -1,4 +1,4 @@
applyAndroidLibraryModule(project) applyAndroidComposeLibraryModule(project)
dependencies { dependencies {
implementation project(":matrix:services:profile") implementation project(":matrix:services:profile")
@ -7,7 +7,7 @@ dependencies {
implementation project(":features:login") implementation project(":features:login")
implementation project(":features:settings") implementation project(":features:settings")
implementation project(":features:profile") implementation project(":features:profile")
implementation project(":domains:android:core") implementation project(":domains:android:compose-core")
implementation project(":domains:android:viewmodel") implementation project(":domains:android:viewmodel")
implementation project(':domains:store') implementation project(':domains:store')
implementation project(":core") implementation project(":core")

View File

@ -1,7 +1,7 @@
applyAndroidLibraryModule(project) applyAndroidComposeLibraryModule(project)
dependencies { dependencies {
implementation project(":domains:android:core") implementation project(":domains:android:compose-core")
implementation project(":domains:android:push") implementation project(":domains:android:push")
implementation project(":domains:android:viewmodel") implementation project(":domains:android:viewmodel")
implementation project(":matrix:services:auth") implementation project(":matrix:services:auth")

View File

@ -1,11 +1,11 @@
applyAndroidLibraryModule(project) applyAndroidComposeLibraryModule(project)
apply plugin: 'kotlin-parcelize' apply plugin: 'kotlin-parcelize'
dependencies { dependencies {
implementation project(":matrix:services:sync") implementation project(":matrix:services:sync")
implementation project(":matrix:services:message") implementation project(":matrix:services:message")
implementation project(":matrix:services:room") implementation project(":matrix:services:room")
implementation project(":domains:android:core") implementation project(":domains:android:compose-core")
implementation project(":domains:android:viewmodel") implementation project(":domains:android:viewmodel")
implementation project(":core") implementation project(":core")
implementation project(":features:navigator") implementation project(":features:navigator")

View File

@ -1,6 +1,7 @@
applyAndroidLibraryModule(project) plugins { id 'kotlin' }
dependencies { dependencies {
compileOnly project(":domains:android:stub")
implementation project(":core") implementation project(":core")
implementation project(":matrix:common") implementation project(":matrix:common")
} }

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app.dapk.st.navigator"/>

View File

@ -1,4 +1,4 @@
applyAndroidLibraryModule(project) applyAndroidComposeLibraryModule(project)
dependencies { dependencies {
implementation project(":matrix:services:sync") implementation project(":matrix:services:sync")
@ -6,7 +6,7 @@ dependencies {
implementation project(":matrix:services:profile") implementation project(":matrix:services:profile")
implementation project(":features:settings") implementation project(":features:settings")
implementation project(':domains:store') implementation project(':domains:store')
implementation project(":domains:android:core") implementation project(":domains:android:compose-core")
implementation project(":domains:android:viewmodel") implementation project(":domains:android:viewmodel")
implementation project(":design-library") implementation project(":design-library")
implementation project(":core") implementation project(":core")

View File

@ -1,11 +1,11 @@
applyAndroidLibraryModule(project) applyAndroidComposeLibraryModule(project)
dependencies { dependencies {
implementation project(":matrix:services:sync") implementation project(":matrix:services:sync")
implementation project(":matrix:services:crypto") implementation project(":matrix:services:crypto")
implementation project(":features:navigator") implementation project(":features:navigator")
implementation project(':domains:store') implementation project(':domains:store')
implementation project(":domains:android:core") implementation project(":domains:android:compose-core")
implementation project(":domains:android:viewmodel") implementation project(":domains:android:viewmodel")
implementation project(":design-library") implementation project(":design-library")
implementation project(":core") implementation project(":core")

View File

@ -1,8 +1,8 @@
applyAndroidLibraryModule(project) applyAndroidComposeLibraryModule(project)
dependencies { dependencies {
implementation project(":matrix:services:crypto") implementation project(":matrix:services:crypto")
implementation project(":domains:android:core") implementation project(":domains:android:compose-core")
implementation project(":domains:android:viewmodel") implementation project(":domains:android:viewmodel")
implementation project(":design-library") implementation project(":design-library")
implementation project(":core") implementation project(":core")

View File

@ -182,6 +182,9 @@ internal class VerificationHandler(
sendToDevice(ToDevicePayload.VerificationDone(verificationTransaction.transactionId)) sendToDevice(ToDevicePayload.VerificationDone(verificationTransaction.transactionId))
stateFlow.emit(Verification.State.Done) stateFlow.emit(Verification.State.Done)
} }
is Verification.Event.Done -> {
// TODO
}
} }
} }

View File

@ -22,6 +22,7 @@ include ':features:verification'
include ':domains:android:stub' include ':domains:android:stub'
include ':domains:android:core' include ':domains:android:core'
include ':domains:android:compose-core'
include ':domains:android:imageloader' include ':domains:android:imageloader'
include ':domains:android:work' include ':domains:android:work'
include ':domains:android:tracking' include ':domains:android:tracking'

View File

@ -178,5 +178,8 @@ fun testAfterInitialSync(block: suspend MatrixTestScope.(TestMatrix, TestMatrix)
private fun Flow<Verification.State>.automaticVerification(testMatrix: TestMatrix) = this.onEach { private fun Flow<Verification.State>.automaticVerification(testMatrix: TestMatrix) = this.onEach {
when (it) { when (it) {
is Verification.State.WaitingForMatchConfirmation -> testMatrix.client.cryptoService().verificationAction(Verification.Action.AcknowledgeMatch) is Verification.State.WaitingForMatchConfirmation -> testMatrix.client.cryptoService().verificationAction(Verification.Action.AcknowledgeMatch)
else -> {
// do nothing
}
} }
} }

View File

@ -28,7 +28,7 @@ def excludes = [
def initializeReport(report, projects, classExcludes) { def initializeReport(report, projects, classExcludes) {
projects.each { project -> project.apply plugin: 'jacoco' } projects.each { project -> project.apply plugin: 'jacoco' }
report.executionData { fileTree(rootProject.rootDir.absolutePath).include("**/build/jacoco/*.exec") } report.executionData { fileTree(rootProject.rootDir.absolutePath).include("**/build/**/*.exec") }
report.reports { report.reports {
xml.enabled true xml.enabled true