[tool] Add initial gradle validation command (#3715)

Adds a repo tool command to validate that all plugins set an explicit Java compatibility version, instead of using whatever the local toolchain happens to be (which creates the potential for issues like https://github.com/flutter/flutter/issues/124839 where our CI passes but builds fail for some clients because our default is newer than theirs).

Currently that's all it checks, but we can add any other gradle best practices we want to enforce here in the future.

This also enables the new check in CI, and fixes all the violations it found.

Fixes https://github.com/flutter/flutter/issues/124839
This commit is contained in:
stuartmorgan
2023-04-17 09:35:22 -07:00
committed by GitHub
parent 0277f2ad9d
commit a4ced6bd36
19 changed files with 362 additions and 6 deletions

View File

@ -19,6 +19,7 @@ import 'federation_safety_check_command.dart';
import 'firebase_test_lab_command.dart';
import 'fix_command.dart';
import 'format_command.dart';
import 'gradle_check_command.dart';
import 'license_check_command.dart';
import 'lint_android_command.dart';
import 'list_command.dart';
@ -66,6 +67,7 @@ void main(List<String> args) {
..addCommand(FirebaseTestLabCommand(packagesDir))
..addCommand(FixCommand(packagesDir))
..addCommand(FormatCommand(packagesDir))
..addCommand(GradleCheckCommand(packagesDir))
..addCommand(LicenseCheckCommand(packagesDir))
..addCommand(LintAndroidCommand(packagesDir))
..addCommand(PodspecCheckCommand(packagesDir))