Unverified Commit f130da46 authored by Gray Mackall's avatar Gray Mackall Committed by GitHub

Make generate_gradle_lockfiles also write the gradle wrapper file (#142329)

The `generate_gradle_lockfiles` script currently writes the top level `build.gradle` file and the `settings.gradle` file, and is the easiest way to batch update these files to, for example, increase the AGP version used in integration tests and examples across the framework repo.

This PR makes it also write the gradle version, so that we can do batch upgrades of our gradle version with it as well.
parent 8acce3d4
......@@ -40,6 +40,15 @@ void main(List<String> arguments) {
continue;
}
final File wrapperGradle = androidDirectory
.childDirectory('gradle')
.childDirectory('wrapper')
.childFile('gradle-wrapper.properties');
if (!wrapperGradle.existsSync()) {
print('${wrapperGradle.path} does not exist - skipping');
continue;
}
if (settingsGradle.readAsStringSync().contains('include_flutter.groovy')) {
print('${settingsGradle.path} add to app - skipping');
continue;
......@@ -78,6 +87,7 @@ void main(List<String> arguments) {
rootBuildGradle.writeAsStringSync(rootGradleFileContent);
settingsGradle.writeAsStringSync(settingGradleFile);
wrapperGradle.writeAsStringSync(wrapperGradleFileContent);
final String appDirectory = androidDirectory.parent.absolute.path;
......@@ -214,3 +224,11 @@ include ":app"
apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
''';
const String wrapperGradleFileContent = r'''
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
''';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment