From 2fc19619e8b30665ed76834e14bb59ea594494bb Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Fri, 9 Feb 2024 10:32:10 -0800 Subject: [PATCH] Set plugin template minimum iOS version to 12.0 (#143167) Fixes https://github.com/flutter/flutter/issues/140474 See https://github.com/flutter/flutter/pull/122625 where this was done 11->12. --- dev/devicelab/lib/tasks/plugin_tests.dart | 2 +- .../templates/plugin/ios-objc.tmpl/projectName.podspec.tmpl | 2 +- .../plugin/ios-swift.tmpl/projectName.podspec.tmpl | 2 +- .../templates/plugin_ffi/ios.tmpl/projectName.podspec.tmpl | 2 +- .../test/commands.shard/permeable/create_test.dart | 6 +++--- packages/integration_test/ios/integration_test.podspec | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dev/devicelab/lib/tasks/plugin_tests.dart b/dev/devicelab/lib/tasks/plugin_tests.dart index 7179ecd8b5b..21b9883906f 100644 --- a/dev/devicelab/lib/tasks/plugin_tests.dart +++ b/dev/devicelab/lib/tasks/plugin_tests.dart @@ -429,7 +429,7 @@ end throw TaskResult.failure('podspec file missing at ${podspec.path}'); } final String versionString = target == 'ios' - ? "s.platform = :ios, '11.0'" + ? "s.platform = :ios, '12.0'" : "s.platform = :osx, '10.11'"; String podspecContent = podspec.readAsStringSync(); if (!podspecContent.contains(versionString)) { diff --git a/packages/flutter_tools/templates/plugin/ios-objc.tmpl/projectName.podspec.tmpl b/packages/flutter_tools/templates/plugin/ios-objc.tmpl/projectName.podspec.tmpl index e44da71ca78..375c9a211b5 100644 --- a/packages/flutter_tools/templates/plugin/ios-objc.tmpl/projectName.podspec.tmpl +++ b/packages/flutter_tools/templates/plugin/ios-objc.tmpl/projectName.podspec.tmpl @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' - s.platform = :ios, '11.0' + s.platform = :ios, '12.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/packages/flutter_tools/templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl b/packages/flutter_tools/templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl index bbdb51c6628..c47c9b0d869 100644 --- a/packages/flutter_tools/templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl +++ b/packages/flutter_tools/templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl @@ -15,7 +15,7 @@ Pod::Spec.new do |s| s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' - s.platform = :ios, '11.0' + s.platform = :ios, '12.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/packages/flutter_tools/templates/plugin_ffi/ios.tmpl/projectName.podspec.tmpl b/packages/flutter_tools/templates/plugin_ffi/ios.tmpl/projectName.podspec.tmpl index 7a5c3049360..4ac2461baef 100644 --- a/packages/flutter_tools/templates/plugin_ffi/ios.tmpl/projectName.podspec.tmpl +++ b/packages/flutter_tools/templates/plugin_ffi/ios.tmpl/projectName.podspec.tmpl @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' - s.platform = :ios, '11.0' + s.platform = :ios, '12.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index 7aa66e30973..c7ddefa5536 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -2849,7 +2849,7 @@ void main() { expect(env['flutter']!.allows(Version(3, 2, 9)), false); }); - testUsingContext('newly created iOS plugins has min iOS version of 11.0', () async { + testUsingContext('newly created iOS plugins has correct min iOS version', () async { Cache.flutterRoot = '../..'; final String flutterToolsAbsolutePath = globals.fs.path.join( Cache.flutterRoot!, @@ -2882,7 +2882,7 @@ void main() { for (final String templatePath in iosPluginTemplates) { final String rawTemplate = globals.fs.file(templatePath).readAsStringSync(); - expect(rawTemplate, contains("s.platform = :ios, '11.0'")); + expect(rawTemplate, contains("s.platform = :ios, '12.0'")); } final CreateCommand command = CreateCommand(); @@ -2892,7 +2892,7 @@ void main() { expect(projectDir.childDirectory('ios').childFile('flutter_project.podspec'), exists); final String rawPodSpec = await projectDir.childDirectory('ios').childFile('flutter_project.podspec').readAsString(); - expect(rawPodSpec, contains("s.platform = :ios, '11.0'")); + expect(rawPodSpec, contains("s.platform = :ios, '12.0'")); }); testUsingContext('default app uses flutter default versions', () async { diff --git a/packages/integration_test/ios/integration_test.podspec b/packages/integration_test/ios/integration_test.podspec index 0a67820711e..d2a8440dcc6 100644 --- a/packages/integration_test/ios/integration_test.podspec +++ b/packages/integration_test/ios/integration_test.podspec @@ -20,6 +20,6 @@ LICENSE s.dependency 'Flutter' s.ios.framework = 'UIKit' - s.platform = :ios, '11.0' + s.platform = :ios, '12.0' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } end