From 1e144f030c383f6c148ce7e82f516d1f411f0284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Thu, 4 Jul 2024 11:47:21 +0200 Subject: [PATCH 1/3] fix: bring back Java 8 compatibility --- app/build.gradle | 7 +++---- build.gradle | 2 +- maps-ktx/build.gradle | 6 +++--- maps-utils-ktx/build.gradle | 6 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1a95be94..3c48dbda 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,18 +43,17 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = "17" + jvmTarget = "1.8" } namespace 'com.google.maps.android.ktx.demo' } dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) implementation libs.kotlinStdlib implementation libs.androidxAppcompat implementation libs.androidxCoreKtx diff --git a/build.gradle b/build.gradle index eee40c00..a9bdb32b 100644 --- a/build.gradle +++ b/build.gradle @@ -91,7 +91,7 @@ subprojects { project -> // Code coverage jacoco { - toolVersion = "0.8.7" + toolVersion = "0.8.12" } diff --git a/maps-ktx/build.gradle b/maps-ktx/build.gradle index 36c12fcf..ff432ef3 100644 --- a/maps-ktx/build.gradle +++ b/maps-ktx/build.gradle @@ -29,13 +29,13 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { freeCompilerArgs += '-Xexplicit-api=strict' - jvmTarget = "17" + jvmTarget = "1.8" } buildFeatures { viewBinding true diff --git a/maps-utils-ktx/build.gradle b/maps-utils-ktx/build.gradle index ae23af90..e0ebf3c4 100644 --- a/maps-utils-ktx/build.gradle +++ b/maps-utils-ktx/build.gradle @@ -34,13 +34,13 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { freeCompilerArgs += '-Xexplicit-api=strict' - jvmTarget = "17" + jvmTarget = "1.8" } buildFeatures { viewBinding true From 3cad3a6281bb736d8b4e724914d004342202d1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Thu, 4 Jul 2024 11:47:31 +0200 Subject: [PATCH 2/3] build: Compile with latest JDK --- .github/workflows/docs.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b5766d48..a4e73b74 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,10 +31,10 @@ jobs: - name: Checkout android-maps-ktx uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '21' distribution: 'temurin' # Run dokka and create tar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0266bc09..5744831e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,10 +22,10 @@ jobs: release: runs-on: ubuntu-latest steps: - - name: Set up JDK 17 + - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '21' distribution: 'temurin' - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 06d5c154..f2d103eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,10 +37,10 @@ jobs: - name: Gradle Wrapper Validation uses: gradle/wrapper-validation-action@v3.4.2 - - name: Set up JDK 17 + - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '21' distribution: 'temurin' - name: Build modules From a83c21ebdd575275c13776b29125c8fe40477aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Thu, 4 Jul 2024 14:43:20 +0200 Subject: [PATCH 3/3] build: Suppress deprecated target version warning on Java 21 --- gradle.properties | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0f5da65f..b15ad6bb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,4 +31,7 @@ sonatypeTokenPassword= # Migration to AGP 8.2.1 android.nonTransitiveRClass=false -android.nonFinalResIds=false \ No newline at end of file +android.nonFinalResIds=false + +# Despite being deprecated, targeting lowest java version is needed to support old Android runtime +android.javaCompile.suppressSourceTargetDeprecationWarning=true