Reverts "Enforce a policy on supported Gradle, Java, AGP, and KGP versions" (#143114)

Reverts flutter/flutter#142000

Initiated by: vashworth

Reason for reverting: Causing `Mac_pixel_7pro run_release_test` and `Mac_arm64_android run_debug_test_android` to fail: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_pixel_7pro%20run_release_test/539/overview
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64_android%20run_debug_test_android/6682/overview

Original PR Author: gmackall

Reviewed By: {reidbaker, camsim99, bartekpacia}

This change reverts the following previous change:
Original Description:
Policy per https://flutter.dev/go/android-dependency-versions.

https://github.com/flutter/flutter/issues/140913

~Still a WIP while I clean up some error handling, remove some prints, and figure out a Java test (more difficult than the others because I believe we can only install one java version per ci shard).~

~Also it looks like there are errors that I need to fix when this checking is applied to a project that uses the old way of applying AGP/KGP using the top-level `build.gradle` file (instead of the new template way of applying them in the `settings.gradle` file).~ Done, this is why [these lines exist](9af6bae6b9/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy (L72-L88)) in `flutter.groovy`. They just needed to be added
This commit is contained in:
auto-submit[bot]
2024-02-07 21:22:26 +00:00
committed by GitHub
parent 337bc79b0c
commit d60643e82f
8 changed files with 3 additions and 586 deletions

View File

@@ -29,11 +29,6 @@ version.
SDK versions are updated (you should see these fail if you do not fix them
preemptively).
Also, make sure to also update to the same version in the following places:
- The version in the buildscript block in `packages/flutter_tools/gradle/src/main/groovy/flutter.groovy`.
- The version in the buildscript block in `packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts`.
- The version in the dependencies block in `packages/flutter_tools/gradle/build.gradle.kts`.
#### Gradle
When updating the Gradle version used in project templates
(`templateDefaultGradleVersion`), make sure that:

View File

@@ -370,9 +370,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
if (!buildInfo.androidGradleDaemon) {
command.add('--no-daemon');
}
if (buildInfo.androidSkipBuildDependencyValidation) {
command.add('-PskipDependencyChecks=true');
}
final LocalEngineInfo? localEngineInfo = _artifacts.localEngineInfo;
if (localEngineInfo != null) {
final Directory localEngineRepo = _getLocalEngineRepo(

View File

@@ -41,7 +41,6 @@ class BuildInfo {
this.nullSafetyMode = NullSafetyMode.sound,
this.codeSizeDirectory,
this.androidGradleDaemon = true,
this.androidSkipBuildDependencyValidation = false,
this.packageConfig = PackageConfig.empty,
this.initializeFromDill,
this.assumeInitializeFromDillUpToDate = false,
@@ -154,10 +153,6 @@ class BuildInfo {
/// The Gradle daemon may also be disabled in the Android application's properties file.
final bool androidGradleDaemon;
/// Whether to skip checking of individual versions of our Android build time
/// dependencies.
final bool androidSkipBuildDependencyValidation;
/// Additional key value pairs that are passed directly to the gradle project via the `-P`
/// flag.
final List<String> androidProjectArgs;

View File

@@ -147,7 +147,6 @@ abstract final class FlutterOptions {
static const String kAndroidGradleDaemon = 'android-gradle-daemon';
static const String kDeferredComponents = 'deferred-components';
static const String kAndroidProjectArgs = 'android-project-arg';
static const String kAndroidSkipBuildDependencyValidation = 'android-skip-build-dependency-validation';
static const String kInitializeFromDill = 'initialize-from-dill';
static const String kAssumeInitializeFromDillUpToDate = 'assume-initialize-from-dill-up-to-date';
static const String kNativeAssetsYamlFile = 'native-assets-yaml-file';
@@ -975,12 +974,6 @@ abstract class FlutterCommand extends Command<void> {
defaultsTo: true,
hide: hide,
);
argParser.addFlag(
FlutterOptions.kAndroidSkipBuildDependencyValidation,
help: 'Whether to skip version checking for Java, Gradle, '
'the Android Gradle Plugin (AGP), and the Kotlin Gradle Plugin (KGP)'
' during Android builds.',
);
argParser.addMultiOption(
FlutterOptions.kAndroidProjectArgs,
help: 'Additional arguments specified as key=value that are passed directly to the gradle '
@@ -1235,9 +1228,6 @@ abstract class FlutterCommand extends Command<void> {
final bool androidGradleDaemon = !argParser.options.containsKey(FlutterOptions.kAndroidGradleDaemon)
|| boolArg(FlutterOptions.kAndroidGradleDaemon);
final bool androidSkipBuildDependencyValidation = !argParser.options.containsKey(FlutterOptions.kAndroidSkipBuildDependencyValidation)
|| boolArg(FlutterOptions.kAndroidSkipBuildDependencyValidation);
final List<String> androidProjectArgs = argParser.options.containsKey(FlutterOptions.kAndroidProjectArgs)
? stringsArg(FlutterOptions.kAndroidProjectArgs)
: <String>[];
@@ -1326,7 +1316,6 @@ abstract class FlutterCommand extends Command<void> {
nullSafetyMode: nullSafetyMode,
codeSizeDirectory: codeSizeDirectory,
androidGradleDaemon: androidGradleDaemon,
androidSkipBuildDependencyValidation: androidSkipBuildDependencyValidation,
packageConfig: packageConfig,
androidProjectArgs: androidProjectArgs,
initializeFromDill: argParser.options.containsKey(FlutterOptions.kInitializeFromDill)