Skip to content

Commit 024368d

Browse files
authored
bump Gradle to 8.12, AGP to 8.8, Kotlin to 2.1 (#990)
* [android] bump Gradle to 8.12, AGP to 8.8, Kotlin to 2.1 * [ci] prepare: use Flutter 3.27.x instead of Flutter 3.19.x * update all Dart dependencies * bump min Flutter to 3.27.0
1 parent 6df095b commit 024368d

File tree

10 files changed

+38
-47
lines changed

10 files changed

+38
-47
lines changed

Diff for: .github/workflows/prepare.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
flutter-version: ["3.19.x"]
16+
flutter-version: ["3.27.x"]
1717

1818
steps:
1919
- name: Clone repository

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## Unreleased
2+
3+
- Dependencies update (#990)
4+
- **Bump minimum Flutter to 3.27**
5+
- Update leancode_lint and fix all new warnings
6+
- Bump Gradle to 8.8
7+
- Bump Kotlin to 2.1.0
8+
19
## 1.11.8
210

311
- Allow nullable Content-Yype (#966)

Diff for: android/build.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath "com.android.tools.build:gradle:7.4.2"
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0"
14-
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0"
12+
classpath "com.android.tools.build:gradle:8.8.0"
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0"
14+
classpath "org.jlleitschuh.gradle:ktlint-gradle:12.1.2"
1515
}
1616
}
1717

@@ -21,20 +21,20 @@ repositories {
2121
}
2222

2323
apply plugin: "com.android.library"
24-
apply plugin: "kotlin-android"
24+
apply plugin: "org.jetbrains.kotlin.android"
2525
apply plugin: "org.jlleitschuh.gradle.ktlint"
2626

2727
android {
2828
namespace = "vn.hunghd.flutterdownloader"
2929
compileSdk = 35
3030

3131
compileOptions {
32-
sourceCompatibility JavaVersion.VERSION_1_8
33-
targetCompatibility JavaVersion.VERSION_1_8
32+
sourceCompatibility = JavaVersion.VERSION_11
33+
targetCompatibility = JavaVersion.VERSION_11
3434
}
3535

3636
kotlinOptions {
37-
jvmTarget = JavaVersion.VERSION_1_8
37+
jvmTarget = "11"
3838
// allWarningsAsErrors = true // TODO(bartekpacia): Re-enable
3939
}
4040

Diff for: example/android/app/build.gradle

+8-26
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,26 @@ plugins {
44
id "dev.flutter.flutter-gradle-plugin"
55
}
66

7-
def localProperties = new Properties()
8-
def localPropertiesFile = rootProject.file("local.properties")
9-
if (localPropertiesFile.exists()) {
10-
localPropertiesFile.withReader("UTF-8") { reader ->
11-
localProperties.load(reader)
12-
}
13-
}
14-
15-
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
16-
if (flutterVersionCode == null) {
17-
flutterVersionCode = "1"
18-
}
19-
20-
def flutterVersionName = localProperties.getProperty("flutter.versionName")
21-
if (flutterVersionName == null) {
22-
flutterVersionName = "1.0"
23-
}
24-
257
android {
268
namespace = "vn.hunghd.example"
279
compileSdk = 35
2810
ndkVersion = flutter.ndkVersion
2911

3012
defaultConfig {
3113
applicationId "vn.hunghd.example"
32-
minSdk = 21
33-
targetSdk = 35
34-
versionCode = flutterVersionCode.toInteger()
35-
versionName = flutterVersionName
14+
minSdk = flutter.minSdkVersion
15+
targetSdk = flutter.targetSdkVersion
16+
versionCode = flutter.versionCode
17+
versionName = flutter.versionName
3618
}
3719

3820
compileOptions {
39-
sourceCompatibility = JavaVersion.VERSION_1_8
40-
targetCompatibility = JavaVersion.VERSION_1_8
21+
sourceCompatibility = JavaVersion.VERSION_11
22+
targetCompatibility = JavaVersion.VERSION_11
4123
}
4224

4325
kotlinOptions {
44-
jvmTarget = JavaVersion.VERSION_1_8
26+
jvmTarget = "11"
4527
}
4628

4729
buildTypes {
@@ -53,5 +35,5 @@ android {
5335
}
5436

5537
flutter {
56-
source "../.."
38+
source = "../.."
5739
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

Diff for: example/android/settings.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id("dev.flutter.flutter-plugin-loader")
21-
id("com.android.application") version ('8.7.2') apply false
22-
id("org.jetbrains.kotlin.android") version ("1.9.23") apply false
21+
id("com.android.application") version ("8.8.0") apply false
22+
id("org.jetbrains.kotlin.android") version ("2.1.0") apply false
2323
}
2424

2525
include(":app")

Diff for: example/pubspec.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ version: 1.0.0+1
44
publish_to: none
55

66
environment:
7-
sdk: ">=3.3.0 <4.0.0"
8-
flutter: ">=3.19.0"
7+
sdk: ">=3.6.0 <4.0.0"
8+
flutter: ">=3.27.0"
99

1010
dependencies:
11-
device_info_plus: ^10.1.0
11+
device_info_plus: ^11.2.1
1212
flutter:
1313
sdk: flutter
1414
flutter_downloader:
1515
path: ../
16-
path_provider: ^2.1.3
16+
path_provider: ^2.1.5
1717
permission_handler: ^11.3.1
1818

1919
dev_dependencies:
2020
flutter_test:
2121
sdk: flutter
22-
leancode_lint: ^12.1.0
22+
leancode_lint: ^15.0.0
2323

2424
flutter:
2525
uses-material-design: true

Diff for: lib/flutter_downloader.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
///
1010
/// * author: hunghd
1111
/// * email: [email protected]
12-
13-
library flutter_downloader;
12+
library;
1413

1514
export 'src/downloader.dart';
1615
export 'src/exceptions.dart';

Diff for: lib/src/downloader.dart

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// In some cases, it's hard to get around calls on 'dynamic'.
12
// ignore_for_file: avoid_dynamic_calls
23

34
import 'dart:async';
@@ -438,6 +439,7 @@ class FlutterDownloader {
438439
/// Prints [message] to console if [_debug] is true.
439440
static void _log(String? message) {
440441
if (_debug) {
442+
// Using print here seeems good enough.
441443
// ignore: avoid_print
442444
print(message);
443445
}

Diff for: pubspec.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ flutter:
1515
pluginClass: FlutterDownloaderPlugin
1616

1717
environment:
18-
sdk: ">=3.3.0 <4.0.0"
19-
flutter: ">=3.19.0"
18+
sdk: ">=3.6.0 <4.0.0"
19+
flutter: ">=3.27.0"
2020

2121
dependencies:
2222
flutter:
@@ -25,4 +25,4 @@ dependencies:
2525
dev_dependencies:
2626
flutter_test:
2727
sdk: flutter
28-
leancode_lint: ^12.1.0
28+
leancode_lint: ^15.0.0

0 commit comments

Comments
 (0)