Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit e6e35a2

Browse files
Pull in main branch into v4_webview (#6661)
1 parent a625523 commit e6e35a2

File tree

562 files changed

+10277
-4226
lines changed

Some content is hidden

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

562 files changed

+10277
-4226
lines changed

.ci/Dockerfile

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,40 @@
11
# The Flutter version is not important here, since the CI scripts update Flutter
22
# before running. What matters is that the base image is pinned to minimize
33
# unintended changes when modifying this file.
4-
FROM cirrusci/flutter@sha256:505fe8bce2896c75b4df9ccf500b1604155bf932af7465ffcc66fcae8612f82f
4+
# This is the hash for the 3.0.0 image.
5+
FROM cirrusci/flutter@sha256:0224587bba33241cf908184283ec2b544f1b672d87043ead1c00521c368cf844
56

67
RUN apt-get update -y
78

9+
# Set up Firebase Test Lab requirements.
810
RUN apt-get install -y --no-install-recommends gnupg
9-
10-
# Add repo for gcloud sdk and install it
1111
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
1212
sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
13-
1413
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
1514
sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
16-
1715
RUN apt-get update && apt-get install -y google-cloud-sdk && \
1816
gcloud config set core/disable_usage_reporting true && \
1917
gcloud config set component_manager/disable_update_check true
2018

21-
RUN yes | sdkmanager \
22-
"platforms;android-27" \
23-
"build-tools;27.0.3" \
24-
"extras;google;m2repository" \
25-
"extras;android;m2repository"
26-
27-
RUN yes | sdkmanager --licenses
28-
29-
# Install formatter.
19+
# Install formatter for C-based languages.
3020
RUN apt-get install -y clang-format
3121

32-
# Install xvfb to allow running headless
33-
RUN apt-get install -y xvfb libegl1-mesa
34-
# Install Linux desktop build tool requirements.
22+
# Install Linux desktop requirements:
23+
# - build tools.
3524
RUN apt-get install -y clang cmake ninja-build file pkg-config
36-
# Install necessary libraries.
25+
# - libraries.
3726
RUN apt-get install -y libgtk-3-dev libblkid-dev liblzma-dev libgcrypt20-dev
27+
# - xvfb to allow running headless.
28+
RUN apt-get install -y xvfb libegl1-mesa
3829

39-
# Add repo for Google Chrome and install it
30+
# Install Chrome and make it the default browser, for url_launcher tests.
31+
# IMPORTANT: Web tests should use a pinned version of Chromium, not this, since
32+
# this isn't pinned, so any time the docker image is re-created the version of
33+
# Chrome may change.
4034
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
4135
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list
4236
RUN apt-get update && apt-get install -y --no-install-recommends google-chrome-stable
43-
44-
# Make Chrome the default so http: and file: has a handler for url_launcher tests.
37+
# Make Chrome the default for http:, https: and file:.
4538
RUN apt-get install -y xdg-utils
4639
RUN xdg-settings set default-web-browser google-chrome.desktop
4740
RUN xdg-mime default google-chrome.desktop inode/directory

.ci/flutter_master.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
99475b1b0bee6ab09d0282b255c6b8c7e01ca4fe
1+
0e98194681fdd83ee1c0a90b8b5b176df121bf1e

.ci/flutter_stable.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e3c29ec00c9c825c891d75054c63fcc46454dca1
1+
6928314d505d2bb4777be05e45d7808a5aa91d2a

.ci/scripts/build_all_plugins.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
cd all_plugins
6+
cd all_packages
77
flutter build windows --debug
88
flutter build windows --release

.ci/scripts/create_all_plugins_app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
dart ./script/tool/bin/flutter_plugin_tools.dart all-plugins-app \
6+
dart ./script/tool/bin/flutter_plugin_tools.dart create-all-packages-app \
77
--output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml

.ci/scripts/prepare_tool.sh

100644100755
File mode changed.

.cirrus.yml

Lines changed: 65 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@ gcp_credentials: ENCRYPTED[!f1177d1ddb5330ffaa9ea11c9c9e8e0c542185e895c36071f18c
44
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'main')
55
env:
66
CHANNEL: "master" # Default to master when not explicitly set by a task.
7-
PLUGIN_TOOL: "./script/tool/bin/flutter_plugin_tools.dart"
7+
PLUGIN_TOOL_COMMAND: "dart ./script/tool/bin/flutter_plugin_tools.dart"
88

99
tool_setup_template: &TOOL_SETUP_TEMPLATE
1010
tool_setup_script:
11-
- git fetch origin main # To set FETCH_HEAD for "git merge-base" to work
12-
- cd script/tool
13-
- dart pub get
11+
- .ci/scripts/prepare_tool.sh
12+
13+
macos_template: &MACOS_TEMPLATE
14+
# Only one macOS task can run in parallel without credits, so use them for
15+
# PRs on macOS.
16+
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
17+
18+
macos_intel_template: &MACOS_INTEL_TEMPLATE
19+
<< : *MACOS_TEMPLATE
20+
osx_instance:
21+
image: big-sur-xcode-13
22+
23+
macos_arm_template: &MACOS_ARM_TEMPLATE
24+
<< : *MACOS_TEMPLATE
25+
macos_instance:
26+
image: ghcr.io/cirruslabs/macos-ventura-xcode:14
1427

1528
flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
1629
upgrade_flutter_script:
@@ -39,33 +52,18 @@ flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
3952

4053
build_all_plugins_app_template: &BUILD_ALL_PLUGINS_APP_TEMPLATE
4154
create_all_plugins_app_script:
42-
- dart $PLUGIN_TOOL all-plugins-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
55+
- $PLUGIN_TOOL_COMMAND create-all-packages-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
4356
build_all_plugins_debug_script:
44-
- cd all_plugins
57+
- cd all_packages
4558
- if [[ "$BUILD_ALL_ARGS" == "web" ]]; then
4659
- echo "Skipping; web does not support debug builds"
4760
- else
4861
- flutter build $BUILD_ALL_ARGS --debug
4962
- fi
5063
build_all_plugins_release_script:
51-
- cd all_plugins
64+
- cd all_packages
5265
- flutter build $BUILD_ALL_ARGS --release
5366

54-
macos_template: &MACOS_TEMPLATE
55-
# Only one macOS task can run in parallel without credits, so use them for
56-
# PRs on macOS.
57-
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
58-
59-
macos_intel_template: &MACOS_INTEL_TEMPLATE
60-
<< : *MACOS_TEMPLATE
61-
osx_instance:
62-
image: big-sur-xcode-13
63-
64-
macos_arm_template: &MACOS_ARM_TEMPLATE
65-
<< : *MACOS_TEMPLATE
66-
macos_instance:
67-
image: ghcr.io/cirruslabs/macos-ventura-xcode:14
68-
6967
# Light-workload Linux tasks.
7068
# These use default machines, with fewer CPUs, to reduce pressure on the
7169
# concurrency limits.
@@ -84,22 +82,13 @@ task:
8482
script:
8583
- cd script/tool
8684
- dart pub run test
87-
- name: publishable
88-
version_check_script:
89-
# For pre-submit, pass the PR labels to the script to allow for version
90-
# check overrides.
91-
# For post-submit, ignore platform version breaking version changes and
92-
# missing version/CHANGELOG detection since the labels aren't
93-
# available outside of the context of the PR.
94-
- if [[ $CIRRUS_PR == "" ]]; then
95-
- ./script/tool_runner.sh version-check --ignore-platform-interface-breaks
96-
- else
97-
- ./script/tool_runner.sh version-check --check-for-missing-changes --pr-labels="$CIRRUS_PR_LABELS"
98-
- fi
99-
publish_check_script: ./script/tool_runner.sh publish-check
100-
- name: format
85+
# Repository rules and best-practice enforcement.
86+
# Only channel-agnostic tests should go here since it is only run once
87+
# (on Flutter master).
88+
- name: repo_checks
10189
always:
10290
format_script: ./script/tool_runner.sh format --fail-on-change
91+
license_script: $PLUGIN_TOOL_COMMAND license-check
10392
pubspec_script: ./script/tool_runner.sh pubspec-check
10493
readme_script:
10594
- ./script/tool_runner.sh readme-check
@@ -108,19 +97,33 @@ task:
10897
# has been fixed, this can be removed and there can just be a single
10998
# run with --require-excerpts and no exclusions.
11099
- ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml
111-
license_script: dart $PLUGIN_TOOL license-check
112-
dependabot_script: dart $PLUGIN_TOOL dependabot-check
113-
- name: federated_safety
114-
# This check is only meaningful for PRs, as it validates changes
115-
# rather than state.
116-
only_if: $CIRRUS_PR != ""
117-
script: ./script/tool_runner.sh federation-safety-check
100+
dependabot_script: $PLUGIN_TOOL_COMMAND dependabot-check
101+
version_script:
102+
# For pre-submit, pass the PR labels to the script to allow for
103+
# check overrides.
104+
# For post-submit, ignore platform version breaking version changes
105+
# and missing version/CHANGELOG detection since the labels aren't
106+
# available outside of the context of the PR.
107+
- if [[ $CIRRUS_PR == "" ]]; then
108+
- ./script/tool_runner.sh version-check --ignore-platform-interface-breaks
109+
- else
110+
- ./script/tool_runner.sh version-check --check-for-missing-changes --pr-labels="$CIRRUS_PR_LABELS"
111+
- fi
112+
publishable_script: ./script/tool_runner.sh publish-check --allow-pre-release
113+
federated_safety_script:
114+
# This check is only meaningful for PRs, as it validates changes
115+
# rather than state.
116+
- if [[ $CIRRUS_PR == "" ]]; then
117+
- ./script/tool_runner.sh federation-safety-check
118+
- else
119+
- echo "Only run in presubmit"
120+
- fi
118121
- name: dart_unit_tests
119122
env:
120123
matrix:
121124
CHANNEL: "master"
122125
CHANNEL: "stable"
123-
test_script:
126+
unit_test_script:
124127
- ./script/tool_runner.sh test
125128
- name: analyze
126129
env:
@@ -142,39 +145,42 @@ task:
142145
# This uses --run-on-dirty-packages rather than --packages-for-branch
143146
# since only the packages changed by 'make-deps-path-based' need to be
144147
# checked.
145-
- dart $PLUGIN_TOOL analyze --run-on-dirty-packages --log-timing --custom-analysis=script/configs/custom_analysis.yaml
148+
- $PLUGIN_TOOL_COMMAND analyze --run-on-dirty-packages --log-timing --custom-analysis=script/configs/custom_analysis.yaml
146149
# Restore the tree to a clean state, to avoid accidental issues if
147150
# other script steps are added to this task.
148151
- git checkout .
149-
# Does a sanity check that plugins at least pass analysis on the N-1 and N-2
150-
# versions of Flutter stable if the plugin claims to support that version.
152+
# Does a sanity check that packages at least pass analysis on the N-1 and N-2
153+
# versions of Flutter stable if the package claims to support that version.
151154
# This is to minimize accidentally making changes that break old versions
152155
# (which we don't commit to supporting, but don't want to actively break)
153156
# without updating the constraints.
154157
# Note: The versions below should be manually updated after a new stable
155158
# version comes out.
156-
- name: legacy-version-analyze
159+
- name: legacy_version_analyze
157160
depends_on: analyze
158-
env:
159-
matrix:
161+
matrix:
162+
env:
160163
CHANNEL: "3.0.5"
164+
DART_VERSION: "2.17.6"
165+
env:
161166
CHANNEL: "2.10.5"
167+
DART_VERSION: "2.16.2"
162168
package_prep_script:
163-
# Allow analyzing plugins that use a Pigeon version with a higher
164-
# minimum Flutter/Dart version than the plugin itself.
169+
# Allow analyzing packages that use a dev dependency with a higher
170+
# minimum Flutter/Dart version than the package itself.
165171
- ./script/tool_runner.sh remove-dev-dependencies
166172
analyze_script:
167173
# Only analyze lib/; non-client code doesn't need to work on
168174
# all supported legacy version.
169-
- ./script/tool_runner.sh analyze --lib-only --skip-if-not-supporting-flutter-version="$CHANNEL" --custom-analysis=script/configs/custom_analysis.yaml
170-
# Does a sanity check that plugins pass analysis with the lowest possible
175+
- ./script/tool_runner.sh analyze --lib-only --skip-if-not-supporting-flutter-version="$CHANNEL" --skip-if-not-supporting-dart-version="$DART_VERSION" --custom-analysis=script/configs/custom_analysis.yaml
176+
# Does a sanity check that packages pass analysis with the lowest possible
171177
# versions of all dependencies. This is to catch cases where we add use of
172-
# new APIs but forget to update minimum versions of dependencies to when
178+
# new APIs but forget to update minimum versions of dependencies to where
173179
# those APIs are introduced.
174180
- name: downgraded_analyze
175181
depends_on: analyze
176182
analyze_script:
177-
- ./script/tool_runner.sh analyze --downgrade
183+
- ./script/tool_runner.sh analyze --downgrade --custom-analysis=script/configs/custom_analysis.yaml
178184
- name: readme_excerpts
179185
env:
180186
CIRRUS_CLONE_SUBMODULES: true
@@ -194,8 +200,6 @@ task:
194200
matrix:
195201
CHANNEL: "master"
196202
CHANNEL: "stable"
197-
setup_script:
198-
- flutter config --enable-linux-desktop
199203
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
200204
- name: linux-platform_tests
201205
# Don't run full platform tests on both channels in pre-submit.
@@ -205,7 +209,6 @@ task:
205209
CHANNEL: "master"
206210
CHANNEL: "stable"
207211
build_script:
208-
- flutter config --enable-linux-desktop
209212
- ./script/tool_runner.sh build-examples --linux
210213
native_test_script:
211214
- xvfb-run ./script/tool_runner.sh native-test --linux --no-integration
@@ -244,38 +247,20 @@ task:
244247
MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550]
245248
GCLOUD_FIREBASE_TESTLAB_KEY: ENCRYPTED[30e6cf7189e3ff3868edc25d2e638ef2aec70546456427064bbc74b297d36145364f49f9d26b327787a59df149d69262]
246249
build_script:
247-
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
248-
# might include non-ASCII characters which makes Gradle crash.
249-
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
250-
- export CIRRUS_CHANGE_MESSAGE=""
251-
- export CIRRUS_COMMIT_MESSAGE=""
252250
- ./script/tool_runner.sh build-examples --apk
253251
lint_script:
254-
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
255-
# might include non-ASCII characters which makes Gradle crash.
256-
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
257-
- export CIRRUS_CHANGE_MESSAGE=""
258-
- export CIRRUS_COMMIT_MESSAGE=""
259252
- ./script/tool_runner.sh lint-android # must come after build-examples
260253
native_unit_test_script:
261-
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
262-
# might include non-ASCII characters which makes Gradle crash.
263-
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
264-
- export CIRRUS_CHANGE_MESSAGE=""
265-
- export CIRRUS_COMMIT_MESSAGE=""
266254
# Native integration tests are handled by firebase-test-lab below, so
267255
# only run unit tests.
268256
# Must come after build-examples.
269257
- ./script/tool_runner.sh native-test --android --no-integration --exclude script/configs/exclude_native_unit_android.yaml
270258
firebase_test_lab_script:
271-
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
272-
# might include non-ASCII characters which makes Gradle crash.
273-
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
274-
- export CIRRUS_CHANGE_MESSAGE=""
275-
- export CIRRUS_COMMIT_MESSAGE=""
276259
- if [[ -n "$GCLOUD_FIREBASE_TESTLAB_KEY" ]]; then
277260
- echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
278-
- ./script/tool_runner.sh firebase-test-lab --device model=redfin,version=30 --device model=starqlteue,version=26 --exclude=script/configs/exclude_integration_android.yaml
261+
# (TODO)cyanglaz: add --device model=starqlteue,version=26 back when the device issue is fixed in FTL.
262+
# https://github.com/flutter/flutter/issues/114535
263+
- ./script/tool_runner.sh firebase-test-lab --device model=redfin,version=30 --exclude=script/configs/exclude_integration_android.yaml
279264
- else
280265
- echo "This user does not have permission to run Firebase Test Lab tests."
281266
- fi
@@ -339,7 +324,6 @@ task:
339324
CHANNEL: "stable"
340325
PATH: $PATH:/usr/local/bin
341326
build_script:
342-
- flutter config --enable-macos-desktop
343327
- ./script/tool_runner.sh build-examples --macos
344328
xcode_analyze_script:
345329
- ./script/tool_runner.sh xcode-analyze --macos
@@ -408,5 +392,4 @@ task:
408392
CHANNEL: "master"
409393
CHANNEL: "stable"
410394
setup_script:
411-
- flutter config --enable-macos-desktop
412395
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE

.github/workflows/pull_request_label.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
pull-requests: write
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/labeler@e54e5b338fbd6e6cdb5d60f51c22335fc57c401e
24+
- uses: actions/labeler@5c7539237e04b714afd8ad9b4aed733815b9fab4
2525
with:
2626
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2727
sync-labels: true

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
cd $GITHUB_WORKSPACE
2828
# Checks out a copy of the repo.
2929
- name: Check out code
30-
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
30+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
3131
with:
3232
fetch-depth: 0 # Fetch all history so the tool can get all the tags to determine version.
3333
- name: Set up tools
@@ -36,7 +36,7 @@ jobs:
3636

3737
# This workflow should be the last to run. So wait for all the other tests to succeed.
3838
- name: Wait on all tests
39-
uses: lewagon/wait-on-check-action@e2558238c09778af25867eb5de5a3ce4bbae3dcd
39+
uses: lewagon/wait-on-check-action@3a563271c3f8d1611ed7352809303617ee7e54ac
4040
with:
4141
ref: ${{ github.sha }}
4242
running-workflow-name: 'release'
@@ -50,5 +50,5 @@ jobs:
5050
run: |
5151
git config --global user.name ${{ secrets.USER_NAME }}
5252
git config --global user.email ${{ secrets.USER_EMAIL }}
53-
dart ./script/tool/lib/src/main.dart publish-plugin --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
53+
dart ./script/tool/lib/src/main.dart publish --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
5454
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}

0 commit comments

Comments
 (0)