Skip to content

Conversation

@wmontwe
Copy link
Member

@wmontwe wmontwe commented Oct 21, 2025

Resolves #9582

@wmontwe wmontwe requested a review from a team as a code owner October 21, 2025 08:21
@wmontwe wmontwe requested a review from rafaeltonholo October 21, 2025 08:21
@wmontwe wmontwe marked this pull request as draft October 21, 2025 09:04
@wmontwe
Copy link
Member Author

wmontwe commented Oct 21, 2025

There is an issue with Gradle 9.1 and AGP adding resources to test classes dir: AGP causing deprecation warnings in Gradle for JVM test tasks (411739086) Which fails the tests if module has not tests.

@rafaeltonholo
Copy link
Member

There is an issue with Gradle 9.1 and AGP adding resources to test classes dir: AGP causing deprecation warnings in Gradle for JVM test tasks (411739086) Which fails the tests if module has not tests.

The issue is marked as fixed, but it seems like only on AGP 9. Until we can upgrade to the latest AGP, we may need to implement the workaround listed in the issue tracker:

Index: build-plugin/src/main/kotlin/thunderbird.library.android.gradle.kts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build-plugin/src/main/kotlin/thunderbird.library.android.gradle.kts b/build-plugin/src/main/kotlin/thunderbird.library.android.gradle.kts
--- a/build-plugin/src/main/kotlin/thunderbird.library.android.gradle.kts	(revision c81beb1c5592d89471599f183160f159a711497b)
+++ b/build-plugin/src/main/kotlin/thunderbird.library.android.gradle.kts	(date 1761045595263)
@@ -18,7 +18,7 @@
 
     testOptions {
         unitTests {
-            isIncludeAndroidResources = true
+            isIncludeAndroidResources = project.layout.projectDirectory.dir("src/test").asFile.exists()
         }
     }
 }
Index: build-plugin/src/main/kotlin/thunderbird.library.android.compose.gradle.kts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build-plugin/src/main/kotlin/thunderbird.library.android.compose.gradle.kts b/build-plugin/src/main/kotlin/thunderbird.library.android.compose.gradle.kts
--- a/build-plugin/src/main/kotlin/thunderbird.library.android.compose.gradle.kts	(revision c81beb1c5592d89471599f183160f159a711497b)
+++ b/build-plugin/src/main/kotlin/thunderbird.library.android.compose.gradle.kts	(date 1761045595258)
@@ -8,6 +8,11 @@
 
 android {
     configureSharedComposeConfig(libs)
+    testOptions {
+        unitTests {
+            isIncludeAndroidResources = project.layout.projectDirectory.dir("src/test").asFile.exists()
+        }
+    }
 }
 
 androidComponents {
Index: build-plugin/src/main/kotlin/AndroidExtension.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build-plugin/src/main/kotlin/AndroidExtension.kt b/build-plugin/src/main/kotlin/AndroidExtension.kt
--- a/build-plugin/src/main/kotlin/AndroidExtension.kt	(revision c81beb1c5592d89471599f183160f159a711497b)
+++ b/build-plugin/src/main/kotlin/AndroidExtension.kt	(date 1761045204466)
@@ -30,7 +30,7 @@
 
     testOptions {
         unitTests {
-            isIncludeAndroidResources = true
+            isIncludeAndroidResources = project.layout.projectDirectory.dir("src/test").asFile.exists()
         }
     }

@wmontwe
Copy link
Member Author

wmontwe commented Oct 21, 2025

I changed the setup to only enable isIncludeAndroidResources where needed.

@wmontwe wmontwe marked this pull request as ready for review October 21, 2025 12:28
Copy link
Member

@rafaeltonholo rafaeltonholo left a comment

Choose a reason for hiding this comment

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

LGTM

@rafaeltonholo rafaeltonholo merged commit 4c4025f into thunderbird:main Oct 21, 2025
13 checks passed
@thunderbird-botmobile thunderbird-botmobile bot added this to the Thunderbird 15 milestone Oct 21, 2025
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.

Upgrade Gradle to 9.1

2 participants