Skip to content

Commit 3be0c9e

Browse files
[ci] Work around Google Maps podspec lint issue
flutter#5873 removed a plugin-level workaround for a `podspec-lint` issue, under the incorrect belief that it was no longer necessary. Rather than re-add that, which degrades the experience for plugin clients who are targeting iOS 13+ with their apps, this adds a hack in the CI tooling itself to modify the podspec to require iOS 13 before linting. This could in theory cause false-positive lints about deprecated APIs, but currently doesn't, and that could be addressed in the unlikely event that it comes up. See flutter/flutter#94491
1 parent 807c2fc commit 3be0c9e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

script/tool/lib/src/podspec_check_command.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,19 @@ class PodspecCheckCommand extends PackageLoopingCommand {
128128
final String podspecBasename = podspec.basename;
129129
print('Linting $podspecBasename');
130130

131+
// Hack the google_maps_flutter plugin's podspec to require iOS 13+, so that
132+
// it gets a version of GoogleMaps that supports arm64 simulators, allowing
133+
// linting to work on arm64 machines without forcing all plugin clients off
134+
// of arm64 simulators.
135+
// TODO(stuartmorgan): Remove this hack once
136+
// https://github.com/flutter/flutter/issues/94491 is done.
137+
String? originalPodspec;
138+
if (podspecBasename == 'google_maps_flutter_ios.podspec') {
139+
originalPodspec = podspec.readAsStringSync();
140+
podspec.writeAsStringSync(
141+
originalPodspec.replaceAll(":ios, '12.0'", ":ios, '13.0'"));
142+
}
143+
131144
// Lint plugin as framework (use_frameworks!).
132145
final ProcessResult frameworkResult =
133146
await _runPodLint(podspecPath, libraryLint: true);
@@ -140,6 +153,10 @@ class PodspecCheckCommand extends PackageLoopingCommand {
140153
print(libraryResult.stdout);
141154
print(libraryResult.stderr);
142155

156+
if (originalPodspec != null) {
157+
podspec.writeAsStringSync(originalPodspec);
158+
}
159+
143160
return frameworkResult.exitCode == 0 && libraryResult.exitCode == 0;
144161
}
145162

0 commit comments

Comments
 (0)