mirror of
https://github.com/flutter/flutter
synced 2024-10-13 03:32:55 +00:00
Do not show plugin embedding warning with missing example app (#76406)
This commit is contained in:
parent
c6a74e0a5e
commit
841f2e082e
|
@ -217,6 +217,9 @@ class FlutterProject {
|
||||||
/// True if this project is a Flutter module project.
|
/// True if this project is a Flutter module project.
|
||||||
bool get isModule => manifest.isModule;
|
bool get isModule => manifest.isModule;
|
||||||
|
|
||||||
|
/// True if this project is a Flutter plugin project.
|
||||||
|
bool get isPlugin => manifest.isPlugin;
|
||||||
|
|
||||||
/// True if the Flutter project is using the AndroidX support library.
|
/// True if the Flutter project is using the AndroidX support library.
|
||||||
bool get usesAndroidX => manifest.usesAndroidX;
|
bool get usesAndroidX => manifest.usesAndroidX;
|
||||||
|
|
||||||
|
@ -285,7 +288,7 @@ class FlutterProject {
|
||||||
bool windowsPlatform = false,
|
bool windowsPlatform = false,
|
||||||
bool webPlatform = false,
|
bool webPlatform = false,
|
||||||
}) async {
|
}) async {
|
||||||
if (!directory.existsSync() || hasExampleApp) {
|
if (!directory.existsSync() || hasExampleApp || isPlugin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await refreshPluginsList(this, iosPlatform: iosPlatform, macOSPlatform: macOSPlatform);
|
await refreshPluginsList(this, iosPlatform: iosPlatform, macOSPlatform: macOSPlatform);
|
||||||
|
|
|
@ -185,6 +185,13 @@ void main() {
|
||||||
await project.regeneratePlatformSpecificTooling();
|
await project.regeneratePlatformSpecificTooling();
|
||||||
expect(testLogger.statusText, contains('https://flutter.dev/go/android-project-migration'));
|
expect(testLogger.statusText, contains('https://flutter.dev/go/android-project-migration'));
|
||||||
});
|
});
|
||||||
|
_testInMemory('Android plugin without example app does not show a warning', () async {
|
||||||
|
final FlutterProject project = await aPluginProject();
|
||||||
|
project.example.directory.deleteSync();
|
||||||
|
|
||||||
|
await project.regeneratePlatformSpecificTooling();
|
||||||
|
expect(testLogger.statusText, isNot(contains('https://flutter.dev/go/android-project-migration')));
|
||||||
|
});
|
||||||
_testInMemory('updates local properties for Android', () async {
|
_testInMemory('updates local properties for Android', () async {
|
||||||
final FlutterProject project = await someProject();
|
final FlutterProject project = await someProject();
|
||||||
await project.regeneratePlatformSpecificTooling();
|
await project.regeneratePlatformSpecificTooling();
|
||||||
|
@ -306,6 +313,7 @@ void main() {
|
||||||
group('example', () {
|
group('example', () {
|
||||||
_testInMemory('exists for plugin in legacy format', () async {
|
_testInMemory('exists for plugin in legacy format', () async {
|
||||||
final FlutterProject project = await aPluginProject();
|
final FlutterProject project = await aPluginProject();
|
||||||
|
expect(project.isPlugin, isTrue);
|
||||||
expect(project.hasExampleApp, isTrue);
|
expect(project.hasExampleApp, isTrue);
|
||||||
});
|
});
|
||||||
_testInMemory('exists for plugin in multi-platform format', () async {
|
_testInMemory('exists for plugin in multi-platform format', () async {
|
||||||
|
@ -314,6 +322,7 @@ void main() {
|
||||||
});
|
});
|
||||||
_testInMemory('does not exist for non-plugin', () async {
|
_testInMemory('does not exist for non-plugin', () async {
|
||||||
final FlutterProject project = await someProject();
|
final FlutterProject project = await someProject();
|
||||||
|
expect(project.isPlugin, isFalse);
|
||||||
expect(project.hasExampleApp, isFalse);
|
expect(project.hasExampleApp, isFalse);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue