Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into master-release
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin committed Aug 22, 2023
2 parents 92b1938 + 4c2da74 commit 1327fec
Show file tree
Hide file tree
Showing 336 changed files with 13,961 additions and 3,859 deletions.
4 changes: 2 additions & 2 deletions .github/actions/commonSetup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ description: "Prepares the machine"
runs:
using: "composite"
steps:
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: "11"
java-version: "17"
- name: Make files executable
shell: bash
run: chmod +x ./gradlew
Expand Down
2 changes: 0 additions & 2 deletions benchmark/src/main/AndroidManifest.xml

This file was deleted.

5 changes: 2 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ repositories {
dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.6.0")

implementation("com.android.tools.build:gradle:7.1.1")
implementation("com.android.tools.build:gradle:8.0.2")

implementation("app.cash.licensee:licensee-gradle-plugin:1.3.0")
implementation("com.osacky.flank.gradle:fladle:0.17.4")

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

implementation("ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.0.1")
implementation("com.squareup:kotlinpoet:1.9.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21")
implementation("com.squareup:kotlinpoet:1.12.0")
}
109 changes: 61 additions & 48 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2023 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 Down Expand Up @@ -107,11 +107,11 @@ object Dependencies {
}

object Jackson {
const val mainGroup = "com.fasterxml.jackson"
const val coreGroup = "$mainGroup.core"
const val dataformatGroup = "$mainGroup.dataformat"
const val datatypeGroup = "$mainGroup.datatype"
const val moduleGroup = "$mainGroup.module"
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 annotations = "$coreGroup:jackson-annotations:${Versions.jackson}"
const val bom = "$mainGroup:jackson-bom:${Versions.jackson}"
Expand Down Expand Up @@ -168,22 +168,22 @@ object Dependencies {
}

const val androidFhirGroup = "com.google.android.fhir"
const val androidFhirCommon = "$androidFhirGroup:common:${Versions.androidFhirCommon}"
const val androidFhirEngineModule = "engine"
const val androidFhirKnowledgeModule = "knowledge"
const val androidFhirCommon = "$androidFhirGroup:common:${Versions.androidFhirCommon}"
const val androidFhirEngine =
"$androidFhirGroup:$androidFhirEngineModule:${Versions.androidFhirEngine}"
const val androidFhirKnowledge = "$androidFhirGroup:knowledge:${Versions.androidFhirKnowledge}"

const val lifecycleExtensions =
"androidx.lifecycle:lifecycle-extensions:${Versions.Androidx.lifecycle}"
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 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}"

const val jsonToolsPatch = "com.github.java-json-tools:json-patch:${Versions.jsonToolsPatch}"
const val kotlinPoet = "com.squareup:kotlinpoet:${Versions.kotlinPoet}"
const val material = "com.google.android.material:material:${Versions.material}"
const val sqlcipher = "net.zetetic:android-database-sqlcipher:${Versions.sqlcipher}"
const val timber = "com.jakewharton.timber:timber:${Versions.timber}"
Expand Down Expand Up @@ -213,35 +213,35 @@ object Dependencies {

const val androidBenchmarkRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner"
const val androidJunitRunner = "androidx.test.runner.AndroidJUnitRunner"

// Makes Json assertions where the order of elements, tabs/whitespaces are not important.
const val jsonAssert = "org.skyscreamer:jsonassert:${Versions.jsonAssert}"
const val junit = "junit:junit:${Versions.junit}"
const val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}"
const val mockitoInline = "org.mockito:mockito-inline:${Versions.mockitoInline}"
const val robolectric = "org.robolectric:robolectric:${Versions.robolectric}"
const val slf4j = "org.slf4j:slf4j-android:${Versions.slf4j}"
const val truth = "com.google.truth:truth:${Versions.truth}"

// Makes XML assertions where the order of elements, tabs/whitespaces are not important.
const val xmlUnit = "org.xmlunit:xmlunit-core:${Versions.xmlUnit}"

object Versions {
object Androidx {
const val activity = "1.2.1"
const val appCompat = "1.1.0"
const val constraintLayout = "2.1.1"
const val coreKtx = "1.2.0"
const val activity = "1.7.2"
const val appCompat = "1.6.1"
const val constraintLayout = "2.1.4"
const val coreKtx = "1.10.1"
const val datastorePref = "1.0.0"
const val fragmentKtx = "1.3.1"
const val lifecycle = "2.2.0"
const val navigation = "2.3.4"
const val recyclerView = "1.1.0"
const val room = "2.4.2"
const val sqliteKtx = "2.1.0"
const val workRuntimeKtx = "2.7.1"
const val fragmentKtx = "1.6.0"
const val lifecycle = "2.6.1"
const val navigation = "2.6.0"
const val recyclerView = "1.3.0"
const val room = "2.5.2"
const val sqliteKtx = "2.3.1"
const val workRuntimeKtx = "2.8.1"
}

object Cql {
const val antlr = "4.10.1"
const val engine = "2.4.0"
const val evaluator = "2.4.0"
const val translator = "2.4.0"
Expand All @@ -252,58 +252,60 @@ object Dependencies {
}

object Kotlin {
const val kotlinCoroutinesCore = "1.6.4"
const val stdlib = "1.6.10"
const val kotlinCoroutinesCore = "1.7.2"
const val stdlib = "1.8.20"
}

const val androidFhirCommon = "0.1.0-alpha03"
const val androidFhirEngine = "0.1.0-beta02"
const val desugarJdkLibs = "1.1.5"
const val androidFhirCommon = "0.1.0-alpha04"
const val androidFhirEngine = "0.1.0-beta03"
const val androidFhirKnowledge = "0.1.0-alpha01"
const val desugarJdkLibs = "2.0.3"
const val caffeine = "2.9.1"
const val fhirUcum = "1.0.3"
const val gson = "2.9.1"
const val guava = "28.2-android"

// Hapi FHIR and HL7 Core Components are interlinked.
// Newer versions of HapiFhir don't work on Android due to the use of Caffeine 3+
// Wait for this to release (6.3): https://github.com/hapifhir/hapi-fhir/pull/4196
const val hapiFhir = "6.0.1"

// Newer versions don't work on Android due to Apache Commons Codec:
// Wait for this fix: https://github.com/hapifhir/org.hl7.fhir.core/issues/1046
const val hapiFhirCore = "5.6.36"

const val http = "4.9.1"
const val jackson = "2.14.1"
const val http = "4.11.0"
// Maximum version that supports Android API Level 24:
// https://github.com/FasterXML/jackson-databind/issues/3658
const val jackson = "2.13.5"
const val jsonToolsPatch = "1.13"
const val jsonAssert = "1.5.1"
const val kotlinPoet = "1.9.0"
const val material = "1.6.0"
const val retrofit = "2.7.2"
const val slf4j = "1.7.36"
const val sqlcipher = "4.5.0"
const val material = "1.9.0"
const val retrofit = "2.9.0"
const val sqlcipher = "4.5.4"
const val timber = "5.0.1"
const val truth = "1.1.3"
const val woodstox = "6.2.7"
const val truth = "1.1.5"
const val woodstox = "6.5.1"
const val xerces = "2.12.2"
const val xmlUnit = "2.9.0"
const val xmlUnit = "2.9.1"

// Test dependencies

object AndroidxTest {
const val benchmarkJUnit = "1.1.1"
const val core = "1.4.0"
const val archCore = "2.1.0"
const val core = "1.5.0"
const val archCore = "2.2.0"
const val extJunit = "1.1.5"
const val rules = "1.4.0"
const val runner = "1.5.2"
const val fragmentVersion = "1.3.6"
const val rules = "1.5.0"
const val runner = "1.5.0"
const val fragmentVersion = "1.6.0"
}

const val espresso = "3.4.0"
const val jacoco = "0.8.7"
const val espresso = "3.5.1"
const val jacoco = "0.8.10"
const val junit = "4.13.2"
const val mockitoKotlin = "3.2.0"
const val mockitoInline = "4.0.0"
const val robolectric = "4.7.3"
const val robolectric = "4.10.3"

object Mlkit {
const val barcodeScanning = "16.1.1"
Expand All @@ -324,7 +326,6 @@ object Dependencies {
fun Configuration.forceHapiVersion() {
// Removes newer versions of caffeine and manually imports 2.9
// Removes newer versions of hapi and keeps on 6.0.1
// Removes newer versions of HL7 core and keeps it on 5.6.36
// (newer versions don't work on Android)
resolutionStrategy {
force(HapiFhir.caffeine)
Expand Down Expand Up @@ -352,4 +353,16 @@ object Dependencies {
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)
}
}
}
38 changes: 23 additions & 15 deletions buildSrc/src/main/kotlin/FirebaseTestLabConfig.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2023 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 @@ -21,14 +21,17 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure

@Suppress("SdCardPath")
fun Project.configureFirebaseTestLab() {
fun Project.configureFirebaseTestLabForLibraries() {
apply(plugin = Plugins.BuildPlugins.fladle)
configure<FlankGradleExtension> {
commonConfigurationForFirebaseTestLab(this@configureFirebaseTestLab)
commonConfigurationForFirebaseTestLab(this@configureFirebaseTestLabForLibraries)
instrumentationApk.set(project.provider { "$buildDir/outputs/apk/androidTest/debug/*.apk" })
environmentVariables.set(
mapOf("coverage" to "true", "coverageFile" to "/sdcard/Download/coverage.ec")
mapOf(
"coverage" to "true",
"coverageFilePath" to "/sdcard/Download/",
"clearPackageData" to "true"
)
)
flakyTestAttempts.set(3)
devices.set(
Expand All @@ -39,11 +42,9 @@ fun Project.configureFirebaseTestLab() {
"${project.extensions.getByType(LibraryExtension::class.java).defaultConfig.minSdk}",
"locale" to "en_US"
),
mapOf("model" to "Nexus6P", "version" to "27", "locale" to "en_US"),
mapOf(
"model" to "oriole",
"version" to
"${project.extensions.getByType(LibraryExtension::class.java).defaultConfig.targetSdk}",
"model" to "panther",
"version" to "${project.extensions.getByType(LibraryExtension::class.java).compileSdk}",
"locale" to "en_US"
),
)
Expand All @@ -57,14 +58,21 @@ fun Project.configureFirebaseTestLabForMicroBenchmark() {
commonConfigurationForFirebaseTestLab(this@configureFirebaseTestLabForMicroBenchmark)
instrumentationApk.set(project.provider { "$buildDir/outputs/apk/androidTest/release/*.apk" })
environmentVariables.set(
mapOf("additionalTestOutputDir" to "/sdcard/Download", "no-isolated-storage" to "true")
mapOf(
"additionalTestOutputDir" to "/sdcard/Download",
"no-isolated-storage" to "true",
"clearPackageData" to "true"
)
)
maxTestShards.set(4)
// some of the benchmark tests get timed-out in the default 15m
testTimeout.set("30m")
testTimeout.set("45m")
devices.set(
listOf(
mapOf("model" to "oriole", "version" to "32", "locale" to "en_US"),
mapOf(
"model" to "panther",
"version" to "${project.extensions.getByType(LibraryExtension::class.java).compileSdk}",
"locale" to "en_US"
),
)
)
}
Expand All @@ -77,9 +85,9 @@ private fun FlankGradleExtension.commonConfigurationForFirebaseTestLab(project:
"${project.rootDir}/demo/build/outputs/apk/androidTest/debug/demo-debug-androidTest.apk"
}
)
useOrchestrator.set(false)
useOrchestrator.set(true)
maxTestShards.set(20)
directoriesToPull.set(listOf("/sdcard/Download"))
filesToDownload.set(listOf(".*/sdcard/Download/.*.ec", ".*/sdcard/Download/.*.json"))
resultsBucket.set("android-fhir-build-artifacts")
resultsDir.set(
if (project.providers.environmentVariable("KOKORO_BUILD_ARTIFACTS_SUBDIR").isPresent) {
Expand Down
5 changes: 2 additions & 3 deletions buildSrc/src/main/kotlin/JacocoConfig.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2023 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 Down Expand Up @@ -48,7 +48,6 @@ fun Project.createJacocoTestReportTask() {
dependsOn(
setOf(
"testDebugUnitTest", // Generates unit test coverage report
"createDebugCoverageReport", // Generates instrumentation test coverage report
)
)
reports {
Expand Down Expand Up @@ -100,7 +99,7 @@ fun Project.createJacocoTestReportTask() {

/** Configures jacoco test options in the `LibraryExtension`. */
fun LibraryExtension.configureJacocoTestOptions() {
buildTypes { getByName("debug") { isTestCoverageEnabled = true } }
buildTypes { getByName("debug") { enableUnitTestCoverage = true } }
testOptions {
unitTests.isIncludeAndroidResources = true
unitTests.isReturnDefaultValues = true
Expand Down
11 changes: 5 additions & 6 deletions buildSrc/src/main/kotlin/Java.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2023 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 Down Expand Up @@ -32,8 +32,7 @@ import org.gradle.api.JavaVersion
* limitations under the License.
*/

object Java {
val sourceCompatibility = JavaVersion.VERSION_1_8
val targetCompatibility = JavaVersion.VERSION_1_8
val kotlinJvmTarget = JavaVersion.VERSION_1_8
}
/* Delete this file, and the sourceCompatibility and targetCompatibility blocks when we upgrade the
AGP to 8.1. See: https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
*/
val javaVersion = JavaVersion.VERSION_11
5 changes: 4 additions & 1 deletion buildSrc/src/main/kotlin/LicenseeConfig.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2023 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 Down Expand Up @@ -59,6 +59,9 @@ fun Project.configureLicensee() {
allowDependency("net.zetetic", "android-database-sqlcipher", "4.5.0") {
because("Custom license, essentially BSD-3. https://www.zetetic.net/sqlcipher/license/")
}
allowDependency("net.zetetic", "android-database-sqlcipher", "4.5.4") {
because("Custom license, essentially BSD-3. https://www.zetetic.net/sqlcipher/license/")
}

// Jakarta XML Binding API
allowDependency("jakarta.xml.bind", "jakarta.xml.bind-api", "2.3.3") {
Expand Down
Loading

0 comments on commit 1327fec

Please sign in to comment.