mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
1a0b03cb25
commit
512e2c3fd5
@ -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');
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user