Skip to content

Commit

Permalink
Revert "Upgrade Gradle and AGP versions to 7.5/7.2 and migrate exampl…
Browse files Browse the repository at this point in the history
…es/tests (#108197)" (#108349)

This reverts commit ca6cecf.
  • Loading branch information
zanderso authored Jul 26, 2022
1 parent ca6cecf commit d155bc1
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion dev/benchmarks/complex_layout/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion dev/benchmarks/macrobenchmarks/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion dev/benchmarks/microbenchmarks/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion dev/benchmarks/platform_views_layout/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion dev/benchmarks/test_apps/stocks/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion dev/integration_tests/android_views/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion dev/integration_tests/flutter_gallery/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/api/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/flutter_view/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/image_list/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/layers/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/platform_channel/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/platform_view/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Expand Down
12 changes: 6 additions & 6 deletions packages/flutter_tools/lib/src/android/gradle_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import 'android_sdk.dart';
// For more information about the latest version, check:
// https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// https://kotlinlang.org/docs/gradle.html#plugin-and-versions
const String templateDefaultGradleVersion = '7.5';
const String templateAndroidGradlePluginVersion = '7.2.0';
const String templateDefaultGradleVersionForModule = '7.2.0';
const String templateKotlinGradlePluginVersion = '1.7.10';
const String templateDefaultGradleVersion = '7.4';
const String templateAndroidGradlePluginVersion = '7.1.2';
const String templateDefaultGradleVersionForModule = '7.1.2';
const String templateKotlinGradlePluginVersion = '1.6.10';

// These versions should match the values in flutter.gradle (FlutterExtension).
// The Flutter Gradle plugin is only applied to app projects, and modules that are built from source
Expand Down Expand Up @@ -204,8 +204,8 @@ String getGradleVersionFor(String androidPluginVersion) {
if (_isWithinVersionRange(androidPluginVersion, min: '4.0.0', max: '4.1.0')) {
return '6.7';
}
if (_isWithinVersionRange(androidPluginVersion, min: '7.0', max: '7.5')) {
return '7.5';
if (_isWithinVersionRange(androidPluginVersion, min: '7.0', max: '7.4')) {
return '7.4';
}
throwToolExit('Unsupported Android Plugin version: $androidPluginVersion.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -907,10 +907,10 @@ A problem occurred evaluating project ':app'.
'│ To fix this issue, replace the following content: │\n'
'│ /android/build.gradle: │\n'
"│ - classpath 'com.android.tools.build:gradle:<current-version>' │\n"
"│ + classpath 'com.android.tools.build:gradle:7.2.0' │\n"
"│ + classpath 'com.android.tools.build:gradle:7.1.2' │\n"
'│ /android/gradle/wrapper/gradle-wrapper.properties: │\n'
'│ - https://services.gradle.org/distributions/gradle-<current-version>-all.zip │\n'
'│ + https://services.gradle.org/distributions/gradle-7.5-all.zip │\n'
'│ + https://services.gradle.org/distributions/gradle-7.4-all.zip │\n'
'└──────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void main() {
'gradle',
label: 'gradle-expected-file-not-found',
parameters: CustomDimensions.fromMap(<String, String> {
'cd37': 'androidGradlePluginVersion: 7.5, fileExtension: .aab',
'cd37': 'androidGradlePluginVersion: 7.4, fileExtension: .aab',
}),
),
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,9 @@ flutter:
expect(getGradleVersionFor('4.0.0'), '6.7');
expect(getGradleVersionFor('4.1.0'), '6.7');

expect(getGradleVersionFor('7.0'), '7.5');
expect(getGradleVersionFor('7.1.2'), '7.5');
expect(getGradleVersionFor('7.2'), '7.5');
expect(getGradleVersionFor('7.0'), '7.4');
expect(getGradleVersionFor('7.1.2'), '7.4');
expect(getGradleVersionFor('7.2'), '7.4');
});

testWithoutContext('throws on unsupported versions', () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void main() {
'distributionPath=wrapper/dists\n'
'zipStoreBase=GRADLE_USER_HOME\n'
'zipStorePath=wrapper/dists\n'
'distributionUrl=https\\://services.gradle.org/distributions/gradle-7.5-all.zip\n');
'distributionUrl=https\\://services.gradle.org/distributions/gradle-7.4-all.zip\n');
});

testWithoutContext('injects the wrapper when some files are missing', () {
Expand Down Expand Up @@ -110,7 +110,7 @@ void main() {
'distributionPath=wrapper/dists\n'
'zipStoreBase=GRADLE_USER_HOME\n'
'zipStorePath=wrapper/dists\n'
'distributionUrl=https\\://services.gradle.org/distributions/gradle-7.5-all.zip\n');
'distributionUrl=https\\://services.gradle.org/distributions/gradle-7.4-all.zip\n');
});

testWithoutContext('injects the wrapper and the Gradle version is derivated from the AGP version', () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ void main() {
final RegExp androidPluginRegExp =
RegExp(r'com\.android\.tools\.build:gradle:(\d+\.\d+\.\d+)');

// Use AGP 7.2.0
// Use AGP 4.1.0
final String newBuildGradle = buildGradle.replaceAll(
androidPluginRegExp, 'com.android.tools.build:gradle:7.2.0');
androidPluginRegExp, 'com.android.tools.build:gradle:4.1.0');
buildGradleFile.writeAsStringSync(newBuildGradle);

// Run flutter build apk using AGP 7.2.0
// Run flutter build apk using AGP 4.1.0
result = processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
Expand Down

0 comments on commit d155bc1

Please sign in to comment.