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

Commit eb1bb34

Browse files
committed
Merged with master
2 parents 02e130b + 5d1ed48 commit eb1bb34

File tree

560 files changed

+24498
-8302
lines changed

Some content is hidden

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

560 files changed

+24498
-8302
lines changed

.ci.yaml

+51-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,57 @@
88
enabled_branches:
99
- master
1010

11+
platform_properties:
12+
linux:
13+
properties:
14+
caches: >-
15+
[
16+
]
17+
dependencies: >
18+
[
19+
{"dependency": "curl"}
20+
]
21+
device_type: none
22+
os: Linux
23+
windows:
24+
properties:
25+
caches: >-
26+
[
27+
{"name": "vsbuild", "path": "vsbuild"},
28+
{"name": "pub_cache", "path": ".pub-cache"}
29+
]
30+
dependencies: >
31+
[
32+
{"dependency": "certs"}
33+
]
34+
device_type: none
35+
os: Windows
36+
1137
targets:
12-
- name: Windows Plugins
13-
builder: Windows Plugins
14-
postsubmit: false
38+
- name: Windows Plugins master channel
39+
recipe: plugins/plugins
40+
timeout: 30
41+
properties:
42+
dependencies: >
43+
[
44+
{"dependency": "vs_build"}
45+
]
46+
scheduler: luci
47+
48+
- name: Windows Plugins stable channel
49+
recipe: plugins/plugins
50+
timeout: 30
51+
properties:
52+
channel: stable
53+
dependencies: >
54+
[
55+
{"dependency": "vs_build"}
56+
]
1557
scheduler: luci
1658

59+
- name: Linux ci_yaml plugins roller
60+
recipe: infra/ci_yaml
61+
timeout: 30
62+
scheduler: luci
63+
runIf:
64+
- .ci.yaml

.cirrus.yml

+71-38
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,28 @@ flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
2020
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
2121
- git fetch origin
2222
# Switch to the requested branch.
23-
- flutter channel $CHANNEL
24-
- flutter upgrade
23+
- git checkout $CHANNEL
24+
# Reset to upstream branch, rather than using pull, since the base image
25+
# can sometimes be in a state where it has diverged from upstream (!).
26+
- git reset --hard @{u}
27+
# Run doctor to allow auditing of what version of Flutter the run is using.
28+
- flutter doctor -v
2529
<< : *TOOL_SETUP_TEMPLATE
2630

31+
build_all_plugins_app_template: &BUILD_ALL_PLUGINS_APP_TEMPLATE
32+
create_all_plugins_app_script:
33+
- dart $PLUGIN_TOOL all-plugins-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
34+
build_all_plugins_debug_script:
35+
- cd all_plugins
36+
- if [[ "$BUILD_ALL_ARGS" == "web" ]]; then
37+
- echo "Skipping; web does not support debug builds"
38+
- else
39+
- flutter build $BUILD_ALL_ARGS --debug
40+
- fi
41+
build_all_plugins_release_script:
42+
- cd all_plugins
43+
- flutter build $BUILD_ALL_ARGS --release
44+
2745
macos_template: &MACOS_TEMPLATE
2846
# Only one macOS task can run in parallel without credits, so use them for
2947
# PRs on macOS.
@@ -72,40 +90,45 @@ task:
7290
- cd script/tool
7391
- dart analyze --fatal-infos
7492
script:
75-
- ./script/tool_runner.sh analyze
93+
# DO NOT change the custom-analysis argument here without changing the Dart repo.
94+
# See the comment in script/configs/custom_analysis.yaml for details.
95+
- ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml
7696
### Android tasks ###
7797
- name: build_all_plugins_apk
7898
env:
99+
BUILD_ALL_ARGS: "apk"
79100
matrix:
80101
CHANNEL: "master"
81102
CHANNEL: "stable"
82-
script:
83-
- ./script/build_all_plugins_app.sh apk
103+
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
84104
### Web tasks ###
85105
- name: build_all_plugins_web
86106
env:
107+
BUILD_ALL_ARGS: "web"
87108
matrix:
88109
CHANNEL: "master"
89110
CHANNEL: "stable"
90-
script:
91-
- ./script/build_all_plugins_app.sh web
111+
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
92112
### Linux desktop tasks ###
93113
- name: build_all_plugins_linux
94114
env:
115+
BUILD_ALL_ARGS: "linux"
95116
matrix:
96117
CHANNEL: "master"
97118
CHANNEL: "stable"
98-
script:
119+
setup_script:
99120
- flutter config --enable-linux-desktop
100-
- ./script/build_all_plugins_app.sh linux
101-
- name: build-linux+drive-examples
121+
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
122+
- name: linux-build+platform-tests
102123
env:
103124
matrix:
104125
CHANNEL: "master"
105126
CHANNEL: "stable"
106127
build_script:
107128
- flutter config --enable-linux-desktop
108129
- ./script/tool_runner.sh build-examples --linux
130+
native_test_script:
131+
- ./script/tool_runner.sh native-test --linux --no-integration
109132
drive_script:
110133
- xvfb-run ./script/tool_runner.sh drive-examples --linux
111134

@@ -125,7 +148,7 @@ task:
125148
memory: 12G
126149
matrix:
127150
### Android tasks ###
128-
- name: build-apks+java-test+firebase-test-lab
151+
- name: android-build+platform-tests
129152
env:
130153
matrix:
131154
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
@@ -144,13 +167,22 @@ task:
144167
- export CIRRUS_CHANGE_MESSAGE=""
145168
- export CIRRUS_COMMIT_MESSAGE=""
146169
- ./script/tool_runner.sh build-examples --apk
147-
java_test_script:
170+
lint_script:
148171
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
149172
# might include non-ASCII characters which makes Gradle crash.
150173
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
151174
- export CIRRUS_CHANGE_MESSAGE=""
152175
- export CIRRUS_COMMIT_MESSAGE=""
153-
- ./script/tool_runner.sh java-test # must come after apk build
176+
- ./script/tool_runner.sh lint-android # must come after build-examples
177+
native_unit_test_script:
178+
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
179+
# might include non-ASCII characters which makes Gradle crash.
180+
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
181+
- export CIRRUS_CHANGE_MESSAGE=""
182+
- export CIRRUS_COMMIT_MESSAGE=""
183+
# Native integration tests are handled by firebase-test-lab below, so
184+
# only run unit tests.
185+
- ./script/tool_runner.sh native-test --android --no-integration # must come after apk build
154186
firebase_test_lab_script:
155187
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
156188
# might include non-ASCII characters which makes Gradle crash.
@@ -159,16 +191,19 @@ task:
159191
- export CIRRUS_COMMIT_MESSAGE=""
160192
- if [[ -n "$GCLOUD_FIREBASE_TESTLAB_KEY" ]]; then
161193
- echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
162-
- ./script/tool_runner.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26
194+
- ./script/tool_runner.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26 --exclude=script/configs/exclude_integration_android.yaml
163195
- else
164196
- echo "This user does not have permission to run Firebase Test Lab tests."
165197
- fi
198+
# Upload the full lint results to Cirrus to display in the results UI.
199+
always:
200+
android-lint_artifacts:
201+
path: "**/reports/lint-results-debug.xml"
202+
type: text/xml
203+
format: android-lint
166204
### Web tasks ###
167-
- name: build-web+drive-examples
205+
- name: web-build+platform-tests
168206
env:
169-
# Currently missing; see https://github.com/flutter/flutter/issues/81982
170-
# and https://github.com/flutter/flutter/issues/82211
171-
PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS: "file_selector,shared_preferences_web"
172207
matrix:
173208
CHANNEL: "master"
174209
CHANNEL: "stable"
@@ -181,7 +216,7 @@ task:
181216
build_script:
182217
- ./script/tool_runner.sh build-examples --web
183218
drive_script:
184-
- ./script/tool_runner.sh drive-examples --web --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
219+
- ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml
185220

186221
# macOS tasks.
187222
task:
@@ -195,18 +230,14 @@ task:
195230
### iOS tasks ###
196231
- name: build_all_plugins_ipa
197232
env:
233+
BUILD_ALL_ARGS: "ios --no-codesign"
198234
matrix:
199235
CHANNEL: "master"
200236
CHANNEL: "stable"
201-
script:
202-
- ./script/build_all_plugins_app.sh ios --no-codesign
203-
- name: build-ipas+drive-examples
237+
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
238+
- name: ios-build+platform-tests
204239
env:
205240
PATH: $PATH:/usr/local/bin
206-
# in_app_purchase_ios is currently missing tests; see https://github.com/flutter/flutter/issues/81695
207-
# ios_platform_images is currently missing tests; see https://github.com/flutter/flutter/issues/82208
208-
# sensor hangs on CI.
209-
PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS: "in_app_purchase_ios,ios_platform_images,sensors"
210241
matrix:
211242
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
212243
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
@@ -221,35 +252,37 @@ task:
221252
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-5 | xargs xcrun simctl boot
222253
build_script:
223254
- ./script/tool_runner.sh build-examples --ios
224-
xctest_script:
225-
- ./script/tool_runner.sh xctest --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
255+
xcode_analyze_script:
256+
- ./script/tool_runner.sh xcode-analyze --ios
257+
native_test_script:
258+
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
226259
drive_script:
227260
# `drive-examples` contains integration tests, which changes the UI of the application.
228261
# This UI change sometimes affects `xctest`.
229-
# So we run `drive-examples` after `xctest`, changing the order will result ci failure.
230-
- ./script/tool_runner.sh drive-examples --ios --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
262+
# So we run `drive-examples` after `native-test`; changing the order will result ci failure.
263+
- ./script/tool_runner.sh drive-examples --ios --exclude=script/configs/exclude_integration_ios.yaml
231264
### macOS desktop tasks ###
232265
- name: build_all_plugins_macos
233266
env:
267+
BUILD_ALL_ARGS: "macos"
234268
matrix:
235269
CHANNEL: "master"
236270
CHANNEL: "stable"
237-
script:
271+
setup_script:
238272
- flutter config --enable-macos-desktop
239-
- ./script/build_all_plugins_app.sh macos
240-
- name: build-macos+drive-examples
273+
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
274+
- name: macos-build+platform-tests
241275
env:
242-
# conncectivity_macos is deprecated, so is not getting unit test backfill.
243-
# package_info is deprecated, so is not getting unit test backfill.
244-
PLUGINS_TO_EXCLUDE_MACOS_XCTESTS: "connectivity_macos,package_info"
245276
matrix:
246277
CHANNEL: "master"
247278
CHANNEL: "stable"
248279
PATH: $PATH:/usr/local/bin
249280
build_script:
250281
- flutter config --enable-macos-desktop
251282
- ./script/tool_runner.sh build-examples --macos
252-
xctest_script:
253-
- ./script/tool_runner.sh xctest --macos --exclude $PLUGINS_TO_EXCLUDE_MACOS_XCTESTS
283+
xcode_analyze_script:
284+
- ./script/tool_runner.sh xcode-analyze --macos
285+
native_test_script:
286+
- ./script/tool_runner.sh native-test --macos --exclude=script/configs/exclude_native_macos.yaml
254287
drive_script:
255288
- ./script/tool_runner.sh drive-examples --macos

.github/workflows/release.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ jobs:
2828
run: dart pub get
2929
working-directory: ${{ github.workspace }}/script/tool
3030

31-
# # This workflow should be the last to run. So wait for all the other tests to succeed.
31+
# This workflow should be the last to run. So wait for all the other tests to succeed.
3232
- name: Wait on all tests
33-
uses: lewagon/wait-on-check-action@1b1630e169116b58a4b933d5ad7effc46d3d312d
33+
uses: lewagon/wait-on-check-action@a0f99ce1e713de216866868c3da4d4183a051cbe
3434
with:
3535
ref: ${{ github.sha }}
3636
running-workflow-name: 'release'
3737
repo-token: ${{ secrets.GITHUB_TOKEN }}
3838
wait-interval: 180 # seconds
3939
allowed-conclusions: success
40+
# verbose:true will produce too many logs that hang github actions web UI.
41+
verbose: false
4042

4143
- name: run release
4244
run: |

packages/android_alarm_manager/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## NEXT
2+
3+
* Remove support for the V1 Android embedding.
4+
* Updated Android lint settings.
5+
16
## 2.0.2
27

38
* Update README to point to Plus Plugins version.

packages/android_alarm_manager/README.md

-49
Original file line numberDiff line numberDiff line change
@@ -74,55 +74,6 @@ will not run in the same isolate as the main application. Unlike threads, isolat
7474
memory and communication between isolates must be done via message passing (see more documentation on
7575
isolates [here](https://api.dart.dev/stable/2.0.0/dart-isolate/dart-isolate-library.html)).
7676

77-
78-
## Using other plugins in alarm callbacks
79-
80-
If alarm callbacks will need access to other Flutter plugins, including the
81-
alarm manager plugin itself, it may be necessary to inform the background service how
82-
to initialize plugins depending on which Flutter Android embedding the application is
83-
using.
84-
85-
### Flutter Android Embedding V1
86-
87-
For the Flutter Android Embedding V1, the background service must be provided a
88-
callback to register plugins with the background isolate. This is done by giving
89-
the `AlarmService` a callback to call the application's `onCreate` method. See the example's
90-
[Application overrides](https://github.com/flutter/plugins/blob/master/packages/android_alarm_manager/example/android/app/src/main/java/io/flutter/plugins/androidalarmmanagerexample/Application.java).
91-
92-
In particular, its `Application` class is as follows:
93-
94-
```java
95-
public class Application extends FlutterApplication implements PluginRegistrantCallback {
96-
@Override
97-
public void onCreate() {
98-
super.onCreate();
99-
AlarmService.setPluginRegistrant(this);
100-
}
101-
102-
@Override
103-
public void registerWith(PluginRegistry registry) {
104-
GeneratedPluginRegistrant.registerWith(registry);
105-
}
106-
}
107-
```
108-
109-
Which must be reflected in the application's `AndroidManifest.xml`. E.g.:
110-
111-
```xml
112-
<application
113-
android:name=".Application"
114-
...
115-
```
116-
117-
**Note:** Not calling `AlarmService.setPluginRegistrant` will result in an exception being
118-
thrown when an alarm eventually fires.
119-
120-
### Flutter Android Embedding V2
121-
122-
For the Flutter Android Embedding V2, plugins are registered with the background
123-
isolate via reflection so `AlarmService.setPluginRegistrant` does not need to be
124-
called.
125-
12677
For help getting started with Flutter, view our online
12778
[documentation](https://flutter.dev/).
12879

packages/android_alarm_manager/android/build.gradle

+15
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ android {
3838
}
3939
lintOptions {
4040
disable 'InvalidPackage'
41+
disable 'GradleDependency'
42+
baseline file("lint-baseline.xml")
43+
}
44+
45+
46+
testOptions {
47+
unitTests.includeAndroidResources = true
48+
unitTests.returnDefaultValues = true
49+
unitTests.all {
50+
testLogging {
51+
events "passed", "skipped", "failed", "standardOut", "standardError"
52+
outputs.upToDateWhen {false}
53+
showStandardStreams = true
54+
}
55+
}
4156
}
4257
}
4358

0 commit comments

Comments
 (0)