Unverified Commit 512e2c3f authored by Anas's avatar Anas Committed by GitHub

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,
https://github.com/flutter/flutter/blob/d186792c00f61149916f685e2975300342f64749/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
parent 1a0b03cb
...@@ -267,6 +267,14 @@ class CreateCommand extends CreateBase { ...@@ -267,6 +267,14 @@ class CreateCommand extends CreateBase {
includeLinux = false; includeLinux = false;
includeMacos = false; includeMacos = false;
includeWindows = 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 { } else {
includeIos = featureFlags.isIOSEnabled && platforms.contains('ios'); includeIos = featureFlags.isIOSEnabled && platforms.contains('ios');
includeAndroid = featureFlags.isAndroidEnabled && platforms.contains('android'); includeAndroid = featureFlags.isAndroidEnabled && platforms.contains('android');
......
...@@ -516,6 +516,7 @@ void main() { ...@@ -516,6 +516,7 @@ void main() {
unexpectedPaths: <String>[ unexpectedPaths: <String>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java', 'android/app/src/main/java/com/example/flutter_project/MainActivity.java',
'android/src/main/java/com/example/flutter_project/FlutterProjectPlugin.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/android/app/src/main/java/com/example/flutter_project_example/MainActivity.java',
'example/ios/Runner/AppDelegate.h', 'example/ios/Runner/AppDelegate.h',
'example/ios/Runner/AppDelegate.m', 'example/ios/Runner/AppDelegate.m',
...@@ -525,9 +526,18 @@ void main() { ...@@ -525,9 +526,18 @@ void main() {
'ios/Classes/FlutterProjectPlugin.m', 'ios/Classes/FlutterProjectPlugin.m',
'ios/Runner/AppDelegate.h', 'ios/Runner/AppDelegate.h',
'ios/Runner/AppDelegate.m', 'ios/Runner/AppDelegate.m',
'ios/Runner/GeneratedPluginRegistrant.h',
'ios/Runner/GeneratedPluginRegistrant.m',
'ios/Runner/main.m', 'ios/Runner/main.m',
'lib/main.dart', 'lib/main.dart',
'test/widget_test.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); return _runFlutterTest(projectDir);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment