Unverified Commit 2fc19619 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

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.
parent 2207a307
...@@ -429,7 +429,7 @@ end ...@@ -429,7 +429,7 @@ end
throw TaskResult.failure('podspec file missing at ${podspec.path}'); throw TaskResult.failure('podspec file missing at ${podspec.path}');
} }
final String versionString = target == 'ios' final String versionString = target == 'ios'
? "s.platform = :ios, '11.0'" ? "s.platform = :ios, '12.0'"
: "s.platform = :osx, '10.11'"; : "s.platform = :osx, '10.11'";
String podspecContent = podspec.readAsStringSync(); String podspecContent = podspec.readAsStringSync();
if (!podspecContent.contains(versionString)) { if (!podspecContent.contains(versionString)) {
......
...@@ -16,7 +16,7 @@ Pod::Spec.new do |s| ...@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*' s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h' s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter' s.dependency 'Flutter'
s.platform = :ios, '11.0' s.platform = :ios, '12.0'
# Flutter.framework does not contain a i386 slice. # Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
......
...@@ -15,7 +15,7 @@ Pod::Spec.new do |s| ...@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.source = { :path => '.' } s.source = { :path => '.' }
s.source_files = 'Classes/**/*' s.source_files = 'Classes/**/*'
s.dependency 'Flutter' s.dependency 'Flutter'
s.platform = :ios, '11.0' s.platform = :ios, '12.0'
# Flutter.framework does not contain a i386 slice. # Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
......
...@@ -20,7 +20,7 @@ Pod::Spec.new do |s| ...@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
s.source = { :path => '.' } s.source = { :path => '.' }
s.source_files = 'Classes/**/*' s.source_files = 'Classes/**/*'
s.dependency 'Flutter' s.dependency 'Flutter'
s.platform = :ios, '11.0' s.platform = :ios, '12.0'
# Flutter.framework does not contain a i386 slice. # Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
......
...@@ -2849,7 +2849,7 @@ void main() { ...@@ -2849,7 +2849,7 @@ void main() {
expect(env['flutter']!.allows(Version(3, 2, 9)), false); 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 = '../..'; Cache.flutterRoot = '../..';
final String flutterToolsAbsolutePath = globals.fs.path.join( final String flutterToolsAbsolutePath = globals.fs.path.join(
Cache.flutterRoot!, Cache.flutterRoot!,
...@@ -2882,7 +2882,7 @@ void main() { ...@@ -2882,7 +2882,7 @@ void main() {
for (final String templatePath in iosPluginTemplates) { for (final String templatePath in iosPluginTemplates) {
final String rawTemplate = globals.fs.file(templatePath).readAsStringSync(); 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(); final CreateCommand command = CreateCommand();
...@@ -2892,7 +2892,7 @@ void main() { ...@@ -2892,7 +2892,7 @@ void main() {
expect(projectDir.childDirectory('ios').childFile('flutter_project.podspec'), expect(projectDir.childDirectory('ios').childFile('flutter_project.podspec'),
exists); exists);
final String rawPodSpec = await projectDir.childDirectory('ios').childFile('flutter_project.podspec').readAsString(); 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 { testUsingContext('default app uses flutter default versions', () async {
......
...@@ -20,6 +20,6 @@ LICENSE ...@@ -20,6 +20,6 @@ LICENSE
s.dependency 'Flutter' s.dependency 'Flutter'
s.ios.framework = 'UIKit' 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' } s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
end end
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