Skip to content

Commit d00aa3b

Browse files
authored
[various] Allow plugin example apps to build and test on JDK 25 (#13031)
Update plugin example apps such that they can successfully build on JDK 25. Also ensure that tests can pass on JDK 25. - Update mockito to 5.23.0 a version compatible with JDK 25 - JDK 25's compiler added a `dangling-doc-comments` is a javac lint check that was new in JDK 23 ([JDK-8303689](https://bugs.openjdk.org/browse/JDK-8303689)) that warns when a Javadoc comment isnt attached to class, method, or field. These warnings appears in AGP generated classes, so we cannot directly address them. Instead, we can turn these warnings off and [file an issue against AGP](http://b/567587949). Fixes flutter/flutter#190069 Partially Addresses flutter/flutter#193404 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 738f6e5 commit d00aa3b

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎packages/camera/camera_android/example/android/build.gradle.kts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ gradle.projectsEvaluated {
4040
project(":camera_android") {
4141
tasks.withType<JavaCompile> {
4242
options.compilerArgs.addAll(listOf("-Xlint:all", "-Werror"))
43+
// javac 23+ adds the dangling-doc-comments lint, which flags the header
44+
// comment of the AGP-generated BuildConfig.java. See b/567587949 for more
45+
// details.
46+
if (JavaVersion.current() >= JavaVersion.VERSION_23) {
47+
options.compilerArgs.add("-Xlint:-dangling-doc-comments")
48+
}
4349
}
4450
}
4551
}

‎packages/in_app_purchase/in_app_purchase_android/example/android/build.gradle.kts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ gradle.projectsEvaluated {
4040
project(":in_app_purchase_android") {
4141
tasks.withType<JavaCompile> {
4242
options.compilerArgs.addAll(listOf("-Xlint:all", "-Werror"))
43+
// javac 23+ adds the dangling-doc-comments lint, which flags the header
44+
// comment of the AGP-generated BuildConfig.java. See b/567587949 for more
45+
// details.
46+
if (JavaVersion.current() >= JavaVersion.VERSION_23) {
47+
options.compilerArgs.add("-Xlint:-dangling-doc-comments")
48+
}
4349
}
4450
}
4551
}

‎packages/url_launcher/url_launcher_android/example/android/build.gradle.kts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ gradle.projectsEvaluated {
4040
project(":url_launcher_android") {
4141
tasks.withType<JavaCompile> {
4242
options.compilerArgs.addAll(listOf("-Xlint:all", "-Werror"))
43+
// javac 23+ adds the dangling-doc-comments lint, which flags the header
44+
// comment of the AGP-generated BuildConfig.java. See b/567587949 for more
45+
// details.
46+
if (JavaVersion.current() >= JavaVersion.VERSION_23) {
47+
options.compilerArgs.add("-Xlint:-dangling-doc-comments")
48+
}
4349
}
4450
}
4551
}

‎packages/video_player/video_player_android/example/android/app/build.gradle.kts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies {
4646
testImplementation("com.google.truth:truth:1.1.3")
4747
testImplementation("junit:junit:4.13")
4848
testImplementation("org.robolectric:robolectric:4.16")
49-
testImplementation("org.mockito:mockito-core:5.17.0")
49+
testImplementation("org.mockito:mockito-core:5.23.0")
5050
androidTestImplementation("androidx.test:runner:1.1.1")
5151
androidTestImplementation("androidx.test.espresso:espresso-core:3.1.1")
5252
implementation(project(":espresso"))

0 commit comments

Comments
 (0)