Skip to content

fix(matrix): Fetch AGP<->Gradle compat from Android Studio source#1165

Merged
markushi merged 2 commits intomainfrom
rz/fix/agp-compat-table-source
Apr 23, 2026
Merged

fix(matrix): Fetch AGP<->Gradle compat from Android Studio source#1165
markushi merged 2 commits intomainfrom
rz/fix/agp-compat-table-source

Conversation

@romtsn
Copy link
Copy Markdown
Member

@romtsn romtsn commented Apr 23, 2026

Switch the CI matrix generator from scraping developer.android.com to pulling the AGP↔Gradle compatibility mapping directly from Android Studio's CompatibleGradleVersion.kt.

Google's public compatibility page lags behind actual AGP releases, which meant fetchAgpCompatibilityTable kept falling through to the release-notes fallback for new versions. CompatibleGradleVersion.kt is the source of truth the IDE itself uses, so it tracks new AGP minors immediately.

The file is fetched raw via gitiles ?format=TEXT (base64 decode) and parsed with regex for the enum declarations and AGP_MAJOR_MINOR_TO_GRADLE_MAP. VERSION_FOR_DEV is resolved separately by fetching SdkConstants.GRADLE_LATEST_VERSION from the sibling tools/base repo, so bleeding-edge AGP pre-releases pick up the correct milestone Gradle.

fetchGradleVersionFromReleaseNotes stays in place as a fallback in case a brand-new AGP version shows up before the Android Studio mirror updates.

Verified locally:

  • AGP 9.3.0-alpha01 → Gradle 9.5.0-milestone-7 (from GRADLE_LATEST_VERSION)
  • AGP 9.2.0 / 9.2.0-rc01 → Gradle 9.4.1
  • AGP 8.13.2 → Gradle 8.13

#skip-changelog

The developer.android.com compatibility page Google publishes is not
always kept up-to-date, and relying on it meant our CI matrix fell
back to release-notes scraping for newly released AGP versions. Pull
the mapping directly from Android Studio's CompatibleGradleVersion.kt
(the source of truth) and resolve VERSION_FOR_DEV via
SdkConstants.GRADLE_LATEST_VERSION so bleeding-edge AGP pre-releases
pick up the right Gradle version.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@runningcode runningcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread scripts/generate-compat-matrix.main.kts
@markushi markushi merged commit 8b6bf9e into main Apr 23, 2026
19 of 21 checks passed
@markushi markushi deleted the rz/fix/agp-compat-table-source branch April 23, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants