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:
committed by
GitHub
parent
47e65e806f
commit
3a97a38c41
@@ -805,6 +805,28 @@ plugins {
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
''';
|
||||
});
|
||||
expect(project.android.isKotlin, isTrue);
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
XcodeProjectInterpreter: () => xcodeProjectInterpreter,
|
||||
FlutterProjectFactory: () => flutterProjectFactory,
|
||||
});
|
||||
|
||||
testUsingContext('kotlin host app language with Gradle Kotlin DSL and typesafe plugin id', () async {
|
||||
final FlutterProject project = await someProject();
|
||||
|
||||
addAndroidGradleFile(project.directory,
|
||||
kotlinDsl: true,
|
||||
gradleFileContent: () {
|
||||
return '''
|
||||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
dev.flutter.`flutter-gradle-plugin`
|
||||
}
|
||||
''';
|
||||
});
|
||||
expect(project.android.isKotlin, isTrue);
|
||||
|
||||
Reference in New Issue
Block a user