forked from firka/flutter
Reverts: flutter/flutter#154061
Initiated by: QuncCccccc
Reason for reverting: might be the reason that cause Framework tree to red
Original PR Author: bartekpacia
Reviewed By: {gmackall, reidbaker}
This change reverts the following previous change:
This PR resolves #151166
This commit is contained in:
@@ -467,19 +467,7 @@ class AndroidProject extends FlutterProjectPlatform {
|
||||
static final RegExp _androidNamespacePattern = RegExp('android {[\\S\\s]+namespace\\s*=?\\s*[\'"](.+)[\'"]');
|
||||
static final RegExp _applicationIdPattern = RegExp('^\\s*applicationId\\s*=?\\s*[\'"](.*)[\'"]\\s*\$');
|
||||
static final RegExp _imperativeKotlinPluginPattern = RegExp('^\\s*apply plugin\\:\\s+[\'"]kotlin-android[\'"]\\s*\$');
|
||||
|
||||
/// Examples of strings that this regex matches:
|
||||
/// - `id "kotlin-android"`
|
||||
/// - `id("kotlin-android")`
|
||||
/// - `id ( "kotlin-android" ) `
|
||||
/// - `id "org.jetbrains.kotlin.android"`
|
||||
/// - `id("org.jetbrains.kotlin.android")`
|
||||
/// - `id ( "org.jetbrains.kotlin.android" )`
|
||||
static final List<RegExp> _declarativeKotlinPluginPatterns = <RegExp>[
|
||||
RegExp('^\\s*id\\s*\\(?\\s*[\'"]kotlin-android[\'"]\\s*\\)?\\s*\$'),
|
||||
RegExp('^\\s*id\\s*\\(?\\s*[\'"]org.jetbrains.kotlin.android[\'"]\\s*\\)?\\s*\$'),
|
||||
];
|
||||
|
||||
static final RegExp _declarativeKotlinPluginPattern = RegExp('^\\s*id\\s+[\'"]kotlin-android[\'"]\\s*\$');
|
||||
|
||||
/// Pattern used to find the assignment of the "group" property in Gradle.
|
||||
/// Expected example: `group "dev.flutter.plugin"`
|
||||
@@ -575,9 +563,7 @@ class AndroidProject extends FlutterProjectPlatform {
|
||||
/// True, if the app project is using Kotlin.
|
||||
bool get isKotlin {
|
||||
final bool imperativeMatch = firstMatchInFile(appGradleFile, _imperativeKotlinPluginPattern) != null;
|
||||
final bool declarativeMatch = _declarativeKotlinPluginPatterns.any((RegExp pattern) {
|
||||
return (firstMatchInFile(appGradleFile, pattern) != null);
|
||||
});
|
||||
final bool declarativeMatch = firstMatchInFile(appGradleFile, _declarativeKotlinPluginPattern) != null;
|
||||
return imperativeMatch || declarativeMatch;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user