Add support for type-safe plugin apply (#150958)

The Gradle Kotlin DSL also allows for type-safe application of the Flutter Gradle plugin, which is currently undetected by the CLI
```kotlin
plugins {
  dev.flutter.`flutter-gradle-plugin`
}
```

Please note that the added test case isn't ideal, since the example gradle isn't actually valid kotlin DSL, however the `kotlin host app language with Gradle Kotlin DSL` is identical

Fixes #149859
This commit is contained in:
Michael Rittmeister
2024-06-28 19:24:59 +02:00
committed by GitHub
parent 47e65e806f
commit 3a97a38c41
2 changed files with 25 additions and 1 deletions

View File

@@ -544,7 +544,9 @@ class AndroidProject extends FlutterProjectPlatform {
// pluginManagement block of the settings.gradle file.
// See https://docs.gradle.org/current/userguide/composite_builds.html#included_plugin_builds,
// as well as the settings.gradle and build.gradle templates.
final bool declarativeApply = line.contains('dev.flutter.flutter-gradle-plugin');
final bool declarativeApply = line.contains(
RegExp(r'dev\.flutter\.(?:(?:flutter-gradle-plugin)|(?:`flutter-gradle-plugin`))'),
);
// This case allows for flutter run/build to work for modules. It does
// not guarantee the Flutter Gradle Plugin is applied.