Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into eval-variables-fo…
Browse files Browse the repository at this point in the history
…r-cqf-expressions
  • Loading branch information
LZRS committed Jan 9, 2024
2 parents 12277b0 + 30a07d7 commit 080e4b3
Show file tree
Hide file tree
Showing 60 changed files with 2,992 additions and 848 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Release artifacts to local repo
run: ./gradlew publishReleasePublicationToCIRepository --scan
- name: Upload maven repo
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: maven-repository
path: build/ci-repo
Expand All @@ -92,7 +92,7 @@ jobs:
# Upload the build dir for all the modules for diagnosis
- name: Upload build dir
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: build.zip
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
distribution: temurin

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

Expand All @@ -69,6 +69,6 @@ jobs:
run: ./gradlew --scan --full-stacktrace -Dorg.gradle.dependency.verification=off compileDebugAndroidTestSources

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ dependencies {

implementation("com.spotify.ruler:ruler-gradle-plugin:1.4.0")

implementation("ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.8.0")
implementation("ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.10.0")
implementation("com.squareup:kotlinpoet:1.15.3")
}
177 changes: 91 additions & 86 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Google LLC
* 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.
Expand All @@ -15,6 +15,7 @@
*/

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

object Dependencies {
Expand Down Expand Up @@ -42,34 +43,53 @@ object Dependencies {
}

object HapiFhir {
const val fhirBase = "ca.uhn.hapi.fhir:hapi-fhir-base:${Versions.hapiFhir}"
const val fhirClient = "ca.uhn.hapi.fhir:hapi-fhir-client:${Versions.hapiFhir}"
const val structuresDstu2 = "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:${Versions.hapiFhir}"
const val structuresDstu3 = "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu3:${Versions.hapiFhir}"
const val structuresR4 = "ca.uhn.hapi.fhir:hapi-fhir-structures-r4:${Versions.hapiFhir}"
const val structuresR4b = "ca.uhn.hapi.fhir:hapi-fhir-structures-r4b:${Versions.hapiFhir}"
const val structuresR5 = "ca.uhn.hapi.fhir:hapi-fhir-structures-r5:${Versions.hapiFhir}"

const val validation = "ca.uhn.hapi.fhir:hapi-fhir-validation:${Versions.hapiFhir}"
const val validationDstu3 =
"ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu3:${Versions.hapiFhir}"
const val validationR4 =
"ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r4:${Versions.hapiFhir}"
const val validationR5 =
"ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r5:${Versions.hapiFhir}"

const val fhirCoreDstu2 = "ca.uhn.hapi.fhir:org.hl7.fhir.dstu2:${Versions.hapiFhirCore}"
const val fhirCoreDstu2016 =
"ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may:${Versions.hapiFhirCore}"
const val fhirCoreDstu3 = "ca.uhn.hapi.fhir:org.hl7.fhir.dstu3:${Versions.hapiFhirCore}"
const val fhirCoreR4 = "ca.uhn.hapi.fhir:org.hl7.fhir.r4:${Versions.hapiFhirCore}"
const val fhirCoreR4b = "ca.uhn.hapi.fhir:org.hl7.fhir.r4b:${Versions.hapiFhirCore}"
const val fhirCoreR5 = "ca.uhn.hapi.fhir:org.hl7.fhir.r5:${Versions.hapiFhirCore}"
const val fhirCoreUtils = "ca.uhn.hapi.fhir:org.hl7.fhir.utilities:${Versions.hapiFhirCore}"
const val fhirCoreConvertors =
"ca.uhn.hapi.fhir:org.hl7.fhir.convertors:${Versions.hapiFhirCore}"

const val guavaCaching = "ca.uhn.hapi.fhir:hapi-fhir-caching-guava:${Versions.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 {
Expand All @@ -79,13 +99,14 @@ object Dependencies {
private const val datatypeGroup = "$mainGroup.datatype"
private const val moduleGroup = "$mainGroup.module"

const val annotations = "$coreGroup:jackson-annotations:${Versions.jackson}"
const val bom = "$mainGroup:jackson-bom:${Versions.jackson}"
const val core = "$coreGroup:jackson-core:${Versions.jacksonCore}"
const val databind = "$coreGroup:jackson-databind:${Versions.jackson}"
const val dataformatXml = "$dataformatGroup:jackson-dataformat-xml:${Versions.jackson}"
const val jaxbAnnotations = "$moduleGroup:jackson-module-jaxb-annotations:${Versions.jackson}"
const val jsr310 = "$datatypeGroup:jackson-datatype-jsr310:${Versions.jackson}"
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 Kotlin {
Expand Down Expand Up @@ -148,7 +169,10 @@ object Dependencies {
const val desugarJdkLibs = "com.android.tools:desugar_jdk_libs:${Versions.desugarJdkLibs}"
const val fhirUcum = "org.fhir:ucum:${Versions.fhirUcum}"
const val gson = "com.google.code.gson:gson:${Versions.gson}"
const val guava = "com.google.guava:guava:${Versions.guava}"

const val guavaModule = "com.google.guava:guava"
const val guava = "$guavaModule:${Versions.guava}"

const val httpInterceptor = "com.squareup.okhttp3:logging-interceptor:${Versions.http}"
const val http = "com.squareup.okhttp3:okhttp:${Versions.http}"
const val mockWebServer = "com.squareup.okhttp3:mockwebserver:${Versions.http}"
Expand Down Expand Up @@ -231,7 +255,7 @@ object Dependencies {
const val caffeine = "2.9.1"
const val fhirUcum = "1.0.3"
const val gson = "2.9.1"
const val guava = "32.1.2-android"
const val guava = "32.1.3-android"

const val hapiFhir = "6.8.0"
const val hapiFhirCore = "6.0.22"
Expand Down Expand Up @@ -294,57 +318,38 @@ object Dependencies {
exclude(group = "org.apache.httpcomponents")
exclude(group = "org.antlr", module = "antlr4")
exclude(group = "org.eclipse.persistence", module = "org.eclipse.persistence.moxy")
}

fun Configuration.forceGuava() {
// Removes caffeine
exclude(module = "hapi-fhir-caching-caffeine")
exclude(group = "com.github.ben-manes.caffeine", module = "caffeine")

resolutionStrategy {
force(guava)
force(HapiFhir.guavaCaching)
}
}

fun Configuration.forceHapiVersion() {
// Removes newer versions of caffeine and manually imports 2.9
// Removes newer versions of hapi and keeps on 6.0.1
// (newer versions don't work on Android)
resolutionStrategy {
force(HapiFhir.fhirBase)
force(HapiFhir.fhirClient)
force(HapiFhir.fhirCoreConvertors)

force(HapiFhir.fhirCoreDstu2)
force(HapiFhir.fhirCoreDstu2016)
force(HapiFhir.fhirCoreDstu3)
force(HapiFhir.fhirCoreR4)
force(HapiFhir.fhirCoreR4b)
force(HapiFhir.fhirCoreR5)
force(HapiFhir.fhirCoreUtils)

force(HapiFhir.structuresDstu2)
force(HapiFhir.structuresDstu3)
force(HapiFhir.structuresR4)
force(HapiFhir.structuresR5)

force(HapiFhir.validation)
force(HapiFhir.validationDstu3)
force(HapiFhir.validationR4)
force(HapiFhir.validationR5)
}
}

fun Configuration.forceJacksonVersion() {
resolutionStrategy {
force(Jackson.annotations)
force(Jackson.bom)
force(Jackson.core)
force(Jackson.databind)
force(Jackson.jaxbAnnotations)
force(Jackson.jsr310)
force(Jackson.dataformatXml)
}
fun hapiFhirConstraints(): Map<String, DependencyConstraint.() -> Unit> {
return mutableMapOf<String, DependencyConstraint.() -> Unit>(
guavaModule to { version { strictly(Versions.guava) } },
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) } },
)
}
}
4 changes: 0 additions & 4 deletions catalog/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Dependencies.forceGuava

plugins {
id(Plugins.BuildPlugins.application)
id(Plugins.BuildPlugins.kotlinAndroid)
Expand Down Expand Up @@ -42,8 +40,6 @@ android {
kotlin { jvmToolchain(11) }
}

configurations { all { forceGuava() } }

dependencies {
androidTestImplementation(Dependencies.AndroidxTest.extJunit)
androidTestImplementation(Dependencies.Espresso.espressoCore)
Expand Down
22 changes: 10 additions & 12 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Dependencies.removeIncompatibleDependencies

plugins {
id(Plugins.BuildPlugins.androidLib)
id(Plugins.BuildPlugins.kotlinAndroid)
Expand All @@ -17,20 +19,10 @@ android {
kotlin { jvmToolchain(11) }
}

configurations {
all {
exclude(module = "xpp3")
exclude(module = "hapi-fhir-caching-caffeine")
exclude(group = "com.github.ben-manes.caffeine", module = "caffeine")

resolutionStrategy { force("com.google.guava:guava:32.1.3-android") }
}
}
configurations { all { removeIncompatibleDependencies() } }

dependencies {
// REVERT to DEPENDENCIES LATER
api("ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.8.0")
api("ca.uhn.hapi.fhir:hapi-fhir-caching-guava:6.10.0")
api(Dependencies.HapiFhir.structuresR4)

implementation(Dependencies.fhirUcum)

Expand All @@ -39,4 +31,10 @@ dependencies {
testImplementation(Dependencies.junit)
testImplementation(Dependencies.robolectric)
testImplementation(Dependencies.truth)

constraints {
Dependencies.hapiFhirConstraints().forEach { (libName, constraints) ->
api(libName, constraints)
}
}
}
9 changes: 2 additions & 7 deletions contrib/barcode/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Dependencies.forceGuava
import Dependencies.removeIncompatibleDependencies

plugins {
id(Plugins.BuildPlugins.androidLib)
Expand Down Expand Up @@ -46,12 +46,7 @@ android {
kotlin { jvmToolchain(11) }
}

configurations {
all {
exclude(module = "xpp3")
forceGuava()
}
}
configurations { all { removeIncompatibleDependencies() } }

dependencies {
androidTestImplementation(Dependencies.AndroidxTest.core)
Expand Down
15 changes: 9 additions & 6 deletions datacapture/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Dependencies.forceGuava
import Dependencies.forceHapiVersion
import Dependencies.forceJacksonVersion
import Dependencies.removeIncompatibleDependencies
import java.net.URL

plugins {
Expand Down Expand Up @@ -59,9 +57,7 @@ configurations {
all {
exclude(module = "xpp3")
exclude(group = "net.sf.saxon", module = "Saxon-HE")
forceGuava()
forceHapiVersion()
forceJacksonVersion()
removeIncompatibleDependencies()
}
}

Expand Down Expand Up @@ -108,6 +104,13 @@ dependencies {
testImplementation(Dependencies.mockitoKotlin)
testImplementation(Dependencies.robolectric)
testImplementation(Dependencies.truth)

constraints {
Dependencies.hapiFhirConstraints().forEach { (libName, constraints) ->
api(libName, constraints)
implementation(libName, constraints)
}
}
}

tasks.dokkaHtml.configure {
Expand Down
Loading

0 comments on commit 080e4b3

Please sign in to comment.