Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading libs #32

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,36 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

buildscript {
repositories {
google()
maven(url = "https://plugins.gradle.org/m2/")
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.8.22")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.45")
classpath(Deps.spotless)
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22")
classpath(Deps.kotlin_coveralls_plugin)
classpath(Deps.dokka_plugin)
classpath("com.android.tools.build:gradle:8.2.2")
classpath("com.google.gms:google-services:4.3.14")
classpath("com.google.firebase:perf-plugin:1.4.2")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.5")
classpath(Deps.dokka_plugin)
}
}

plugins {
id("org.jetbrains.kotlin.jvm") version "1.9.22"
id("com.github.kt3k.coveralls") version "2.12.2"
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10"
id("com.google.dagger.hilt.android") version Deps.versions.hiltVersion apply false
id("androidx.navigation.safeargs.kotlin") version "2.5.3" apply false
id("org.jetbrains.dokka") version "1.8.20"
id("com.diffplug.spotless") version "6.25.0" apply false
id("de.mannodermaus.android-junit5") version "1.9.3.0" apply false
id("com.google.gms.google-services") version "4.3.14" apply false
id("com.google.firebase.firebase-perf") version "1.4.2" apply false
id("com.google.firebase.crashlytics") version "2.9.5"
}

allprojects {
repositories {
mavenLocal()
gradlePluginPortal()
mavenLocal()
google()
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
maven(url = "https://jcenter.bintray.com/")
maven {
name = "fhirsdk"
url = uri("/Users/ndegwamartin/.m2.dev/fhirsdk")
Expand Down
2 changes: 1 addition & 1 deletion android/buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ object Dependencies {
HapiFhir.validationDstu3Module to { version { strictly(Versions.hapiFhir) } },
HapiFhir.validationR4Module to { version { strictly(Versions.hapiFhir) } },
HapiFhir.validationR5Module to { version { strictly(Versions.hapiFhir) } },
Jackson.annotationsBase to { version { strictly(Versions.jackson) } },
Jackson.annotationsBase to { version { strictly(Versions.jackson) } },
Jackson.bomBase to { version { strictly(Versions.jackson) } },
Jackson.coreBase to { version { strictly(Versions.jacksonCore) } },
Jackson.databindBase to { version { strictly(Versions.jackson) } },
Expand Down
12 changes: 6 additions & 6 deletions android/buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

object Deps {
object sdk_versions {
const val compile_sdk = 33
const val compile_sdk = 34
const val min_sdk = 26
const val target_sdk = 33
const val target_sdk = 34
}

const val build_tool_version = "30.0.3"
Expand Down Expand Up @@ -42,20 +42,20 @@ object Deps {
const val room = "2.4.2"
const val spotless = "6.25.0"
const val truth = "1.0.1"
const val work = "2.7.1"
const val work = "2.9.0"
const val json_tools = "1.13"
const val kotlin_coveralls = "2.12.2"
const val jacoco_tool = "0.8.11"
const val ktlint = "0.41.0"
const val joda_time = "2.10.5"
const val timber = "4.7.1"
const val mockk = "1.13.5"
const val dokka = "1.5.0"
const val dokka = "1.8.20"
const val androidx_test = "2.2.0"
const val accompanist_swiperefresh = "0.26.4-beta"
const val compose = "1.4.3"
const val hiltVersion = "2.45"
const val hiltWorkerVersion ="1.0.0"
const val hiltVersion = "2.51"
const val hiltWorkerVersion ="1.2.0"
}

const val activity = "androidx.activity:activity:${versions.activity}"
Expand Down
31 changes: 16 additions & 15 deletions android/dataclerk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("de.mannodermaus.android-junit5") version "1.9.3.0"
id("de.mannodermaus.android-junit5")
id("org.jetbrains.dokka")
id("org.jetbrains.kotlin.plugin.serialization")
id("dagger.hilt.android.plugin")
id("com.google.dagger.hilt.android")
id("org.jetbrains.kotlin.android")
id("com.google.firebase.firebase-perf")
id("com.google.gms.google-services")
Expand Down Expand Up @@ -83,7 +83,7 @@ android {
buildConfig = true
}

composeOptions { kotlinCompilerExtensionVersion = "1.4.8" }
composeOptions { kotlinCompilerExtensionVersion = "1.5.9" }

testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
Expand Down Expand Up @@ -128,39 +128,37 @@ android {
}
}

configurations.configureEach {
resolutionStrategy { force("ca.uhn.hapi.fhir:org.hl7.fhir.utilities:5.5.7") }
}

lint { abortOnError = false }

testCoverage { jacocoVersion = Deps.versions.jacoco_tool }
}

configurations { all { exclude(group = "xpp3") } }

dependencies {
coreLibraryDesugaring(Deps.desugar)
implementation(project(":engine"))

implementation("androidx.core:core-ktx:1.8.0")
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1")
implementation("androidx.activity:activity-compose:1.5.1")
implementation("androidx.core:core-ktx:1.12.0")
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.9.20"))
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")

implementation(Deps.accompanist.swiperefresh)

implementation(platform("androidx.compose:compose-bom:2022.10.00"))
implementation(platform("androidx.compose:compose-bom:2024.02.01"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation("androidx.paging:paging-compose:3.2.0")
implementation("androidx.paging:paging-compose:3.2.1")

// Hilt - Dependency Injection
implementation("com.google.dagger:hilt-android:${Deps.versions.hiltVersion}")
kapt("com.google.dagger:hilt-compiler:${Deps.versions.hiltVersion}")

// analytics
implementation(platform("com.google.firebase:firebase-bom:31.2.0"))
implementation(platform("com.google.firebase:firebase-bom:32.7.3"))

implementation("com.google.firebase:firebase-perf-ktx")
implementation("com.google.firebase:firebase-crashlytics-ktx")
Expand All @@ -169,8 +167,11 @@ dependencies {
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2022.10.00"))
androidTestImplementation(platform("androidx.compose:compose-bom:2024.02.01"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
testImplementation("com.google.dagger:hilt-android-testing:${Deps.versions.hiltVersion}")
kaptTest("com.google.dagger:hilt-compiler:${Deps.versions.hiltVersion}")

debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class DataClerkApplication : Application(), DataCaptureConfig.Provider, Configur
return configuration as DataCaptureConfig
}

override fun getWorkManagerConfiguration(): Configuration =
override val workManagerConfiguration: Configuration =
Configuration.Builder()
.setMinimumLoggingLevel(if (BuildConfig.DEBUG) Log.VERBOSE else Log.INFO)
.setWorkerFactory(workerFactory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fun HomeScreen(
val refreshKey by appMainViewModel.refreshHash

LaunchedEffect(syncState) {
if (syncState is SyncJobStatus.Finished) {
if (syncState is SyncJobStatus.Succeeded) {
homeViewModel.refresh()
}
}
Expand Down Expand Up @@ -178,11 +178,10 @@ fun AppScreenBody(syncState: SyncJobStatus?, sync: () -> Unit) {
},
)
}
is SyncJobStatus.Finished -> {
is SyncJobStatus.Succeeded -> {
Text(text = "Sync (finished)")
}
is SyncJobStatus.Glitch,
is SyncJobStatus.Failed, -> {
is SyncJobStatus.Failed -> {
Text(text = "Sync (failed)")
}
else -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,6 @@ class AppMainActivity : BaseMultiLanguageActivity(), OnSyncListener {
)
appMainViewModel.onEvent(AppMainEvent.UpdateSyncState(state, null))
}
is SyncJobStatus.Glitch -> {
appMainViewModel.onEvent(AppMainEvent.UpdateSyncState(state, lastSyncTime = null))
Timber.w(
(if (state?.exceptions != null) state.exceptions else emptyList()).joinToString {
it.exception.message.toString()
},
)
}
is SyncJobStatus.Failed -> {
if (
!state?.exceptions.isNullOrEmpty() &&
Expand Down Expand Up @@ -114,8 +106,8 @@ class AppMainActivity : BaseMultiLanguageActivity(), OnSyncListener {
),
)
}
is SyncJobStatus.Finished -> {
if (lastSyncState !is SyncJobStatus.Finished) {
is SyncJobStatus.Succeeded -> {
if (lastSyncState !is SyncJobStatus.Succeeded) {
showToast(getString(org.smartregister.fhircore.engine.R.string.sync_completed))
}
appMainViewModel.run {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ constructor(
when (event) {
is AppMainEvent.UpdateSyncState -> {
when (event.state) {
is SyncJobStatus.Finished,
is SyncJobStatus.Succeeded,
is SyncJobStatus.Failed, -> {
val lastSyncTime = event.lastSyncTime ?: (retrieveLastSyncTimestamp() ?: "")
appMainUiState.value =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fun PatientScreen(
val refreshKey by appMainViewModel.refreshHash

LaunchedEffect(syncState) {
if (syncState is SyncJobStatus.Finished) {
if (syncState is SyncJobStatus.Succeeded) {
patientViewModel.fetchPatient()
}
}
Expand Down
Loading