1 | // Copyright 2014 The Flutter Authors. All rights reserved. |
---|---|
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | import 'dart:io'; |
6 | |
7 | import 'package:file/local.dart'; |
8 | import 'package:flutter_devicelab/framework/dependency_smoke_test_task_definition.dart'; |
9 | import 'package:flutter_devicelab/framework/framework.dart'; |
10 | |
11 | // Methodology: |
12 | // - AGP: all versions within our support range (*). |
13 | // - Gradle: The version that AGP lists as the default Gradle version for that |
14 | // AGP version under the release notes, e.g. |
15 | // https://developer.android.com/build/releases/past-releases/agp-8-4-0-release-notes. |
16 | // - Kotlin: No methodology as of yet. |
17 | // (*) - support range defined in packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts. |
18 | List<VersionTuple> versionTuples = <VersionTuple>[ |
19 | VersionTuple( |
20 | agpVersion: '7.0.1', |
21 | gradleVersion: '7.0.2', |
22 | kotlinVersion: '1.7.10', |
23 | compileSdkVersion: '34', |
24 | ), |
25 | VersionTuple( |
26 | agpVersion: '7.1.0', |
27 | gradleVersion: '7.2', |
28 | kotlinVersion: '1.7.10', |
29 | compileSdkVersion: '34', |
30 | ), |
31 | VersionTuple( |
32 | agpVersion: '7.2.0', |
33 | gradleVersion: '7.3.3', |
34 | kotlinVersion: '1.7.10', |
35 | compileSdkVersion: '34', |
36 | ), |
37 | VersionTuple( |
38 | agpVersion: '7.3.0', |
39 | gradleVersion: '7.4', |
40 | kotlinVersion: '1.7.10', |
41 | compileSdkVersion: '34', |
42 | ), |
43 | // minSdk bump required due to a bug in the default version of r8 used by AGP |
44 | // 7.4.0. See http://issuetracker.google.com/issues/357553178. |
45 | VersionTuple( |
46 | agpVersion: '7.4.0', |
47 | gradleVersion: '7.5', |
48 | kotlinVersion: '1.8.10', |
49 | compileSdkVersion: '34', |
50 | minSdkVersion: '24', |
51 | ), |
52 | ]; |
53 | |
54 | // This test requires a Java version less than 17 due to the intentionally low |
55 | // version of Gradle. We choose 11 because this was the primary version used in |
56 | // CI before 17, and hence it is also hosted on CIPD. It also overrides to |
57 | // compileSdkVersion 34 because compileSdk 35 requires AGP 8.0+. |
58 | // https://docs.gradle.org/current/userguide/compatibility.html |
59 | Future<void> main() async { |
60 | /// The [FileSystem] for the integration test environment. |
61 | const LocalFileSystem fileSystem = LocalFileSystem(); |
62 | |
63 | final Directory tempDir = fileSystem.systemTempDirectory.createTempSync( |
64 | 'flutter_android_dependency_version_tests', |
65 | ); |
66 | await task(() { |
67 | return buildFlutterApkWithSpecifiedDependencyVersions( |
68 | versionTuples: versionTuples, |
69 | tempDir: tempDir, |
70 | localFileSystem: fileSystem, |
71 | ); |
72 | }); |
73 | } |
74 |