-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[google_maps_flutter] Add examples for different iOS versions (#3757)
Improves the way we specify and test the `GoogleMaps` SDK dependency on iOS. Currently as discussed in flutter/flutter#86820, we are allowing any version of the SDK, and CocoaPods will choose the best version that's compatible with the minimum iOS deployment version of the plugin client's app. However, clients are also subject to future breakage, since any new major SDK version could have compile-time incompatibility with the plugin's wrapping code. We also have no ability to test anything in CI that's newer than the SDK that supports our oldest supported version (currently that's iOS 11, and thus 5.x). This makes two changes: - Replaces the single example with N examples, each with a different minimum iOS version, corresponding to each point where the Google Maps SDK has bumped its minimum iOS requirement. Currently (as documented in the new README file) - The oldest example has all of the current testing. - The newest example has just XCTests (not integration or XCUITests). - Intervening examples have no tests. - Instead of the completely unpinned version, we allow anything up to the next major version (which should be the first one with breaking API changes). This gives us build coverage of each of the (latest at CI runtime) resolve points that clients can have. We retain the flexibility of allowing clients to get the best version that meets their app's constraints, except that we will need to explicitly test and enable new major versions, so that they won't randomly break clients. Fixes flutter/flutter#86820
- Loading branch information
1 parent
746750e
commit 7e3f5da
Showing
168 changed files
with
3,039 additions
and
87 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 44 additions & 7 deletions
51
packages/google_maps_flutter/google_maps_flutter_ios/example/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,46 @@ | ||
# Platform Implementation Test App | ||
# Platform Implementation Test Apps | ||
|
||
This is a test app for manual testing and automated integration testing | ||
of this platform implementation. It is not intended to demonstrate actual use of | ||
this package, since the intent is that plugin clients use the app-facing | ||
package. | ||
These are test apps for manual testing and automated integration testing | ||
of this platform implementation. They are not intended to demonstrate actual | ||
use of this package, since the intent is that plugin clients use the | ||
app-facing package. | ||
|
||
Unless you are making changes to this implementation package, this example is | ||
very unlikely to be relevant. | ||
Unless you are making changes to this implementation package, these examples | ||
are very unlikely to be relevant. | ||
|
||
## Structure | ||
|
||
This package contains multiple exmaples, which are used to test different | ||
versions of the Google Maps iOS SDK. Because the plugin's dependency | ||
is loosely pinned, CocoaPods will pick the newest version that supports the | ||
minimum targetted OS version of the application using the plugin. In | ||
order to ensure that the plugin continues to compile against all | ||
SDK versions that could resolve, there are multiple largely identical | ||
examples, each with a different minimum target iOS version. | ||
|
||
In order to avoid wasting CI resources, tests are mostly not duplicated. | ||
The test structure is: | ||
* The oldest version has all of the usual tests (Dart integration, | ||
XCTest, XCUITest). | ||
* The newest version has only XCTests (the cheapest tests), which | ||
can be used to unit tests any code paths that are specific to | ||
new SDKs (e.g., behind target OS `#if` checks). | ||
|
||
This setup is based on the assumption (based on experience so far) that | ||
the changes in the SDK are unlikely to break functionality at runtime, | ||
but that we will want to have unit test coverage of new-SDK-only code. | ||
New test types can be added to any example if needs change. | ||
|
||
## Updating Examples | ||
|
||
* When a new major of the SDK comes out that raises the minimum | ||
iOS deployment version, a new example with that minimum target | ||
should be added to ensure that the plugin compiles with that | ||
version of the SDK, and the range in the plugin's `podspec` file | ||
should be bumped to the next major version. | ||
* When the minimum supported version of Flutter (on `stable`) | ||
reaches the point where the oldest example is for an SDK | ||
that can no longer be resolved to, that example should be | ||
removed, and all of its testing (Dart integration tests, | ||
native unit tests, native UI tests) should be folded into | ||
the next-oldest version. |
13 changes: 13 additions & 0 deletions
13
packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Platform Implementation Test App | ||
|
||
This is a test app for manual testing and automated integration testing | ||
of this platform implementation. It is not intended to demonstrate actual use of | ||
this package, since the intent is that plugin clients use the app-facing | ||
package. | ||
|
||
Unless you are making changes to this implementation package, this example is | ||
very unlikely to be relevant. | ||
|
||
## Versions | ||
|
||
This example requires iOS 11, so will select a 5.x GoogleMaps SDK version. |
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions
43
packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/lib/main.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:maps_example_dart/animate_camera.dart'; | ||
import 'package:maps_example_dart/lite_mode.dart'; | ||
import 'package:maps_example_dart/map_click.dart'; | ||
import 'package:maps_example_dart/map_coordinates.dart'; | ||
import 'package:maps_example_dart/map_ui.dart'; | ||
import 'package:maps_example_dart/maps_demo.dart'; | ||
import 'package:maps_example_dart/marker_icons.dart'; | ||
import 'package:maps_example_dart/move_camera.dart'; | ||
import 'package:maps_example_dart/padding.dart'; | ||
import 'package:maps_example_dart/page.dart'; | ||
import 'package:maps_example_dart/place_circle.dart'; | ||
import 'package:maps_example_dart/place_marker.dart'; | ||
import 'package:maps_example_dart/place_polygon.dart'; | ||
import 'package:maps_example_dart/place_polyline.dart'; | ||
import 'package:maps_example_dart/scrolling_map.dart'; | ||
import 'package:maps_example_dart/snapshot.dart'; | ||
import 'package:maps_example_dart/tile_overlay.dart'; | ||
|
||
void main() { | ||
runApp(const MaterialApp( | ||
home: MapsDemo(<GoogleMapExampleAppPage>[ | ||
MapUiPage(), | ||
MapCoordinatesPage(), | ||
MapClickPage(), | ||
AnimateCameraPage(), | ||
MoveCameraPage(), | ||
PlaceMarkerPage(), | ||
MarkerIconsPage(), | ||
ScrollingMapPage(), | ||
PlacePolylinePage(), | ||
PlacePolygonPage(), | ||
PlaceCirclePage(), | ||
PaddingPage(), | ||
SnapshotPage(), | ||
LiteModePage(), | ||
TileOverlayPage(), | ||
]))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Platform Implementation Test App | ||
|
||
This is a test app for manual testing and automated integration testing | ||
of this platform implementation. It is not intended to demonstrate actual use of | ||
this package, since the intent is that plugin clients use the app-facing | ||
package. | ||
|
||
Unless you are making changes to this implementation package, this example is | ||
very unlikely to be relevant. | ||
|
||
## Versions | ||
|
||
This example requires iOS 12, so will select a 6.x GoogleMaps SDK version. |
Binary file added
BIN
+304 Bytes
...e_maps_flutter/google_maps_flutter_ios/example/ios12/assets/2.0x/red_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+312 Bytes
...e_maps_flutter/google_maps_flutter_ios/example/ios12/assets/3.0x/red_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
162 changes: 162 additions & 0 deletions
162
packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/assets/night_mode.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
[ | ||
{ | ||
"elementType": "geometry", | ||
"stylers": [ | ||
{ | ||
"color": "#242f3e" | ||
} | ||
] | ||
}, | ||
{ | ||
"elementType": "labels.text.fill", | ||
"stylers": [ | ||
{ | ||
"color": "#746855" | ||
} | ||
] | ||
}, | ||
{ | ||
"elementType": "labels.text.stroke", | ||
"stylers": [ | ||
{ | ||
"color": "#242f3e" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "administrative.locality", | ||
"elementType": "labels.text.fill", | ||
"stylers": [ | ||
{ | ||
"color": "#d59563" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "poi", | ||
"elementType": "labels.text.fill", | ||
"stylers": [ | ||
{ | ||
"color": "#d59563" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "poi.park", | ||
"elementType": "geometry", | ||
"stylers": [ | ||
{ | ||
"color": "#263c3f" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "poi.park", | ||
"elementType": "labels.text.fill", | ||
"stylers": [ | ||
{ | ||
"color": "#6b9a76" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "road", | ||
"elementType": "geometry", | ||
"stylers": [ | ||
{ | ||
"color": "#38414e" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "road", | ||
"elementType": "geometry.stroke", | ||
"stylers": [ | ||
{ | ||
"color": "#212a37" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "road", | ||
"elementType": "labels.text.fill", | ||
"stylers": [ | ||
{ | ||
"color": "#9ca5b3" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "road.highway", | ||
"elementType": "geometry", | ||
"stylers": [ | ||
{ | ||
"color": "#746855" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "road.highway", | ||
"elementType": "geometry.stroke", | ||
"stylers": [ | ||
{ | ||
"color": "#1f2835" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "road.highway", | ||
"elementType": "labels.text.fill", | ||
"stylers": [ | ||
{ | ||
"color": "#f3d19c" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "transit", | ||
"elementType": "geometry", | ||
"stylers": [ | ||
{ | ||
"color": "#2f3948" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "transit.station", | ||
"elementType": "labels.text.fill", | ||
"stylers": [ | ||
{ | ||
"color": "#d59563" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "water", | ||
"elementType": "geometry", | ||
"stylers": [ | ||
{ | ||
"color": "#17263c" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "water", | ||
"elementType": "labels.text.fill", | ||
"stylers": [ | ||
{ | ||
"color": "#515c6d" | ||
} | ||
] | ||
}, | ||
{ | ||
"featureType": "water", | ||
"elementType": "labels.text.stroke", | ||
"stylers": [ | ||
{ | ||
"color": "#17263c" | ||
} | ||
] | ||
} | ||
] | ||
|
Binary file added
BIN
+195 Bytes
...google_maps_flutter/google_maps_flutter_ios/example/ios12/assets/red_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions
30
...gle_maps_flutter/google_maps_flutter_ios/example/ios12/ios/Flutter/AppFrameworkInfo.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>App</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>io.flutter.flutter.app</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>App</string> | ||
<key>CFBundlePackageType</key> | ||
<string>FMWK</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
<key>UIRequiredDeviceCapabilities</key> | ||
<array> | ||
<string>arm64</string> | ||
</array> | ||
<key>MinimumOSVersion</key> | ||
<string>12.0</string> | ||
</dict> | ||
</plist> |
2 changes: 2 additions & 0 deletions
2
...ages/google_maps_flutter/google_maps_flutter_ios/example/ios12/ios/Flutter/Debug.xcconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
#include "Generated.xcconfig" |
2 changes: 2 additions & 0 deletions
2
...es/google_maps_flutter/google_maps_flutter_ios/example/ios12/ios/Flutter/Release.xcconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
#include "Generated.xcconfig" |
41 changes: 41 additions & 0 deletions
41
packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/ios/Podfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Uncomment this line to define a global platform for your project | ||
platform :ios, '12.0' | ||
|
||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. | ||
ENV['COCOAPODS_DISABLE_STATS'] = 'true' | ||
|
||
project 'Runner', { | ||
'Debug' => :debug, | ||
'Profile' => :release, | ||
'Release' => :release, | ||
} | ||
|
||
def flutter_root | ||
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) | ||
unless File.exist?(generated_xcode_build_settings_path) | ||
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" | ||
end | ||
|
||
File.foreach(generated_xcode_build_settings_path) do |line| | ||
matches = line.match(/FLUTTER_ROOT\=(.*)/) | ||
return matches[1].strip if matches | ||
end | ||
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" | ||
end | ||
|
||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) | ||
|
||
flutter_ios_podfile_setup | ||
|
||
target 'Runner' do | ||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) | ||
end | ||
|
||
post_install do |installer| | ||
installer.pods_project.targets.each do |target| | ||
flutter_additional_ios_build_settings(target) | ||
target.build_configurations.each do |build_configuration| | ||
build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' | ||
end | ||
end | ||
end |
Oops, something went wrong.