Unverified Commit 004f90f8 authored by Chris Yang's avatar Chris Yang Committed by GitHub

remove iOS folder (#61561)

parent 5281a9aa
...@@ -129,9 +129,10 @@ class Template { ...@@ -129,9 +129,10 @@ class Template {
return null; return null;
} }
// TODO(cyanglaz): do not add iOS folder by default when 1.20.0 is released. final bool ios = context['ios'] as bool;
// Also need to update the flutter SDK min constraint in the pubspec.yaml to 1.20.0. if (relativeDestinationPath.contains('ios') && !ios) {
// https://github.com/flutter/flutter/issues/59787 return null;
}
// Only build a web project if explicitly asked. // Only build a web project if explicitly asked.
final bool web = context['web'] as bool; final bool web = context['web'] as bool;
......
...@@ -1533,7 +1533,7 @@ void main() { ...@@ -1533,7 +1533,7 @@ void main() {
// TODO(cyanglaz): no-op iOS folder should be removed after 1.20.0 release // TODO(cyanglaz): no-op iOS folder should be removed after 1.20.0 release
// https://github.com/flutter/flutter/issues/59787 // https://github.com/flutter/flutter/issues/59787
expect(projectDir.childDirectory('ios').existsSync(), true); expect(projectDir.childDirectory('ios').existsSync(), false);
expect(projectDir.childDirectory('android').existsSync(), false); expect(projectDir.childDirectory('android').existsSync(), false);
expect(projectDir.childDirectory('web').existsSync(), false); expect(projectDir.childDirectory('web').existsSync(), false);
expect(projectDir.childDirectory('linux').existsSync(), false); expect(projectDir.childDirectory('linux').existsSync(), false);
...@@ -1542,7 +1542,7 @@ void main() { ...@@ -1542,7 +1542,7 @@ void main() {
// TODO(cyanglaz): no-op iOS folder should be removed after 1.20.0 release // TODO(cyanglaz): no-op iOS folder should be removed after 1.20.0 release
// https://github.com/flutter/flutter/issues/59787 // https://github.com/flutter/flutter/issues/59787
expect(projectDir.childDirectory('example').childDirectory('ios').existsSync(), true); expect(projectDir.childDirectory('example').childDirectory('ios').existsSync(), false);
expect(projectDir.childDirectory('example').childDirectory('android').existsSync(), false); expect(projectDir.childDirectory('example').childDirectory('android').existsSync(), false);
expect(projectDir.childDirectory('example').childDirectory('web').existsSync(), false); expect(projectDir.childDirectory('example').childDirectory('web').existsSync(), false);
expect(projectDir.childDirectory('example').childDirectory('linux').existsSync(), false); expect(projectDir.childDirectory('example').childDirectory('linux').existsSync(), false);
...@@ -1557,25 +1557,6 @@ void main() { ...@@ -1557,25 +1557,6 @@ void main() {
}); });
// TODO(cyanglaz): no-op iOS folder should be removed after 1.20.0 release
// https://github.com/flutter/flutter/issues/59787
testUsingContext('create an empty plugin contains a no-op ios folder, but no pubspec entry.', () async {
Cache.flutterRoot = '../..';
when(mockFlutterVersion.frameworkRevision).thenReturn(frameworkRevision);
when(mockFlutterVersion.channel).thenReturn(frameworkChannel);
final CreateCommand command = CreateCommand();
final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>['create', '--no-pub', '--template=plugin', projectDir.path]);
expect(projectDir.childDirectory('ios').existsSync(), true);
expect(projectDir.childDirectory('example').childDirectory('ios').existsSync(), true);
validatePubspecForPlugin(projectDir: projectDir.absolute.path, expectedPlatforms: const <String>[
'some_platform'
], pluginClass: 'somePluginClass',
unexpectedPlatforms: <String>['ios']);
});
testUsingContext('plugin supports ios if requested', () async { testUsingContext('plugin supports ios if requested', () async {
Cache.flutterRoot = '../..'; Cache.flutterRoot = '../..';
when(mockFlutterVersion.frameworkRevision).thenReturn(frameworkRevision); when(mockFlutterVersion.frameworkRevision).thenReturn(frameworkRevision);
......
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