Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump Gradle to 8.12, AGP to 8.8, Kotlin to 2.1 #990

Merged
merged 4 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/prepare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ["3.19.x"]
flutter-version: ["3.27.x"]

steps:
- name: Clone repository
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Unreleased

- Dependencies update (#990)
- **Bump minimum Flutter to 3.27**
- Update leancode_lint and fix all new warnings
- Bump Gradle to 8.8
- Bump Kotlin to 2.1.0

## 1.11.8

- Allow nullable Content-Yype (#966)
Expand Down
14 changes: 7 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ buildscript {
}

dependencies {
classpath "com.android.tools.build:gradle:7.4.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0"
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0"
classpath "com.android.tools.build:gradle:8.8.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0"
classpath "org.jlleitschuh.gradle:ktlint-gradle:12.1.2"
}
}

Expand All @@ -21,20 +21,20 @@ repositories {
}

apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "org.jlleitschuh.gradle.ktlint"

android {
namespace = "vn.hunghd.flutterdownloader"
compileSdk = 35

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = "11"
// allWarningsAsErrors = true // TODO(bartekpacia): Re-enable
}

Expand Down
34 changes: 8 additions & 26 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,26 @@ plugins {
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = "1"
}

def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = "1.0"
}

android {
namespace = "vn.hunghd.example"
compileSdk = 35
ndkVersion = flutter.ndkVersion

defaultConfig {
applicationId "vn.hunghd.example"
minSdk = 21
targetSdk = 35
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = "11"
}

buildTypes {
Expand All @@ -53,5 +35,5 @@ android {
}

flutter {
source "../.."
source = "../.."
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pluginManagement {

plugins {
id("dev.flutter.flutter-plugin-loader")
id("com.android.application") version ('8.7.2') apply false
id("org.jetbrains.kotlin.android") version ("1.9.23") apply false
id("com.android.application") version ("8.8.0") apply false
id("org.jetbrains.kotlin.android") version ("2.1.0") apply false
}

include(":app")
10 changes: 5 additions & 5 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ version: 1.0.0+1
publish_to: none

environment:
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"
sdk: ">=3.6.0 <4.0.0"
flutter: ">=3.27.0"

dependencies:
device_info_plus: ^10.1.0
device_info_plus: ^11.2.1
flutter:
sdk: flutter
flutter_downloader:
path: ../
path_provider: ^2.1.3
path_provider: ^2.1.5
permission_handler: ^11.3.1

dev_dependencies:
flutter_test:
sdk: flutter
leancode_lint: ^12.1.0
leancode_lint: ^15.0.0

flutter:
uses-material-design: true
3 changes: 1 addition & 2 deletions lib/flutter_downloader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
///
/// * author: hunghd
/// * email: [email protected]
library flutter_downloader;
library;

export 'src/downloader.dart';
export 'src/exceptions.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/src/downloader.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// In some cases, it's hard to get around calls on 'dynamic'.
// ignore_for_file: avoid_dynamic_calls

import 'dart:async';
Expand Down Expand Up @@ -438,6 +439,7 @@ class FlutterDownloader {
/// Prints [message] to console if [_debug] is true.
static void _log(String? message) {
if (_debug) {
// Using print here seeems good enough.
// ignore: avoid_print
print(message);
}
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ flutter:
pluginClass: FlutterDownloaderPlugin

environment:
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"
sdk: ">=3.6.0 <4.0.0"
flutter: ">=3.27.0"

dependencies:
flutter:
Expand All @@ -25,4 +25,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
leancode_lint: ^12.1.0
leancode_lint: ^15.0.0
Loading