pachli-android/settings.gradle.kts
Nik Clayton 362cdfeb27
fix: Prevent crash when Pachli is a share target (#659)
Crash was occuring because the instance info hadn't been fetched, trying
to take the last item of an empty list.

To fix:

- Expose the instance info as a state flow, with a default. New instance
info is fetched whenever the active account changes.

- Do the same for the emojis supported by the server.

- Update call sites as appropriate.

- Mark `InstanceInfoRepository` as `@Singleton` so it isn't repeatedly
created causing fresh content fetches.

The tests needed updating to get this to work.

- Extract the network fake modules in to a network-test module so
multiple other modules can use them.

- Rewrite `InstanceInfoRepositoryTest` to use Hilt and use Turbine to
test the new flows.

Checking this showed cosmetic bugs in the About layout when instance
info is missing, clean those up.
2024-04-28 18:19:13 +02:00

74 lines
1.8 KiB
Plaintext

pluginManagement {
repositories {
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
gradlePluginPortal()
}
includeBuild("build-logic")
includeBuild("plugins/markdown2resource")
}
dependencyResolutionManagement {
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
repositories {
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
maven("https://jitpack.io")
}
}
plugins {
id("com.gradle.develocity") version "3.17.2"
}
develocity {
buildScan {
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
termsOfUseAgree = "yes"
val isCiBuild = providers.environmentVariable("CI").isPresent
uploadInBackground = !isCiBuild
tag(if (isCiBuild) "CI" else "Local")
publishing.onlyIf { isCiBuild }
}
}
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "pachli-android"
include(":app")
include(":core:accounts")
include(":core:activity")
include(":core:common")
include(":core:data")
include(":core:database")
include(":core:designsystem")
include(":core:model")
include(":core:preferences")
include(":core:navigation")
include(":core:network")
include(":core:network-test")
include(":core:testing")
include(":core:ui")
include(":feature:about")
include(":feature:lists")
include(":feature:login")
include(":tools")
include(":tools:mklanguages")
include(":tools:mkserverversions")
include(":tools:mvstring")
include(":checks")