Skip to content

Commit

Permalink
Merge branch 'main' into main-lw-sample
Browse files Browse the repository at this point in the history
* main:
  Add icons to be displayed on eusm service point register. (#3047)
  Upgrade sdk libraries to latest versions (#2825)
  Make Login Screen Logo Size Configurable (#3045)

# Conflicts:
#	android/gradle/libs.versions.toml
#	android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt
  • Loading branch information
AbdulWahabMemon committed Feb 9, 2024
2 parents 339ee92 + 8183ab7 commit 346019c
Show file tree
Hide file tree
Showing 165 changed files with 55,205 additions and 1,309 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/apk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
with:
fetch-depth: 2

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
with:
fetch-depth: 2

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down Expand Up @@ -101,10 +101,10 @@ jobs:
with:
fetch-depth: 2

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down Expand Up @@ -172,10 +172,10 @@ jobs:
with:
fetch-depth: 2

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down Expand Up @@ -221,9 +221,10 @@ jobs:
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew -PlocalPropertiesFile=local.properties :quest:clean && ./gradlew -PlocalPropertiesFile=local.properties :quest:assembleOpensrpDebugAndroidTest --stacktrace && /Users/runner/Library/Android/sdk/platform-tools/adb install quest/build/outputs/apk/androidTest/opensrp/debug/quest-opensrp-debug-androidTest.apk && ./gradlew -PlocalPropertiesFile=local.properties :quest:assembleOpensrpDebug --stacktrace && /Users/runner/Library/Android/sdk/platform-tools/adb install quest/build/outputs/apk/opensrp/debug/quest-opensrp-debug.apk && /Users/runner/Library/Android/sdk/platform-tools/adb shell am instrument -w -e notPackage org.smartregister.fhircore.quest.performance -e coverage "true" org.smartregister.opensrp.test/org.smartregister.fhircore.quest.QuestTestRunner && /Users/runner/Library/Android/sdk/platform-tools/adb shell run-as org.smartregister.opensrp cat "/data/data/org.smartregister.opensrp/files/coverage.ec" > quest/coverage.ec && ./gradlew -PlocalPropertiesFile=local.properties :quest:fhircoreJacocoReport --stacktrace
script: ./gradlew clean -PlocalPropertiesFile=local.properties :quest:fhircoreJacocoReport --stacktrace -Pandroid.testInstrumentationRunnerArguments.notPackage=org.smartregister.fhircore.quest.performance
# ./gradlew -PlocalPropertiesFile=local.properties :quest:clean && ./gradlew -PlocalPropertiesFile=local.properties :quest:assembleOpensrpDebugAndroidTest --stacktrace && /Users/runner/Library/Android/sdk/platform-tools/adb install quest/build/outputs/apk/androidTest/opensrp/debug/quest-opensrp-debug-androidTest.apk && ./gradlew -PlocalPropertiesFile=local.properties :quest:assembleOpensrpDebug --stacktrace && /Users/runner/Library/Android/sdk/platform-tools/adb install quest/build/outputs/apk/opensrp/debug/quest-opensrp-debug.apk && /Users/runner/Library/Android/sdk/platform-tools/adb shell am instrument -w -e package org.smartregister.fhircore.quest.ui.profile -e coverage "true" org.smartregister.opensrp.test/org.smartregister.fhircore.quest.QuestTestRunner && /Users/runner/Library/Android/sdk/platform-tools/adb shell run-as org.smartregister.opensrp cat "/data/user/0/org.smartregister.opensrp/files/coverage.ec" > quest/coverage.ec && ./gradlew -PlocalPropertiesFile=local.properties :quest:fhircoreJacocoReport --stacktrace

- name: Upload Quest module test coverage report to Codecov
if: matrix.api-level == 30 # Only upload coverage on API level 30
working-directory: android
run: bash <(curl -s https://codecov.io/bash) -F quest -f "quest/build/reports/jacoco/fhircoreJacocoReport/fhircoreJacocoReport.xml"
run: bash <(curl -s https://codecov.io/bash) -F quest -f "quest/build/reports/jacoco/fhircoreJacocoReport/fhircoreJacocoReport.xml"
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
with:
fetch-depth: 2

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down Expand Up @@ -80,4 +80,4 @@ jobs:

- name: Check performance results
working-directory: android
run: ./gradlew :quest:evaluatePerformanceBenchmarkResults --stacktrace
run: ./gradlew :quest:evaluatePerformanceBenchmarkResults --stacktrace
4 changes: 2 additions & 2 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Cache SonarQube packages
uses: actions/cache@v1
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2024-xx-xx

### Changed
- Upgrade to latest Android FHIR SDK version includes
1. an upgrade to the HAPI FHIR libraries used to process StructureMaps. In the previous libraries `$this.id` returned `[ResourceType]/[ID #]`, the new libraries return `[ID #]`. Therefore, any existing StructureMaps that call `$this.id` will need to replace that with `$this.type().name + '/' + $this.id` to have the equivalent output.
2. changes to Measure evaluation that requires all Measure JSON files to be rebuilt.
3. change to some [MetadataResources](https://hl7.org/fhir/R5/metadataresource.html) that requires they are referenced by URL and not ID. Any existing content that referes to StructureMaps by ID must be updated to refer to it by URL. If we are not storing a URL for it, we will need to add that. E.g. `Library.url`, `Plandefinition.url` because the `FhirOperator` API uses that field to uniquely identify/retrieve the Metadata resource.
4. for CQL evaluation, the context is referred to using `%subject` and not `$this`. The latter is reserved for FHIRPath expressions while the former is used for CQL expressions to refer to the primary subject of the expression e.g. patient.

## [0.2.4] - 2023-06-24
### Added
- Insights feature to show stats on any _Unsynced_ Resources on the device
Expand Down
22 changes: 12 additions & 10 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@ import org.jetbrains.dokka.base.DokkaBaseConfiguration
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath("de.mannodermaus.gradle.plugins:android-junit5:1.8.2.1")
classpath("com.android.tools.build:gradle:7.1.3")
classpath("org.jetbrains.dokka:dokka-base:1.8.20")
classpath(libs.kotlin.gradle.plugin)
classpath(libs.coveralls.gradle.plugin)
classpath(libs.gradle)
classpath(libs.dokka.base)
}
}

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("com.github.kt3k.coveralls") version "2.12.0"
id("org.jetbrains.kotlin.jvm") version "1.8.10"
alias(libs.plugins.org.jetbrains.kotlin.jvm)
alias(libs.plugins.kt3k.coveralls)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.dagger.hilt.android) apply false
alias(libs.plugins.androidx.navigation.safeargs) apply false
alias(libs.plugins.org.jetbrains.dokka)
alias(libs.plugins.org.owasp.dependencycheck)
alias(libs.plugins.com.diffplug.spotless)
alias(libs.plugins.com.diffplug.spotless) apply false
alias(libs.plugins.android.junit5) apply false

}

Expand All @@ -36,6 +37,7 @@ tasks.dokkaHtmlMultiModule {

allprojects {
repositories {
gradlePluginPortal()
mavenLocal()
google()
mavenCentral()
Expand Down Expand Up @@ -89,7 +91,7 @@ subprojects {
resolutionStrategy {
eachDependency {
when (requested.group) {
"org.jacoco" -> useVersion("0.8.7")
"org.jacoco" -> useVersion("0.8.11")
}
}

Expand All @@ -105,10 +107,10 @@ subprojects {
}
}

tasks.withType<Test> {
tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
excludes = listOf("jdk.internal.*", "**org.hl7*")
}
}
}
9 changes: 9 additions & 0 deletions android/buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
`kotlin-dsl`
}

repositories {
google()
gradlePluginPortal()
mavenCentral()
}
144 changes: 144 additions & 0 deletions android/buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/*
* Copyright 2023-2024 Google LLC
*
* 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.
*/

import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.DependencyConstraint
import org.gradle.kotlin.dsl.exclude

object Dependencies {

object HapiFhir {
const val fhirBaseModule = "ca.uhn.hapi.fhir:hapi-fhir-base"
const val fhirClientModule = "ca.uhn.hapi.fhir:hapi-fhir-client"
const val structuresDstu2Module = "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2"
const val structuresDstu3Module = "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu3"
const val structuresR4Module = "ca.uhn.hapi.fhir:hapi-fhir-structures-r4"
const val structuresR4bModule = "ca.uhn.hapi.fhir:hapi-fhir-structures-r4b"
const val structuresR5Module = "ca.uhn.hapi.fhir:hapi-fhir-structures-r5"

const val validationModule = "ca.uhn.hapi.fhir:hapi-fhir-validation"
const val validationDstu3Module = "ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu3"
const val validationR4Module = "ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r4"
const val validationR5Module = "ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r5"

const val fhirCoreDstu2Module = "ca.uhn.hapi.fhir:org.hl7.fhir.dstu2"
const val fhirCoreDstu2016Module = "ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may"
const val fhirCoreDstu3Module = "ca.uhn.hapi.fhir:org.hl7.fhir.dstu3"
const val fhirCoreR4Module = "ca.uhn.hapi.fhir:org.hl7.fhir.r4"
const val fhirCoreR4bModule = "ca.uhn.hapi.fhir:org.hl7.fhir.r4b"
const val fhirCoreR5Module = "ca.uhn.hapi.fhir:org.hl7.fhir.r5"
const val fhirCoreUtilsModule = "ca.uhn.hapi.fhir:org.hl7.fhir.utilities"
const val fhirCoreConvertorsModule = "ca.uhn.hapi.fhir:org.hl7.fhir.convertors"

const val guavaCachingModule = "ca.uhn.hapi.fhir:hapi-fhir-caching-guava"

const val fhirBase = "$fhirBaseModule:${Versions.hapiFhir}"
const val fhirClient = "$fhirClientModule:${Versions.hapiFhir}"
const val structuresDstu2 = "$structuresDstu2Module:${Versions.hapiFhir}"
const val structuresDstu3 = "$structuresDstu3Module:${Versions.hapiFhir}"
const val structuresR4 = "$structuresR4Module:${Versions.hapiFhir}"
const val structuresR4b = "$structuresR4bModule:${Versions.hapiFhir}"
const val structuresR5 = "$structuresR5Module:${Versions.hapiFhir}"

const val validation = "$validationModule:${Versions.hapiFhir}"
const val validationDstu3 = "$validationDstu3Module:${Versions.hapiFhir}"
const val validationR4 = "$validationR4Module:${Versions.hapiFhir}"
const val validationR5 = "$validationR5Module:${Versions.hapiFhir}"

const val fhirCoreDstu2 = "$fhirCoreDstu2Module:${Versions.hapiFhirCore}"
const val fhirCoreDstu2016 = "$fhirCoreDstu2016Module:${Versions.hapiFhirCore}"
const val fhirCoreDstu3 = "$fhirCoreDstu3Module:${Versions.hapiFhirCore}"
const val fhirCoreR4 = "$fhirCoreR4Module:${Versions.hapiFhirCore}"
const val fhirCoreR4b = "$fhirCoreR4bModule:${Versions.hapiFhirCore}"
const val fhirCoreR5 = "$fhirCoreR5Module:${Versions.hapiFhirCore}"
const val fhirCoreUtils = "$fhirCoreUtilsModule:${Versions.hapiFhirCore}"
const val fhirCoreConvertors = "$fhirCoreConvertorsModule:${Versions.hapiFhirCore}"

const val guavaCaching = "$guavaCachingModule:${Versions.hapiFhir}"
}

object Jackson {
private const val mainGroup = "com.fasterxml.jackson"
private const val coreGroup = "$mainGroup.core"
private const val dataformatGroup = "$mainGroup.dataformat"
private const val datatypeGroup = "$mainGroup.datatype"
private const val moduleGroup = "$mainGroup.module"

const val annotationsBase = "$coreGroup:jackson-annotations:${Versions.jackson}"
const val bomBase = "$mainGroup:jackson-bom:${Versions.jackson}"
const val coreBase = "$coreGroup:jackson-core:${Versions.jacksonCore}"
const val databindBase = "$coreGroup:jackson-databind:${Versions.jackson}"
const val dataformatXmlBase = "$dataformatGroup:jackson-dataformat-xml:${Versions.jackson}"
const val jaxbAnnotationsBase =
"$moduleGroup:jackson-module-jaxb-annotations:${Versions.jackson}"
const val jsr310Base = "$datatypeGroup:jackson-datatype-jsr310:${Versions.jackson}"
}

object Versions {
const val hapiFhir = "6.8.0"
const val hapiFhirCore = "6.0.22"

// Maximum Jackson libraries (excluding core) version that supports Android API Level 24:
// https://github.com/FasterXML/jackson-databind/issues/3658
const val jackson = "2.13.5"

// Maximum Jackson Core library version that supports Android API Level 24:
const val jacksonCore = "2.15.2"
}

fun Configuration.removeIncompatibleDependencies() {
exclude(module = "xpp3")
exclude(module = "xpp3_min")
exclude(module = "xmlpull")
exclude(module = "javax.json")
exclude(module = "jcl-over-slf4j")
exclude(group = "org.apache.httpcomponents")
exclude(group = "org.antlr", module = "antlr4")
exclude(group = "org.eclipse.persistence", module = "org.eclipse.persistence.moxy")
exclude(module = "hapi-fhir-caching-caffeine")
exclude(group = "com.github.ben-manes.caffeine", module = "caffeine")
}

fun hapiFhirConstraints(): Map<String, DependencyConstraint.() -> Unit> {
return mutableMapOf<String, DependencyConstraint.() -> Unit>(
HapiFhir.fhirBaseModule to { version { strictly(Versions.hapiFhir) } },
HapiFhir.fhirClientModule to { version { strictly(Versions.hapiFhir) } },
HapiFhir.fhirCoreConvertorsModule to { version { strictly(Versions.hapiFhirCore) } },
HapiFhir.fhirCoreDstu2Module to { version { strictly(Versions.hapiFhirCore) } },
HapiFhir.fhirCoreDstu2016Module to { version { strictly(Versions.hapiFhirCore) } },
HapiFhir.fhirCoreDstu3Module to { version { strictly(Versions.hapiFhirCore) } },
HapiFhir.fhirCoreR4Module to { version { strictly(Versions.hapiFhirCore) } },
HapiFhir.fhirCoreR4bModule to { version { strictly(Versions.hapiFhirCore) } },
HapiFhir.fhirCoreR5Module to { version { strictly(Versions.hapiFhirCore) } },
HapiFhir.fhirCoreUtilsModule to { version { strictly(Versions.hapiFhirCore) } },
HapiFhir.structuresDstu2Module to { version { strictly(Versions.hapiFhir) } },
HapiFhir.structuresDstu3Module to { version { strictly(Versions.hapiFhir) } },
HapiFhir.structuresR4Module to { version { strictly(Versions.hapiFhir) } },
HapiFhir.structuresR5Module to { version { strictly(Versions.hapiFhir) } },
HapiFhir.validationModule to { version { strictly(Versions.hapiFhir) } },
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.bomBase to { version { strictly(Versions.jackson) } },
Jackson.coreBase to { version { strictly(Versions.jacksonCore) } },
Jackson.databindBase to { version { strictly(Versions.jackson) } },
Jackson.jaxbAnnotationsBase to { version { strictly(Versions.jackson) } },
Jackson.jsr310Base to { version { strictly(Versions.jackson) } },
Jackson.dataformatXmlBase to { version { strictly(Versions.jackson) } },
)
}
}
Loading

0 comments on commit 346019c

Please sign in to comment.