Make --androidx flag a noop in flutter create (#52340)
This commit is contained in:
@@ -139,11 +139,12 @@ class CreateCommand extends FlutterCommand {
|
||||
defaultsTo: 'kotlin',
|
||||
allowed: <String>['java', 'kotlin'],
|
||||
);
|
||||
// TODO(egarciad): Remove this flag. https://github.com/flutter/flutter/issues/52363
|
||||
argParser.addFlag(
|
||||
'androidx',
|
||||
hide: true,
|
||||
negatable: true,
|
||||
defaultsTo: true,
|
||||
help: 'Generate a project using the AndroidX support libraries',
|
||||
help: 'Deprecated. Setting this flag has no effect.',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -401,7 +402,6 @@ class CreateCommand extends FlutterCommand {
|
||||
flutterRoot: flutterRoot,
|
||||
renderDriverTest: boolArg('with-driver-test'),
|
||||
withPluginHook: generatePlugin,
|
||||
androidX: boolArg('androidx'),
|
||||
androidLanguage: stringArg('android-language'),
|
||||
iosLanguage: stringArg('ios-language'),
|
||||
web: featureFlags.isWebEnabled,
|
||||
@@ -411,7 +411,7 @@ class CreateCommand extends FlutterCommand {
|
||||
|
||||
final String relativeDirPath = globals.fs.path.relative(projectDirPath);
|
||||
if (!projectDir.existsSync() || projectDir.listSync().isEmpty) {
|
||||
globals.printStatus('Creating project $relativeDirPath... androidx: ${boolArg('androidx')}');
|
||||
globals.printStatus('Creating project $relativeDirPath...');
|
||||
} else {
|
||||
if (sampleCode != null && !overwrite) {
|
||||
throwToolExit('Will not overwrite existing project in $relativeDirPath: '
|
||||
@@ -619,7 +619,6 @@ To edit platform code in an IDE see https://flutter.dev/developing-packages/#edi
|
||||
String projectName,
|
||||
String projectDescription,
|
||||
String androidLanguage,
|
||||
bool androidX,
|
||||
String iosLanguage,
|
||||
String flutterRoot,
|
||||
bool renderDriverTest = false,
|
||||
@@ -644,7 +643,6 @@ To edit platform code in an IDE see https://flutter.dev/developing-packages/#edi
|
||||
'macosIdentifier': appleIdentifier,
|
||||
'description': projectDescription,
|
||||
'dartSdk': '$flutterRoot/bin/cache/dart-sdk',
|
||||
'androidX': androidX,
|
||||
'useAndroidEmbeddingV2': featureFlags.isAndroidEmbeddingV2Enabled,
|
||||
'androidMinApiLevel': android.minApiLevel,
|
||||
'androidSdkVersion': android_sdk.minimumAndroidSdkVersion,
|
||||
|
||||
@@ -527,14 +527,9 @@ public final class GeneratedPluginRegistrant {
|
||||
const String _androidPluginRegistryTemplateNewEmbedding = '''
|
||||
package io.flutter.plugins;
|
||||
|
||||
{{#androidX}}
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.NonNull;
|
||||
{{/androidX}}
|
||||
{{^androidX}}
|
||||
import android.support.annotation.Keep;
|
||||
import android.support.annotation.NonNull;
|
||||
{{/androidX}}
|
||||
|
||||
import io.flutter.embedding.engine.FlutterEngine;
|
||||
{{#needsShim}}
|
||||
import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;
|
||||
|
||||
Reference in New Issue
Block a user