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

Upgrade sdk libraries to latest versions #2825

Merged
merged 138 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
cf94e7f
Uprade gradle dependencies
ellykits Oct 16, 2023
83a5f79
WIP
owais-vd Oct 17, 2023
a004aed
Refactor failing tests
ellykits Oct 18, 2023
f1232a1
Merge branch 'main' into upgrade-sdk-libraries
ellykits Oct 18, 2023
ee98977
Merge branch 'apply-testing' into upgrade-sdk-libraries
ellykits Oct 18, 2023
a517d48
Refactor failing tests quest module
ellykits Oct 18, 2023
566dd1c
Merge branch 'main' into upgrade-sdk-libraries
ellykits Oct 24, 2023
d822140
Merge branch 'main' into upgrade-sdk-libraries
ellykits Oct 24, 2023
757ef9b
Fix failing build
ellykits Oct 24, 2023
3a0640a
Update Kotlin version to 1.8.20
ellykits Oct 25, 2023
0dc0169
Remove extra libraries | upgrade sdk workflow libs (#2837)
maimoonak Oct 27, 2023
316d851
Merge branch 'upgrade-sdk-libraries' of github.com:opensrp/fhircore i…
ellykits Oct 30, 2023
69bf5a6
Merge branch 'main' into upgrade-sdk-libraries
ellykits Oct 30, 2023
7ec1fc6
Merge branch 'upgrade-sdk-libraries' of github.com:opensrp/fhircore i…
ellykits Oct 30, 2023
f374de4
Delete unused dependencies
ellykits Oct 30, 2023
1935bc6
Update sdk library versions
ellykits Nov 1, 2023
ebbcca7
Disable code coverage
ellykits Nov 1, 2023
c897765
Resolve blocker causing build failures
ellykits Nov 1, 2023
0f6e4f2
Merge branch 'main' into upgrade-sdk-libraries
ellykits Nov 1, 2023
e122456
Change CI JDK version to 17
ellykits Nov 1, 2023
6b22858
Refactor tests in quest module
ellykits Nov 2, 2023
85de386
Merge branch 'main' into upgrade-sdk-libraries
dubdabasoduba Nov 3, 2023
eaf8ddb
Update compose version to v1.4.6
ellykits Nov 3, 2023
28045bb
Merge branch 'upgrade-sdk-libraries' of github.com:opensrp/fhircore i…
ellykits Nov 3, 2023
a811009
Update unit test
Rkareko Nov 8, 2023
296a946
Fix loading of json resources from file on generateMeaslesCarePlan test
Rkareko Nov 8, 2023
d7a922a
Update generateMeaslesCarePlan test
DebbieArita Nov 8, 2023
830545f
Add org.opencds.cqf.fhir:cqf-fhir-cr:3.0.0-PRE9 dependency
qiarie Nov 8, 2023
df96c15
Merge branch 'main' into upgrade-sdk-libraries
pld Nov 8, 2023
c43699c
Merge branch 'main' into upgrade-sdk-libraries
Rkareko Nov 9, 2023
9bafbde
Fix duplicate class error in geowidget module
Rkareko Nov 9, 2023
85e9983
Merge branch 'upgrade-sdk-libraries' of github.com:opensrp/fhircore i…
Rkareko Nov 9, 2023
a1d5bac
Run spotless Apply
Rkareko Nov 9, 2023
ad8439b
Fix duplicate class error in engine module
Rkareko Nov 10, 2023
8873049
Update creation of task for references to include resource type
Rkareko Nov 10, 2023
42cdbf0
updated the testing thread and move the engine initialization on setup
owais-vd Nov 10, 2023
34d3860
Fix tests assertions testing thrown exceptions
Rkareko Nov 12, 2023
88f08c0
Add gson type handler for timezone
Rkareko Nov 14, 2023
128413b
Update file location of generated code coverage data
Rkareko Nov 14, 2023
95fc382
Add build config for enabling test coverage in quest module
Rkareko Nov 14, 2023
32ebce6
Update generateMeaslesCarePlan test resources to generate medicalRequest
DebbieArita Nov 14, 2023
8b214ea
Revert additional of enable test covergae confis in quest build config
Rkareko Nov 14, 2023
8ecae07
Merge branch 'upgrade-sdk-libraries' of github.com:opensrp/fhircore i…
Rkareko Nov 14, 2023
3d7db34
Run spotlessApply
DebbieArita Nov 14, 2023
3a622e3
Enable running of evaluatePerformanceBenchmarkResults
Rkareko Nov 15, 2023
6a7873a
Run spotlessApply
Rkareko Nov 15, 2023
c08b361
Add debug flag on commands for running quest tests
Rkareko Nov 15, 2023
e2ea7e8
Add github action for downloading workflow artifacts
Rkareko Nov 15, 2023
82b8b84
Temporarily disable running of jacoco report generation command
Rkareko Nov 15, 2023
0da2e9b
Remove debug logging command
Rkareko Nov 15, 2023
80a5915
Only run tests without generating coverage report
Rkareko Nov 16, 2023
e03d395
Temporarily disable action for uploading test coverage
Rkareko Nov 16, 2023
4c77801
enable action for uploading test coverage
Rkareko Nov 16, 2023
81964bb
Revert changes made to quest CI workflow
Rkareko Nov 16, 2023
366e96f
Add manifest permission for writing to external storage
Rkareko Nov 16, 2023
1e2428a
Revert manifest permission for writing to external storage
Rkareko Nov 16, 2023
cc8ea67
Comment out command for generating coverage report for instrumented …
Rkareko Nov 16, 2023
e7d1bd7
Only generate report for unit tests
Rkareko Nov 16, 2023
73efcd9
Comment out exclusion of commons-logging dependency from quest build …
Rkareko Nov 16, 2023
edc4354
Fix failing testHandleQuestionnaireSubmission test
Rkareko Nov 16, 2023
d950aa3
moved measles test from structureMapUtilitiesTest to FhirCarePlanGene…
owais-vd Nov 16, 2023
edcde6a
Run spotless apply
Rkareko Nov 16, 2023
0b97404
spotlessApply
owais-vd Nov 16, 2023
b1b5e89
Merge branch 'upgrade-sdk-libraries' of github.com:opensrp/fhircore i…
Rkareko Nov 16, 2023
539d971
Update workflow command for running quest tests
Rkareko Nov 16, 2023
cbb99ad
Correct file path for generated code coverage
Rkareko Nov 16, 2023
236ec90
Add manifest permission for writing to external storage
Rkareko Nov 16, 2023
7217899
Temporarily disable running of engine and geo-widget tests
Rkareko Nov 16, 2023
2754420
Temporarily disable running of performance tests
Rkareko Nov 16, 2023
1c0b841
only run quest test in the UI profile package
Rkareko Nov 16, 2023
d1ff1ca
Merge branch 'main' into upgrade-sdk-libraries
ndegwamartin Nov 17, 2023
f10402a
Update quest module test run command to use gradlew tasks
Rkareko Nov 20, 2023
dc38df3
Merge branch 'upgrade-sdk-libraries' of github.com:opensrp/fhircore i…
Rkareko Nov 20, 2023
d2da4b3
Enable running of engine, geowidget and performance tests
Rkareko Nov 21, 2023
b2bad33
Merge branch 'main' into upgrade-sdk-libraries
Rkareko Nov 21, 2023
3601636
Revert perfmission for writing to external storage
Rkareko Nov 21, 2023
1474afa
Merge branch 'upgrade-sdk-libraries' of github.com:opensrp/fhircore i…
Rkareko Nov 21, 2023
2553388
Merge branch 'main' into upgrade-sdk-libraries
Rkareko Nov 21, 2023
3db27f9
Merge branch 'main' into upgrade-sdk-libraries
Rkareko Nov 23, 2023
28589a0
Update engine version
Rkareko Nov 24, 2023
990c21c
Merge branch 'upgrade-sdk-libraries' of github.com:opensrp/fhircore i…
Rkareko Nov 24, 2023
ac72c54
Trying to recreate the StructureMap running environment in the $apply…
vitorpamplona Dec 18, 2023
fcac929
remove now incorrect comment
pld Dec 18, 2023
7765ea8
Fix duplicate classes
ellykits Dec 20, 2023
e250377
Merge branch 'main' into upgrade-sdk-libraries
owais-vd Dec 26, 2023
5166609
added datastore-preferences version in libs.versions.toml
owais-vd Dec 26, 2023
6a84dab
updated test case and workflow
owais-vd Dec 28, 2023
c84f13d
Remove hardcoded resource type declaration
Rkareko Jan 19, 2024
c58bc6d
Upgrade to the latest SDK artifacts
ndegwamartin Jan 22, 2024
219c77b
fhirOperator library | Fix cql content tests
Jan 12, 2024
b8eade5
spotless fix
Jan 12, 2024
ef7722f
load knowledge manager resources
Jan 12, 2024
2b0a657
Fix failing test
Jan 12, 2024
af047b0
[Workaround] Migrate to latest SDK Artifacts 💚 -
ndegwamartin Jan 24, 2024
4c84739
Migrate to latest SDK Artifacts - Code changes ✅
ndegwamartin Jan 24, 2024
5ba6194
Contraint depdendencies to Gradle API configuration
ndegwamartin Jan 24, 2024
25fcf16
Merge remote-tracking branch 'origin/main' into upgrade-sdk-libraries
ndegwamartin Jan 24, 2024
8ce6254
Spotless Apply
ndegwamartin Jan 24, 2024
c519e94
Merge branch 'main' into upgrade-sdk-libraries
pld Jan 24, 2024
e323ad9
remove commented code
pld Jan 24, 2024
2cb4ea9
add note on $this.id
pld Jan 24, 2024
ce204ce
remove comments
pld Jan 24, 2024
38786e6
use var, make private
pld Jan 24, 2024
14e98bf
add ntoe on measures
pld Jan 24, 2024
d7bfd18
Add missing slash when evaluating task.for reference
Rkareko Jan 25, 2024
7d171b9
upgrade gradle to version 8.2.2
ndegwamartin Jan 25, 2024
3e9807f
Merge branch 'upgrade-sdk-libraries' of https://github.com/opensrp/fh…
ndegwamartin Jan 25, 2024
195fc0e
Merge remote-tracking branch 'origin/main' into upgrade-sdk-libraries
ndegwamartin Jan 25, 2024
7d2745a
Update depdendency configuration
ndegwamartin Jan 25, 2024
281f712
Trigger CI
ndegwamartin Jan 25, 2024
704a91d
Code cleanup - remove comment
Rkareko Jan 25, 2024
b50b6bd
Merge remote-tracking branch 'origin/main' into upgrade-sdk-libraries
ndegwamartin Jan 25, 2024
220d173
Code clean up
ndegwamartin Jan 25, 2024
53e242c
Update android/macrobenchmark/build.gradle.kts
pld Jan 25, 2024
7eaadf1
Merge branch 'main' into upgrade-sdk-libraries
pld Jan 26, 2024
ba3ad77
Merge branch 'main' into upgrade-sdk-libraries
pld Jan 26, 2024
32f61ce
add to content change notes
pld Jan 26, 2024
c92a700
Merge branch 'main' into upgrade-sdk-libraries
ndegwamartin Jan 29, 2024
d505c7e
Fixes CQL evaluation post Questionnaire submission
ndegwamartin Jan 31, 2024
2a68650
Merge branch 'main' into upgrade-sdk-libraries
owais-vd Feb 1, 2024
822b6af
fixed method name
owais-vd Feb 1, 2024
bf607c8
Merge branch 'upgrade-sdk-libraries' of https://github.com/opensrp/fh…
ndegwamartin Feb 2, 2024
cb4d76f
Careplan generation, Engine Build, Tests
ndegwamartin Feb 2, 2024
0cd50ac
Spotless clean
ndegwamartin Feb 2, 2024
89ac5a4
Fix Tests ✅
ndegwamartin Feb 3, 2024
f75f06b
Clean up 🗑
ndegwamartin Feb 3, 2024
8da3c4e
remove duplicate note
pld Feb 5, 2024
ce5d08c
Merge branch 'main' into upgrade-sdk-libraries
ndegwamartin Feb 6, 2024
5822652
Move Configs to Constants object - update documentation
ndegwamartin Feb 6, 2024
c0d878f
Remove guava cache config from build: Enforced by SDK
ndegwamartin Feb 6, 2024
16229dc
Merge branch 'main' into upgrade-sdk-libraries
ndegwamartin Feb 6, 2024
676c881
Update CHANGELOG.md
pld Feb 6, 2024
85cd72c
remove comments
pld Feb 6, 2024
1417f48
Refactor Dollar Lite to function
ndegwamartin Feb 7, 2024
26c551b
Upgrade Engine and SDC artifacts
ndegwamartin Feb 7, 2024
ff6f2dd
Fix Build ✅
ndegwamartin Feb 7, 2024
7893f28
Upgrade Engine + SDC artifacts
ndegwamartin Feb 7, 2024
26fae69
Merge branch 'main' into upgrade-sdk-libraries
ndegwamartin Feb 7, 2024
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
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,16 +91,16 @@ subprojects {
resolutionStrategy {
eachDependency {
when (requested.group) {
"org.jacoco" -> useVersion("0.8.7")
"org.jacoco" -> useVersion("0.8.11")
}
}
}
}

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
Loading