fix package template create platform folders (#125292)

`package` template should not create platform folders. This happen cause by default all platforms are supported and tools didn't distinguish between package and other template, which makes all platforms are true for below code,
d186792c00/packages/flutter_tools/lib/src/project.dart (L374-L380)

fixes: #119844 which make #116320 makes invalid. As for why tools created deprecated `Android Embedding`, `appManifestFile` does not exist for `package` template, which make below code to trigger,
https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/project.dart#L768-L770

This does not happen with `module` and `plugin` as it have specific condition check for them. I try to reproduce it with `app` template but didn't succeed
This commit is contained in:
Anas 2023-04-29 05:30:08 +05:30 committed by GitHub
parent 1a0b03cb25
commit 512e2c3fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -267,6 +267,14 @@ class CreateCommand extends CreateBase {
includeLinux = false;
includeMacos = false;
includeWindows = false;
} else if (template == FlutterProjectType.package) {
// The package template does not supports any platform.
includeIos = false;
includeAndroid = false;
includeWeb = false;
includeLinux = false;
includeMacos = false;
includeWindows = false;
} else {
includeIos = featureFlags.isIOSEnabled && platforms.contains('ios');
includeAndroid = featureFlags.isAndroidEnabled && platforms.contains('android');

View File

@ -516,6 +516,7 @@ void main() {
unexpectedPaths: <String>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java',
'android/src/main/java/com/example/flutter_project/FlutterProjectPlugin.java',
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java',
'example/android/app/src/main/java/com/example/flutter_project_example/MainActivity.java',
'example/ios/Runner/AppDelegate.h',
'example/ios/Runner/AppDelegate.m',
@ -525,9 +526,18 @@ void main() {
'ios/Classes/FlutterProjectPlugin.m',
'ios/Runner/AppDelegate.h',
'ios/Runner/AppDelegate.m',
'ios/Runner/GeneratedPluginRegistrant.h',
'ios/Runner/GeneratedPluginRegistrant.m',
'ios/Runner/main.m',
'lib/main.dart',
'test/widget_test.dart',
'windows/flutter/generated_plugin_registrant.cc',
'windows/flutter/generated_plugin_registrant.h',
'windows/flutter/generated_plugins.cmake',
'linux/flutter/generated_plugin_registrant.cc',
'linux/flutter/generated_plugin_registrant.h',
'linux/flutter/generated_plugins.cmake',
'macos/Flutter/GeneratedPluginRegistrant.swift',
],
);
return _runFlutterTest(projectDir);