Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fd371c0
ci(agp-matrix): Generate compatibility matrix dynamically
romtsn Apr 29, 2025
a78c757
fix script filename
romtsn Apr 29, 2025
21c1a20
WIP
romtsn Apr 29, 2025
9480fb1
WIP
romtsn Apr 29, 2025
1de2b3d
WIP
romtsn Apr 29, 2025
329b1de
WIP
romtsn Apr 29, 2025
8b1e591
WIP
romtsn Apr 29, 2025
8d508ba
WIP
romtsn Apr 29, 2025
bc63a3e
WIP
romtsn Apr 29, 2025
979027a
WIP
romtsn Apr 29, 2025
f4efcb9
WIP
romtsn Apr 29, 2025
f1657b1
WIP
romtsn Apr 29, 2025
de161f2
WIP
romtsn Apr 29, 2025
948f478
WIP
romtsn Apr 29, 2025
71223b8
WIP
romtsn Apr 29, 2025
53471fd
WIP
romtsn Apr 29, 2025
a82cc46
WIP
romtsn Apr 29, 2025
6e7c4a0
Works?
romtsn Apr 29, 2025
4499ad1
Change name
romtsn Apr 29, 2025
7e88c31
Switch to ksp for room
romtsn Apr 30, 2025
701e1c0
Override version check for tests
romtsn Apr 30, 2025
a955abd
Merge branch 'main' into rz/ci/generate-compat-matrix
romtsn May 15, 2025
e353f6c
Merge branch 'main' into rz/ci/generate-compat-matrix
romtsn Jun 24, 2025
9c12688
Merge branch 'main' into rz/ci/generate-compat-matrix
romtsn Jun 24, 2025
4ac83d0
also fetch kotlin-gradle compatibility and use the min supported grad…
romtsn Jun 25, 2025
f712f1e
Matrix only last line of the script output
romtsn Jun 25, 2025
d693476
Changelog
romtsn Jun 25, 2025
a11cf74
Run test matrix nightly
romtsn Jun 25, 2025
acc1dac
Minor comments
romtsn Jun 25, 2025
9bbf39c
Update .github/workflows/test-matrix-agp-gradle.yaml
romtsn Jun 25, 2025
03f58ef
Update scripts/generate-compat-matrix.main.kts
romtsn Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 33 additions & 31 deletions .github/workflows/test-matrix-agp-gradle.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Test Matrix

on:
schedule:
- cron: '0 4 * * *'
push:
branches:
- main
Expand All @@ -11,42 +13,42 @@ concurrency:
cancel-in-progress: true

jobs:
generate-matrix:
name: Generate Compat Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Generate Compat Matrix
id: generate
run: |
# Run the script and capture full output for debugging
full_output=$(kotlin scripts/generate-compat-matrix.main.kts)

# Show the full output for debugging
echo "Full script output:"
echo "$full_output"

# Extract only the last line (the JSON matrix)
matrix=$(echo "$full_output" | tail -n 1)

echo "matrix<<EOF" >> "$GITHUB_OUTPUT"
echo "$matrix" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"

echo "Parsed matrix:"
echo "$matrix" | jq

publish-dry-run:
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
agp: [ "7.4.0" ]
gradle: [ "7.6.4" ]
java: [ "11" ]
groovy: [ "1.2" ]
include:
- agp: "7.4.0"
gradle: "7.6.4"
java: "11"
groovy: "1.2"
- agp: "8.0.0"
gradle: "8.0.2"
java: "17"
groovy: "1.2"
- agp: "8.6.1"
gradle: "8.7"
java: "17"
groovy: "1.2"
- agp: "8.8.1"
gradle: "8.14.1"
java: "17"
groovy: "1.7.1"
- agp: "8.9.0"
gradle: "8.14.1"
java: "17"
groovy: "1.7.1"
- agp: "8.10.0"
gradle: "8.14.1"
java: "17"
groovy: "1.7.1"
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}

name: Test Matrix - AGP ${{ matrix.agp }} - Gradle ${{ matrix.gradle }}
name: Test Matrix - AGP ${{ matrix.agp }} - Gradle ${{ matrix.gradle }} - Java ${{ matrix.java }} - Groovy ${{ matrix.groovy }}
env:
VERSION_AGP: ${{ matrix.agp }}
VERSION_GROOVY: ${{ matrix.groovy }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
### Internal

- Add Google Truth for easier to debug assertions in tests ([#920](https://github.com/getsentry/sentry-android-gradle-plugin/pull/920))
- Generate AGP/Gradle compatibility matrix dynamically ([#873](https://github.com/getsentry/sentry-android-gradle-plugin/pull/873))

### Dependencies

Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.kapt) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.androidApplication) version BuildPluginsVersion.AGP apply false
alias(libs.plugins.androidLibrary) version BuildPluginsVersion.AGP apply false
alias(libs.plugins.spotless)
Expand Down
5 changes: 2 additions & 3 deletions examples/android-instrumentation-sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
alias(libs.plugins.androidApplication) version BuildPluginsVersion.AGP
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kapt)
alias(libs.plugins.ksp)
id("io.sentry.android.gradle")
}

Expand Down Expand Up @@ -86,13 +86,12 @@ dependencies {

implementation(libs.sample.room.runtime)
implementation(libs.sample.room.ktx)
implementation(libs.sample.room.rxjava)

implementation(libs.sample.timber.timber)
implementation(project(":examples:android-room-lib"))
implementation(libs.sample.fragment.fragmentKtx)

kapt(libs.sample.room.compiler)
ksp(libs.sample.room.compiler)
}

sentry {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ android.useAndroidX=true

# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# For AGP matrix tests, we can't infer the correct Gradle version for pre-releases
android.overrideVersionCheck=true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What exactly does this do? It seems to me that it checks that the running Gradle version is compatible with AGP version?

Why do we need this in the parent build? Is it just while we are running the entire build with different versions of Gradle?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is it just while we are running the entire build with different versions of Gradle?

yep that's the reason! Was failing here without that flag: https://github.com/getsentry/sentry-android-gradle-plugin/actions/runs/14733865730/job/41354917196?pr=873

2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlinSpring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we still need kapt?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yep, it's used in the compiler plugin for AutoService

ksp = { id = "com.google.devtools.ksp", version = "1.8.20-1.0.11" }
dokka = { id = "org.jetbrains.dokka", version = "1.8.10" }
spotless = { id = "com.diffplug.spotless", version = "7.0.4" }
groovyGradlePlugin = { id = "dev.gradleplugins.groovy-gradle-plugin", version = "1.7.1" }
Expand Down Expand Up @@ -77,7 +78,6 @@ sample-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-c
sample-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "sampleRoom" }
sample-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "sampleRoom" }
sample-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "sampleRoom" }
sample-room-rxjava = { group = "androidx.room", name = "room-rxjava2", version.ref = "sampleRoom" }

sample-retrofit-retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "sampleRetrofit" }
sample-retrofit-retrofitGson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "sampleRetrofit" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ org.gradle.daemon=false
org.gradle.parallel=true

android.useAndroidX=true
# For AGP matrix tests, we can't infer the correct Gradle version for pre-releases
android.overrideVersionCheck=true
Loading
Loading