Skip to content

Commit

Permalink
Update gradle to 8.8 and AGP to 8.5.0 (#2575)
Browse files Browse the repository at this point in the history
* Update gradle to 8.6 and AGP to 8.4.1

* Update AGP to 8.5.0

* Gradle to 8.8

* Upgrade gradle build tool to 8.5.0

* Update min sdk version to 26

* Fix equality in DiffUtil

* Update test sdk version in MoreLocalDatesTest.kt

* Run spotless

* Update min sdk for MoreLocalDateTimesTest.kt

* Update codelab min sdk version

* Spotless

* Update MoreLocalTimesTest.kt

* Update build.gradle.kts

* Update build.gradle.kts

* Add desugaring to contrib barcode

* Add desugaring to contrib location widget

* Add desugaring to engine benchmark

* Add desugaring to workflow benchmark
  • Loading branch information
jingtang10 authored Jul 11, 2024
1 parent 13c8194 commit a36e7a6
Show file tree
Hide file tree
Showing 22 changed files with 76 additions and 43 deletions.
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.22.0")

implementation("com.android.tools.build:gradle:8.1.4")
implementation("com.android.tools.build:gradle:8.5.0")

implementation("app.cash.licensee:licensee-gradle-plugin:1.8.0")
implementation("com.osacky.flank.gradle:fladle:0.17.4")
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Plugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object Plugins {
"com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:${Versions.kspPlugin}"

object Versions {
const val androidGradlePlugin = "8.0.2"
const val androidGradlePlugin = "8.5.0"
const val benchmarkPlugin = "1.1.0"
const val dokka = "1.9.20"
const val kspPlugin = "1.9.22-1.0.18"
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/Sdk.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,10 +15,10 @@
*/

object Sdk {
const val compileSdk = 33
const val targetSdk = 31
const val COMPILE_SDK = 33
const val TARGET_SDK = 31

// Engine and SDC must support API 24.
// Remove desugaring when upgrading it to 26.
const val minSdk = 24
const val MIN_SDK = 26
}
6 changes: 3 additions & 3 deletions catalog/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ configureRuler()

android {
namespace = "com.google.android.fhir.catalog"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
applicationId = Releases.Catalog.applicationId
minSdk = Sdk.minSdk
targetSdk = Sdk.targetSdk
minSdk = Sdk.MIN_SDK
targetSdk = Sdk.TARGET_SDK
versionCode = Releases.Catalog.versionCode
versionName = Releases.Catalog.versionName
testInstrumentationRunner = Dependencies.androidJunitRunner
Expand Down
2 changes: 1 addition & 1 deletion codelabs/datacapture/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {

defaultConfig {
applicationId = "com.google.android.fhir.codelabs.datacapture"
minSdk = 24
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion codelabs/engine/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {

defaultConfig {
applicationId = "com.google.android.fhir.codelabs.engine"
minSdk = 24
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ createJacocoTestReportTask()

android {
namespace = "com.google.android.fhir.common"
compileSdk = Sdk.compileSdk
defaultConfig { minSdk = Sdk.minSdk }
compileSdk = Sdk.COMPILE_SDK
defaultConfig { minSdk = Sdk.MIN_SDK }
configureJacocoTestOptions()
kotlin { jvmToolchain(11) }
}
Expand Down
12 changes: 10 additions & 2 deletions contrib/barcode/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ createJacocoTestReportTask()

android {
namespace = "com.google.android.fhir.datacapture.contrib.views.barcode"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
minSdk = Sdk.minSdk
minSdk = Sdk.MIN_SDK
testInstrumentationRunner = Dependencies.androidJunitRunner
// Need to specify this to prevent junit runner from going deep into our dependencies
testInstrumentationRunnerArguments["package"] = "com.google.android.fhir.datacapture"
Expand All @@ -29,6 +29,12 @@ android {
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
}
}
compileOptions {
// Flag to enable support for the new language APIs
// See https://developer.android.com/studio/write/java8-support
isCoreLibraryDesugaringEnabled = true
}

packaging {
resources.excludes.addAll(
listOf(
Expand Down Expand Up @@ -58,6 +64,8 @@ dependencies {
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.truth)

coreLibraryDesugaring(Dependencies.desugarJdkLibs)

implementation(project(":datacapture"))
implementation(Dependencies.Mlkit.barcodeScanning)
implementation(Dependencies.Mlkit.objectDetection)
Expand Down
11 changes: 9 additions & 2 deletions contrib/locationwidget/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ createJacocoTestReportTask()

android {
namespace = "com.google.android.fhir.datacapture.contrib.views.locationwidget"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
minSdk = Sdk.minSdk
minSdk = Sdk.MIN_SDK
testInstrumentationRunner = Dependencies.androidJunitRunner
// Need to specify this to prevent junit runner from going deep into our dependencies
testInstrumentationRunnerArguments["package"] = "com.google.android.fhir.datacapture"
Expand All @@ -29,6 +29,11 @@ android {
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
}
}
compileOptions {
// Flag to enable support for the new language APIs
// See https://developer.android.com/studio/write/java8-support
isCoreLibraryDesugaringEnabled = true
}

packaging {
resources.excludes.addAll(
Expand Down Expand Up @@ -67,6 +72,8 @@ dependencies {
implementation(libs.androidx.fragment)
implementation(libs.kotlinx.coroutines.playservices)

coreLibraryDesugaring(Dependencies.desugarJdkLibs)

testImplementation(Dependencies.robolectric)
testImplementation(libs.androidx.fragment.testing)
testImplementation(libs.junit)
Expand Down
4 changes: 2 additions & 2 deletions datacapture/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ createJacocoTestReportTask()

android {
namespace = "com.google.android.fhir.datacapture"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
minSdk = Sdk.minSdk
minSdk = Sdk.MIN_SDK
testInstrumentationRunner = Dependencies.androidJunitRunner
// Need to specify this to prevent junit runner from going deep into our dependencies
testInstrumentationRunnerArguments["package"] = "com.google.android.fhir.datacapture"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2022-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 Down Expand Up @@ -29,7 +29,7 @@ import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config

@RunWith(RobolectricTestRunner::class)
@Config(sdk = [Build.VERSION_CODES.N])
@Config(sdk = [Build.VERSION_CODES.O])
class MoreLocalDateTimesTest {
@Test
fun localizedString_US() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022-2023 Google LLC
* Copyright 2022-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 Down Expand Up @@ -28,7 +28,7 @@ import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config

@RunWith(RobolectricTestRunner::class)
@Config(sdk = [Build.VERSION_CODES.N])
@Config(sdk = [Build.VERSION_CODES.O])
class MoreLocalDatesTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2022-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 Down Expand Up @@ -28,7 +28,7 @@ import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config

@RunWith(RobolectricTestRunner::class)
@Config(sdk = [Build.VERSION_CODES.N])
@Config(sdk = [Build.VERSION_CODES.O])
class MoreLocalTimesTest {

@Before
Expand Down
6 changes: 3 additions & 3 deletions demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ configureRuler()

android {
namespace = "com.google.android.fhir.demo"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
applicationId = Releases.Demo.applicationId
minSdk = Sdk.minSdk
targetSdk = Sdk.targetSdk
minSdk = Sdk.MIN_SDK
targetSdk = Sdk.TARGET_SDK
versionCode = Releases.Demo.versionCode
versionName = Releases.Demo.versionName
testInstrumentationRunner = Dependencies.androidJunitRunner
Expand Down
4 changes: 2 additions & 2 deletions document/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ plugins {

android {
namespace = "com.google.android.fhir.document"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK

defaultConfig {
minSdk = Sdk.minSdk
minSdk = Sdk.MIN_SDK
testInstrumentationRunner = Dependencies.androidJunitRunner
consumerProguardFiles("consumer-rules.pro")
}
Expand Down
13 changes: 11 additions & 2 deletions engine/benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ plugins {

android {
namespace = "com.google.android.fhir.benchmark"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
minSdk = Sdk.minSdk
minSdk = Sdk.MIN_SDK
testInstrumentationRunner = Dependencies.androidBenchmarkRunner
}

Expand Down Expand Up @@ -38,6 +38,13 @@ android {
),
)
}

compileOptions {
// Flag to enable support for the new language APIs
// See https = //developer.android.com/studio/write/java8-support
isCoreLibraryDesugaringEnabled = true
}

kotlin { jvmToolchain(11) }
}

Expand All @@ -58,4 +65,6 @@ dependencies {
androidTestImplementation(project(":engine"))
// for test json files only
androidTestImplementation(project(":workflow-testing"))

coreLibraryDesugaring(Dependencies.desugarJdkLibs)
}
4 changes: 2 additions & 2 deletions engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ kotlin {

android {
namespace = "com.google.android.fhir"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
minSdk = Sdk.minSdk
minSdk = Sdk.MIN_SDK
testInstrumentationRunner = Dependencies.androidJunitRunner
// need to specify this to prevent junit runner from going deep into our dependencies
testInstrumentationRunnerArguments["package"] = "com.google.android.fhir"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions knowledge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ createJacocoTestReportTask()

android {
namespace = "com.google.android.fhir.knowledge"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
minSdk = Sdk.minSdk
minSdk = Sdk.MIN_SDK
testInstrumentationRunner = Dependencies.androidJunitRunner
// Need to specify this to prevent junit runner from going deep into our dependencies
testInstrumentationRunnerArguments["package"] = "com.google.android.fhir.knowledge"
Expand Down
4 changes: 2 additions & 2 deletions workflow-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {

android {
namespace = "com.google.android.fhir.workflow.testing"
compileSdk = Sdk.compileSdk
defaultConfig { minSdk = Sdk.minSdk }
compileSdk = Sdk.COMPILE_SDK
defaultConfig { minSdk = Sdk.MIN_SDK }
kotlin { jvmToolchain(11) }
}

Expand Down
13 changes: 11 additions & 2 deletions workflow/benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ plugins {

android {
namespace = "com.google.android.fhir.workflow.benchmark"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
minSdk = Sdk.minSdk
minSdk = Sdk.MIN_SDK
testInstrumentationRunner = Dependencies.androidBenchmarkRunner
}

Expand Down Expand Up @@ -40,6 +40,13 @@ android {
),
)
}

compileOptions {
// Flag to enable support for the new language APIs
// See https = //developer.android.com/studio/write/java8-support
isCoreLibraryDesugaringEnabled = true
}

kotlin { jvmToolchain(11) }
}

Expand Down Expand Up @@ -69,6 +76,8 @@ dependencies {
}
androidTestImplementation(project(":workflow-testing"))

coreLibraryDesugaring(Dependencies.desugarJdkLibs)

constraints {
Dependencies.hapiFhirConstraints().forEach { (libName, constraints) ->
androidTestImplementation(libName, constraints)
Expand Down
4 changes: 2 additions & 2 deletions workflow/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ createJacocoTestReportTask()

android {
namespace = "com.google.android.fhir.workflow"
compileSdk = Sdk.compileSdk
compileSdk = Sdk.COMPILE_SDK
defaultConfig {
minSdk = Sdk.minSdk
minSdk = Sdk.MIN_SDK
testInstrumentationRunner = Dependencies.androidJunitRunner
// Need to specify this to prevent junit runner from going deep into our dependencies
testInstrumentationRunnerArguments["package"] = "com.google.android.fhir.workflow"
Expand Down

0 comments on commit a36e7a6

Please sign in to comment.