diff --git a/packages/desktop_drop/CHANGELOG.md b/packages/desktop_drop/CHANGELOG.md index c1f26dfe..b649331f 100644 --- a/packages/desktop_drop/CHANGELOG.md +++ b/packages/desktop_drop/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.8.2 + +* [desktop_drop] [Android] restore compatibility with hosts on Android Gradle Plugin < 9 by applying the Kotlin Gradle Plugin conditionally, per the Flutter built-in Kotlin migration guide +* [desktop_drop] [Android] bump bundled Kotlin Gradle Plugin to 2.2.0 to support the `kotlin.compilerOptions` DSL on AGP < 9 hosts + ## 0.8.1 * [desktop_drop] [Linux] register the `application/vnd.portal.filetransfer` drag target and deliver its key via a new `performOperation_portal` channel message diff --git a/packages/desktop_drop/android/build.gradle b/packages/desktop_drop/android/build.gradle index 41b3f31d..db7bf62f 100644 --- a/packages/desktop_drop/android/build.gradle +++ b/packages/desktop_drop/android/build.gradle @@ -2,7 +2,7 @@ group 'com.example.desktop_drop' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.9.25' + ext.kotlin_version = '2.2.0' repositories { google() mavenCentral() @@ -16,6 +16,16 @@ buildscript { apply plugin: 'com.android.library' +// Apply KGP only when the host does not provide built-in Kotlin. +// AGP 9+ ships Kotlin built-in and hard-fails if kotlin-android is applied, +// while hosts on AGP < 9 do not apply any Kotlin plugin to this subproject. +// See https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors +// ("Support Flutter versions earlier than 3.44"). +def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int +if (agpMajor < 9) { + apply plugin: 'kotlin-android' +} + rootProject.allprojects { repositories { google() diff --git a/packages/desktop_drop/pubspec.yaml b/packages/desktop_drop/pubspec.yaml index 026257ae..7ba9147a 100644 --- a/packages/desktop_drop/pubspec.yaml +++ b/packages/desktop_drop/pubspec.yaml @@ -1,7 +1,7 @@ name: desktop_drop resolution: workspace description: A plugin which allows user dragging files to your flutter desktop applications. -version: 0.8.1 +version: 0.8.2 homepage: https://github.com/MixinNetwork/flutter-plugins/tree/main/packages/desktop_drop environment: