From 056c40f55b2c697860e681a9a1d1fccebf4c57c7 Mon Sep 17 00:00:00 2001 From: Gray Mackall <34871572+gmackall@users.noreply.github.com> Date: Wed, 4 Sep 2024 10:47:59 -0700 Subject: [PATCH] Make the Flutter Gradle Plugin apply `FlutterExtension` to (flutter) plugins (#151861) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes the Flutter Gradle Plugin apply the `FlutterExtension` (the class that vends `flutter.minSdkVersion`, etc) to Flutter plugins. This allows plugin authors to use `flutter.compileSdkVersion` and the like in plugin `build.gradle` files. Doesn't use it in templates yet - holding off till we can see how this works in the plugins repo (which will sadly have to wait till this makes the next stable 😢 ) --- packages/flutter_tools/gradle/src/main/groovy/flutter.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy b/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy index e0bcc64d4d5..7c206a2f27c 100644 --- a/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy +++ b/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy @@ -765,6 +765,9 @@ class FlutterPlugin implements Plugin { if (pluginProject == null) { return } + // Apply the "flutter" Gradle extension to plugins so that they can use it's vended + // compile/target/min sdk values. + pluginProject.extensions.create("flutter", FlutterExtension) // Add plugin dependency to the app project. project.dependencies { api(pluginProject)