diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51822f08d..b309e1832 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,17 @@ jobs: # made JDK-specific by their compile targets: # logback-android -> Java 11 bytecode, minSdk 26 # logback-android-jdk8 -> Java 8 bytecode, minSdk 21 - java: [17, 21] + # + # agp: the Android Gradle Plugin version to build with (overrides the + # gradle.properties default). AGP 9.3.0+ lint requires JDK 21, so JDK 17 + # stays on 9.2.1 while JDK 21 exercises the newer plugin. + include: + - java: 17 + agp: '9.2.1' + - java: 21 + agp: '9.3.0' + env: + ORG_GRADLE_PROJECT_agpVersion: ${{ matrix.agp }} steps: - name: Checkout uses: actions/checkout@v7 diff --git a/build.gradle b/build.gradle index 9bba5458b..557700791 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:9.2.1' + classpath "com.android.tools.build:gradle:${agpVersion}" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle.properties b/gradle.properties index 28a1db2d8..f08f9d6c9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,6 +13,12 @@ VERSION_CODE=3020000 slf4jVersion=2.0.7 +# Android Gradle Plugin version. Defaults to 9.2.1, which still builds under +# JDK 17. CI overrides this to a newer AGP only on the JDK 21 matrix leg (see +# ORG_GRADLE_PROJECT_agpVersion in .github/workflows/build.yml): AGP 9.3.0+ +# lint requires JDK 21 (it calls java.util.List.removeLast(), a JDK 21 API). +agpVersion=9.2.1 + # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Ensure important default jvmargs aren't overwritten. See https://github.com/gradle/gradle/issues/19750