Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 85dbace

Browse files
committed
Merge branch 'upstream-share-final-null-release' into pull-in-upstream-changes
* upstream-share-final-null-release: (233 commits) [q-w] Update Flutter SDK constraint (flutter#3323) [i-p] Update Flutter SDK constraint (flutter#3322) [d-g] Update Flutter SDK constraint (flutter#3321) [a-c] Update Flutter SDK constraint (flutter#3320) [image_picker_platform_interface] Pass Uri to package:http APIs (flutter#3309) Exclude null-safe plugins from testing on stable (flutter#3318) [documentation] [url_launcher] fix for readme code sample (flutter#3308) [camera] Add zoom support to platform interface (flutter#3312) update analysis options for nnbd (flutter#3319) [camera] Suppress unchecked cast warning in java test (flutter#3316) [image_picker] [integration_test] Fixes to make the tree green (flutter#3317) [camera] Expanded platform interface to support setting flash mode (flutter#3313) [Espresso] Android Code Inspection and Clean up (flutter#3111) [camera] Add `camera_platform_interface` package (flutter#3253) [camera] Support Android 30 (flutter#3299) bump integration test to 1.0.0 (flutter#3295) [android_alarm_manager] fix AndroidManifest.xml for android lint issue "XML tag has empty body" (flutter#3288) Use testWidgets instead of test to fix failures not surfacing on CI (flutter#3279) [file_selector_platform_interface] Migrate to cross_file package (flutter#3286) Fix broken link (flutter#3280) ...
2 parents f001090 + 0251017 commit 85dbace

File tree

1,538 files changed

+38416
-6604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,538 files changed

+38416
-6604
lines changed

.ci/Dockerfile-LinuxDesktop

+8
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ RUN sudo apt-get install -y xvfb libegl1-mesa
2121
RUN sudo apt-get install -y clang cmake ninja-build file pkg-config
2222
# Install necessary libraries.
2323
RUN sudo apt-get install -y libgtk-3-dev
24+
25+
# Add repo for Google Chrome and install it, for url_launcher tests.
26+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
27+
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list
28+
RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends google-chrome-stable
29+
# Make it the default so http: has a handler.
30+
RUN sudo apt-get install -y xdg-utils
31+
RUN xdg-settings set default-web-browser google-chrome.desktop

.ci/dev/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
This directory contains resources that the Flutter team uses during
2+
the development of plugins.
3+
4+
## Luci builder file
5+
`try_builders.json` contains the supported luci try builders
6+
for plugins. It follows format:
7+
```json
8+
{
9+
"builders":[
10+
{
11+
"name":"yyy",
12+
"repo":"plugins",
13+
"enabled":true
14+
}
15+
]
16+
}
17+
```
18+
This file will be mainly used in [`flutter/cocoon`](https://github.com/flutter/cocoon)
19+
to trigger/update pre-submit luci tasks.

.ci/dev/try_builders.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"builders":[
3+
{
4+
"name":"Windows Plugins",
5+
"repo":"plugins",
6+
"enabled":true
7+
}
8+
]
9+
}

.cirrus.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ task:
77
cpu: 8
88
memory: 16G
99
env:
10-
E2E_PATH: "./packages/e2e"
10+
INTEGRATION_TEST_PATH: "./packages/integration_test"
1111
upgrade_script:
1212
- flutter channel stable
1313
- flutter upgrade
@@ -47,9 +47,9 @@ task:
4747
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
4848
- flutter channel $CHANNEL
4949
- ./script/build_all_plugins_app.sh apk
50-
- name: e2e_web_smoke_test
51-
# Tests e2e example test in web.
52-
only_if: "changesInclude('.cirrus.yml', 'packages/e2e/**') || $CIRRUS_PR == ''"
50+
- name: integration_web_smoke_test
51+
# Tests integration example test in web.
52+
only_if: "changesInclude('.cirrus.yml', 'packages/integration_test/**') || $CIRRUS_PR == ''"
5353
install_script:
5454
- flutter config --enable-web
5555
- git clone https://github.com/flutter/web_installers.git
@@ -58,13 +58,15 @@ task:
5858
- dart lib/web_driver_installer.dart chromedriver --install-only
5959
- ./chromedriver/chromedriver --port=4444 &
6060
test_script:
61-
- cd $E2E_PATH/example/
62-
- flutter drive -v --target=test_driver/example_e2e.dart -d web-server --release --browser-name=chrome
61+
- cd $INTEGRATION_TEST_PATH/example/
62+
- flutter drive -v --driver=test_driver/integration_test.dart --target=integration_test/example_test.dart -d web-server --release --browser-name=chrome
6363
- name: build-apks+java-test+firebase-test-lab
6464
env:
6565
matrix:
66-
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2"
67-
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2"
66+
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
67+
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
68+
PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4"
69+
PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4"
6870
matrix:
6971
CHANNEL: "master"
7072
CHANNEL: "stable"
@@ -91,7 +93,7 @@ task:
9193
- echo "This user does not have permission to run Firebase Test Lab tests."
9294
- else
9395
- echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
94-
- ./script/incremental_build.sh firebase-test-lab
96+
- ./script/incremental_build.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26
9597
- fi
9698
- export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt`
9799
- export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt`
@@ -105,7 +107,7 @@ task:
105107
cpu: 8
106108
memory: 16G
107109
env:
108-
E2E_PATH: "./packages/e2e"
110+
INTEGRATION_TEST_PATH: "./packages/integration_test"
109111
upgrade_script:
110112
- flutter channel stable
111113
- flutter upgrade
@@ -157,10 +159,11 @@ task:
157159
- find . -name "*.podspec" | xargs grep -l "osx" | xargs rm
158160
# Skip the dummy podspecs used to placate the tool.
159161
- find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm
160-
- ./script/incremental_build.sh podspecs --no-analyze camera --ignore-warnings camera
162+
- ./script/incremental_build.sh podspecs
161163
- name: build-ipas+drive-examples
162164
env:
163165
PATH: $PATH:/usr/local/bin
166+
PLUGINS_TO_SKIP_XCTESTS: "battery/battery,camera/camera,connectivity/connectivity,device_info/device_info,espresso,google_maps_flutter/google_maps_flutter,google_sign_in/google_sign_in,in_app_purchase,integration_test,ios_platform_images,local_auth,package_info,path_provider/path_provider,quick_actions,sensors,shared_preferences/shared_preferences,url_launcher/url_launcher,video_player/video_player,webview_flutter,wifi_info_flutter/wifi_info_flutter"
164167
matrix:
165168
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
166169
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
@@ -177,6 +180,7 @@ task:
177180
- flutter channel $CHANNEL
178181
- ./script/incremental_build.sh build-examples --ipa
179182
- ./script/incremental_build.sh drive-examples
183+
- ./script/incremental_build.sh xctest --target RunnerUITests --skip $PLUGINS_TO_SKIP_XCTESTS
180184
task:
181185
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
182186
only_if: $CIRRUS_TAG == ''

.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BasedOnStyle: Google

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ gradle-wrapper.jar
3737
generated_plugin_registrant.dart
3838
GeneratedPluginRegistrant.h
3939
GeneratedPluginRegistrant.m
40+
generated_plugin_registrant.cc
4041
GeneratedPluginRegistrant.java
4142
GeneratedPluginRegistrant.swift
4243
build/

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ Théo Champion <[email protected]>
5858
Kazuki Yamaguchi <[email protected]>
5959
Eitan Schwartz <[email protected]>
6060
Chris Rutkowski <[email protected]>
61+
Juan Alvarez <[email protected]>
6162
Jorge Galvão <[email protected]>

CODEOWNERS

+21-19
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@
44
# These names are just suggestions. It is fine to have your changes
55
# reviewed by someone else.
66

7-
packages/android_alarm_manager/* @bkonyi
8-
packages/android_intent/* @mklim @matthew-carroll
9-
packages/battery/* @amirh @matthew-carroll
10-
packages/camera/* @bparrishMines
11-
packages/connectivity/* @cyanglaz @matthew-carroll
12-
packages/device_info/* @matthew-carroll
13-
packages/e2e/* @collinjackson @digiter
14-
packages/espresso/* @collinjackson @adazh
15-
packages/google_maps_flutter/* @cyanglaz
16-
packages/google_sign_in/* @cyanglaz @mehmetf
17-
packages/image_picker/* @cyanglaz
18-
packages/in_app_purchase/* @mklim @cyanglaz @LHLL
19-
packages/ios_platform_images/* @gaaclarke
20-
packages/package_info/* @cyanglaz @matthew-carroll
21-
packages/path_provider/* @matthew-carroll
22-
packages/shared_preferences/* @matthew-carroll
23-
packages/url_launcher/* @mklim
24-
packages/video_player/* @iskakaushik @cyanglaz
25-
packages/webview_flutter/* @amirh
7+
packages/android_alarm_manager/** @bkonyi
8+
packages/android_intent/** @mklim @matthew-carroll
9+
packages/battery/** @amirh @matthew-carroll
10+
packages/camera/** @bparrishMines
11+
packages/connectivity/** @cyanglaz @matthew-carroll
12+
packages/cross_file/** @ditman @mvanbeusekom
13+
packages/device_info/** @matthew-carroll
14+
packages/espresso/** @collinjackson @adazh
15+
packages/file_selector/** @ditman
16+
packages/google_maps_flutter/** @cyanglaz
17+
packages/google_sign_in/** @cyanglaz @mehmetf
18+
packages/image_picker/** @cyanglaz
19+
packages/integration_test/** @dnfield
20+
packages/in_app_purchase/** @mklim @cyanglaz @LHLL
21+
packages/ios_platform_images/** @gaaclarke
22+
packages/package_info/** @cyanglaz @matthew-carroll
23+
packages/path_provider/** @matthew-carroll
24+
packages/shared_preferences/** @matthew-carroll
25+
packages/url_launcher/** @mklim
26+
packages/video_player/** @iskakaushik @cyanglaz
27+
packages/webview_flutter/** @amirh

CONTRIBUTING.md

+42
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,28 @@ USB and debugging enabled on that device.
4040
* `cd packages/battery/example`
4141
* `flutter run`
4242

43+
## Setting up XCUITests
44+
45+
Sometimes, XCUITests are useful when integration testing a plugin that has native UI on iOS (e.g image_picker, in_app_purchase, camera, share, local_auth etc). Most of the time, XCUITests are not necessary, consider using [integration_test](https://pub.dev/packages/integration_test) if the tests are not focused on iOS system UI.
46+
47+
If XCUITests has always been set up for the plugin, a RunnerUITests folder under `<the_plugin>/example/ios` directory can be found.
48+
If XCUITests has not been set up for the plugin, follow these steps to set it up:
49+
50+
1. Open <path_to_plugin>/example/ios/Runner.xcworkspace using XCode.
51+
1. Create a new "UI Testing Bundle".
52+
1. In the target options window, populate details as following, then click on "Finish".
53+
* In the "product name" field, type in "RunnerUITests" (this is the test target name our CI looks for.).
54+
* In the "Team" field, select "None".
55+
* In the Organization Name field, type in "Flutter". This should usually be pre-populated.
56+
* In the organization identifer field, type in "com.google". This should usually be pre-populated.
57+
* In the Language field, select "Objective-C".
58+
* In the Project field, select the xcodeproj "Runner" (blue color).
59+
* In the Target to be Tested, select xcworkspace "Runner" (white color).
60+
1. A RunnerUITests folder should be created and you can start hacking in `RunnerUITests.m`.
61+
1. To enable the test on CI, the plugin needs to be removed from the "skip" list:
62+
* Open `./cirrus.yml` and find PLUGINS_TO_SKIP_XCTESTS.
63+
* Remove the plugin name from the list.
64+
4365
## Running the tests
4466

4567
### Integration tests
@@ -84,6 +106,26 @@ cd android
84106
./gradlew test
85107
```
86108

109+
### XCTests (iOS)
110+
111+
XCUnitTests are typically configured to run with cocoapods in this repo. To run all the XCUnitTests for a plugin:
112+
113+
```console
114+
cd ios
115+
pod lib lint --allow-warnings
116+
```
117+
118+
XCUITests aren't usually configured with cocoapods in this repo. They are configured in a xcode workspace target named RunnerUITests.
119+
To run all the XCUITests in a plugin, follow the steps in a regular iOS development workflow [here](https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/05-running_tests.html)
120+
121+
For convenience, a [flutter_plugin_tools](https://pub.dev/packages/flutter_plugin_tools) command `xctest` could also be used to run all the XCUITests in the repo:
122+
123+
```console
124+
pub global activate flutter_plugin_tools
125+
cd <path_to_plugins>/packages
126+
pub global run flutter_plugin_tools xctest --target RunnerUITests --skip <plugins_to_skip>
127+
```
128+
87129
## Contributing code
88130

89131
We gladly accept contributions via GitHub pull requests.

LICENSE

+21-23
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
Copyright 2017 The Chromium Authors. All rights reserved.
22

3-
Redistribution and use in source and binary forms, with or without
4-
modification, are permitted provided that the following conditions are
5-
met:
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
65

7-
* Redistributions of source code must retain the above copyright
8-
notice, this list of conditions and the following disclaimer.
9-
* Redistributions in binary form must reproduce the above
10-
copyright notice, this list of conditions and the following disclaimer
11-
in the documentation and/or other materials provided with the
12-
distribution.
13-
* Neither the name of Google Inc. nor the names of its
14-
contributors may be used to endorse or promote products derived from
15-
this software without specific prior written permission.
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above
9+
copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided
11+
with the distribution.
12+
* Neither the name of Google Inc. nor the names of its
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
1615

17-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)