Move v1 embedding migration warning from plugin consumers to all apps (#64181)

This commit is contained in:
xster
2020-08-19 22:32:08 -07:00
committed by GitHub
parent a1097d70ed
commit e1ae4dfcae
5 changed files with 57 additions and 8 deletions

View File

@@ -661,12 +661,6 @@ Future<void> _writeAndroidPluginRegistrant(FlutterProject project, List<Plugin>
break;
case AndroidEmbeddingVersion.v1:
default:
globals.printStatus(
'Your Flutter application is created using an older version of the '
"Android embedding. It's being deprecated in favor of Android embedding "
'v2. Follow the steps on https://flutter.dev/go/android-project-migration '
'to migrate your project.'
);
for (final Map<String, dynamic> plugin in androidPlugins) {
if (!(plugin['supportsEmbeddingV1'] as bool) && plugin['supportsEmbeddingV2'] as bool) {
throwToolExit(

View File

@@ -756,6 +756,23 @@ class AndroidProject extends FlutterProjectPlatform {
}
Future<void> ensureReadyForPlatformSpecificTooling() async {
if (getEmbeddingVersion() == AndroidEmbeddingVersion.v1) {
globals.printStatus(
"""
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"""
);
}
if (isModule && _shouldRegenerateFromTemplate()) {
await _regenerateLibrary();
// Add ephemeral host app, if an editable host app does not already exist.