Make the Flutter Gradle Plugin apply FlutterExtension to (flutter) plugins (#151861)

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 😢 )
This commit is contained in:
Gray Mackall 2024-09-04 10:47:59 -07:00 committed by GitHub
parent 40f763aeaa
commit 056c40f55b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -765,6 +765,9 @@ class FlutterPlugin implements Plugin<Project> {
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)