Skip to content

Commit

Permalink
[ci] Work around Google Maps podspec lint issue
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stuartmorgan committed Jan 17, 2024
1 parent 807c2fc commit 3be0c9e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions script/tool/lib/src/podspec_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ class PodspecCheckCommand extends PackageLoopingCommand {
final String podspecBasename = podspec.basename;
print('Linting $podspecBasename');

// Hack the google_maps_flutter plugin's podspec to require iOS 13+, so that
// it gets a version of GoogleMaps that supports arm64 simulators, allowing
// linting to work on arm64 machines without forcing all plugin clients off
// of arm64 simulators.
// TODO(stuartmorgan): Remove this hack once
// https://github.com/flutter/flutter/issues/94491 is done.
String? originalPodspec;
if (podspecBasename == 'google_maps_flutter_ios.podspec') {
originalPodspec = podspec.readAsStringSync();
podspec.writeAsStringSync(
originalPodspec.replaceAll(":ios, '12.0'", ":ios, '13.0'"));
}

// Lint plugin as framework (use_frameworks!).
final ProcessResult frameworkResult =
await _runPodLint(podspecPath, libraryLint: true);
Expand All @@ -140,6 +153,10 @@ class PodspecCheckCommand extends PackageLoopingCommand {
print(libraryResult.stdout);
print(libraryResult.stderr);

if (originalPodspec != null) {
podspec.writeAsStringSync(originalPodspec);
}

return frameworkResult.exitCode == 0 && libraryResult.exitCode == 0;
}

Expand Down

0 comments on commit 3be0c9e

Please sign in to comment.