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

Commit 18bf1bb

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents f951f75 + bb604ef commit 18bf1bb

File tree

440 files changed

+7843
-1943
lines changed

Some content is hidden

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

440 files changed

+7843
-1943
lines changed

.ci/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ RUN yes | sdkmanager \
2222
"extras;android;m2repository"
2323

2424
RUN yes | sdkmanager --licenses
25+
26+
# Add repo for Google Chrome and install it
27+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
28+
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list
29+
RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends google-chrome-stable

.cirrus.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ task:
1313
activate_script: pub global activate flutter_plugin_tools
1414
matrix:
1515
- name: publishable
16-
script: ./script/check_publish.sh
16+
script:
17+
- flutter channel stable
18+
- ./script/check_publish.sh
1719
- name: format
1820
install_script:
1921
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
@@ -80,7 +82,7 @@ task:
8082
task:
8183
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
8284
osx_instance:
83-
image: mojave-xcode-10.2-flutter
85+
image: mojave-xcode-11.2.1-flutter
8486
setup_script:
8587
- pod repo update
8688
upgrade_script:
@@ -92,7 +94,7 @@ task:
9294
activate_script: pub global activate flutter_plugin_tools
9395
create_simulator_script:
9496
- xcrun simctl list
95-
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-12-2 | xargs xcrun simctl boot
97+
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-2 | xargs xcrun simctl boot
9698
matrix:
9799
- name: build_all_plugins_ipa
98100
script:

CONTRIBUTING.md

Lines changed: 100 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,46 @@ USB and debugging enabled on that device.
4242

4343
## Running the tests
4444

45-
Flutter plugins have both unit tests of their Dart API and integration tests that run on a virtual or actual device.
45+
### Integration tests
4646

47-
To run the unit tests:
47+
To run the integration tests using Flutter driver:
4848

49-
```
50-
flutter test test/<name_of_plugin>_test.dart
49+
```console
50+
cd example
51+
flutter drive test_driver/<name_of_plugin_test>.dart
5152
```
5253

53-
To run the integration tests using Flutter driver:
54+
To run integration tests as instrumentation tests on a local Android device:
5455

55-
```
56+
```console
5657
cd example
57-
flutter drive test/<name_of_plugin>.dart
58+
flutter build apk
59+
cd android && ./gradlew -Ptarget=$(pwd)/../test_driver/<name_of_plugin>_test.dart app:connectedAndroidTest
5860
```
5961

60-
To run integration tests as instrumentation tests on a local Android device:
62+
These tests may also be in folders just named "test," or have filenames ending
63+
with "e2e".
64+
65+
### Dart unit tests
66+
67+
To run the unit tests:
6168

69+
```console
70+
flutter test test/<name_of_plugin>_test.dart
6271
```
72+
73+
### Java unit tests
74+
75+
These can be ran through Android Studio once the example app is opened as an
76+
Android project.
77+
78+
Without Android Studio, they can be ran through the terminal.
79+
80+
```console
6381
cd example
64-
(cd android && ./gradlew -Ptarget=$(pwd)/../test_live/<name_of_plugin>_test.dart connectedAndroidTest)
82+
flutter build apk
83+
cd android
84+
./gradlew test
6585
```
6686

6787
## Contributing code
@@ -101,13 +121,6 @@ Plugins tests are run automatically on contributions using Cirrus CI. However, d
101121
cost constraints, pull requests from non-committers may not run all the tests
102122
automatically.
103123

104-
The plugins team prefers that unit tests are written using `setMockMethodCallHandler`
105-
rather than using mockito to mock out `MethodChannel`. For a list of the plugins that
106-
are still using the mockito testing style and need to be converted, see
107-
[issue 34284](https://github.com/flutter/flutter/issues/34284). If you are contributing
108-
tests to an existing plugin that uses mockito `MethodChannel`, consider converting
109-
them to use `setMockMethodCallHandler` instead.
110-
111124
Once you've gotten an LGTM from a project maintainer and once your PR has received
112125
the green light from all our automated testing, wait for one the package maintainers
113126
to merge the pull request and `pub submit` any affected packages.
@@ -134,3 +147,74 @@ Newly opened PRs first go through initial triage which results in one of:
134147
* **Starting a non trivial review** - if the review requires non trivial effort and the issue is a priority; in this case the maintainer will:
135148
* Add the "in review" label to the issue.
136149
* Self assign the PR.
150+
151+
### The release process
152+
153+
We push releases manually. Generally every merged PR upgrades at least one
154+
plugin's `pubspec.yaml`, so also needs to be published as a package release. The
155+
Flutter team member most involved with the PR should be the person responsible
156+
for publishing the package release. In cases where the PR is authored by a
157+
Flutter maintainer, the publisher should probably be the author. In other cases
158+
where the PR is from a contributor, it's up to the reviewing Flutter team member
159+
to publish the release instead.
160+
161+
Some things to keep in mind before publishing the release:
162+
163+
- Has CI ran on the master commit and gone green? Even if CI shows as green on
164+
the PR it's still possible for it to fail on merge, for multiple reasons.
165+
There may have been some bug in the merge that introduced new failures. CI
166+
runs on PRs as it's configured on their branch state, and not on tip of tree.
167+
CI on PRs also only runs tests for packages that it detects have been directly
168+
changed, vs running on every single package on master.
169+
- [Publishing is
170+
forever.](https://dart.dev/tools/pub/publishing#publishing-is-forever)
171+
Hopefully any bugs or breaking in changes in this PR have already been caught
172+
in PR review, but now's a second chance to revert before anything goes live.
173+
- "Don't deploy on a Friday." Consider carefully whether or not it's worth
174+
immediately publishing an update before a stretch of time where you're going
175+
to be unavailable. There may be bugs with the release or questions about it
176+
from people that immediately adopt it, and uncovering and resolving those
177+
support issues will take more time if you're unavailable.
178+
179+
Releasing a package is a two-step process.
180+
181+
1. Push the package update to [pub.dev](https://pub.dev) using `pub publish`.
182+
2. Tag the commit with git in the format of `<package_name>-v<package_version>`,
183+
and then push the tag to the `flutter/plugins` master branch. This can be
184+
done manually with `git tag $tagname && git push upstream $tagname` while
185+
checked out on the commit that updated `version` in `pubspec.yaml`.
186+
187+
We've recently updated
188+
[flutter_plugin_tools](https://github.com/flutter/plugin_tools) to wrap both of
189+
those steps into one command to make it a little easier. This new tool is
190+
experimental. Feel free to fall back on manually running `pub publish` and
191+
creating and pushing the tag in git if there are issues with it.
192+
193+
Install the tool by running:
194+
195+
```terminal
196+
$ pub global activate flutter_plugin_tools
197+
```
198+
199+
Then, from the root of your local `flutter/plugins` repo, use the tool to
200+
publish a release.
201+
202+
```terminal
203+
$ pub global run flutter_plugin_tools publish-plugin --package $package
204+
```
205+
206+
By default the tool tries to push tags to the `upstream` remote, but that and
207+
some additional settings can be configured. Run `pub global activate
208+
flutter_plugin_tools --help` for more usage information.
209+
210+
The tool wraps `pub publish` for pushing the package to pub, and then will
211+
automatically use git to try and create and push tags. It has some additional
212+
safety checking around `pub publish` too. By default `pub publish` publishes
213+
_everything_, including untracked or uncommitted files in version control.
214+
`flutter_plugin_tools publish-plugin` will first check the status of the local
215+
directory and refuse to publish if there are any mismatched files with version
216+
control present.
217+
218+
There is a lot about this process that is still to be desired. Some top level
219+
items are being tracked in
220+
[flutter/flutter#27258](https://github.com/flutter/flutter/issues/27258).

analysis_options.yaml

Lines changed: 5 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,9 @@
1-
# Specify analysis options.
2-
#
3-
# Until there are meta linter rules, each desired lint must be explicitly enabled.
4-
# See: https://github.com/dart-lang/linter/issues/288
5-
#
6-
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
7-
# See the configuration guide for more
8-
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
9-
#
10-
# NOTE: Please keep this file in sync with
11-
# https://github.com/flutter/flutter/blob/master/analysis_options.yaml
12-
1+
include: package:pedantic/analysis_options.yaml
132
analyzer:
14-
language:
15-
enableStrictCallChecks: true
16-
enableSuperMixins: true
17-
enableAssertInitializer: true
18-
strong-mode:
19-
implicit-dynamic: false
20-
errors:
21-
# treat missing required parameters as a warning (not a hint)
22-
missing_required_param: warning
23-
# treat missing returns as a warning (not a hint)
24-
missing_return: warning
25-
# allow having TODOs in the code
26-
todo: ignore
273
exclude:
28-
- 'bin/cache/**'
29-
# the following two are relative to the stocks example and the flutter package respectively
30-
# see https://github.com/dart-lang/sdk/issues/28463
31-
- 'lib/i18n/stock_messages_*.dart'
32-
- 'lib/src/http/**'
33-
4+
# Ignore generated files
5+
- '**/*.g.dart'
6+
- 'lib/src/generated/*.dart'
347
linter:
358
rules:
36-
# these rules are documented on and in the same order as
37-
# the Dart Lint rules page to make maintenance easier
38-
# http://dart-lang.github.io/linter/lints/
39-
40-
# === error rules ===
41-
- avoid_empty_else
42-
- avoid_slow_async_io
43-
- cancel_subscriptions
44-
# - close_sinks # https://github.com/flutter/flutter/issues/5789
45-
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
46-
- control_flow_in_finally
47-
- empty_statements
48-
- hash_and_equals
49-
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
50-
- iterable_contains_unrelated_type
51-
- list_remove_unrelated_type
52-
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
53-
- no_adjacent_strings_in_list
54-
- no_duplicate_case_values
55-
- test_types_in_equals
56-
- throw_in_finally
57-
- unrelated_type_equality_checks
58-
- valid_regexps
59-
60-
# === style rules ===
61-
- always_declare_return_types
62-
# - always_put_control_body_on_new_line
63-
- always_require_non_null_named_parameters
64-
- always_specify_types
65-
- annotate_overrides
66-
# - avoid_annotating_with_dynamic # not yet tested
67-
- avoid_as
68-
# - avoid_catches_without_on_clauses # not yet tested
69-
# - avoid_catching_errors # not yet tested
70-
# - avoid_classes_with_only_static_members # not yet tested
71-
# - avoid_function_literals_in_foreach_calls # not yet tested
72-
- avoid_init_to_null
73-
- avoid_null_checks_in_equality_operators
74-
# - avoid_positional_boolean_parameters # not yet tested
75-
- avoid_return_types_on_setters
76-
# - avoid_returning_null # not yet tested
77-
# - avoid_returning_this # not yet tested
78-
# - avoid_setters_without_getters # not yet tested
79-
# - avoid_types_on_closure_parameters # not yet tested
80-
- await_only_futures
81-
- camel_case_types
82-
# - cascade_invocations # not yet tested
83-
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
84-
- directives_ordering
85-
- empty_catches
86-
- empty_constructor_bodies
87-
- implementation_imports
88-
# - join_return_with_assignment # not yet tested
89-
- library_names
90-
- library_prefixes
91-
- non_constant_identifier_names
92-
# - omit_local_variable_types # opposite of always_specify_types
93-
# - one_member_abstracts # too many false positives
94-
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
95-
- overridden_fields
96-
- package_api_docs
97-
- package_prefixed_library_names
98-
# - parameter_assignments # we do this commonly
99-
- prefer_adjacent_string_concatenation
100-
- prefer_collection_literals
101-
# - prefer_conditional_assignment # not yet tested
102-
- prefer_const_constructors
103-
# - prefer_constructors_over_static_methods # not yet tested
104-
- prefer_contains
105-
- prefer_equal_for_default_values
106-
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
107-
# - prefer_final_fields # https://github.com/dart-lang/linter/issues/506
108-
- prefer_final_locals
109-
# - prefer_foreach # not yet tested
110-
# - prefer_function_declarations_over_variables # not yet tested
111-
- prefer_initializing_formals
112-
# - prefer_interpolation_to_compose_strings # not yet tested
113-
- prefer_is_empty
114-
- prefer_is_not_empty
115-
- prefer_void_to_null
116-
# - recursive_getters # https://github.com/dart-lang/linter/issues/452
117-
- slash_for_doc_comments
118-
- sort_constructors_first
119-
- sort_unnamed_constructors_first
120-
- super_goes_last
121-
# - type_annotate_public_apis # subset of always_specify_types
122-
- type_init_formals
123-
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
124-
- unnecessary_brace_in_string_interps
125-
- unnecessary_const
126-
- unnecessary_getters_setters
127-
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
128-
- unnecessary_new
129-
- unnecessary_null_aware_assignments
130-
- unnecessary_null_in_if_null_operators
131-
# - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627
132-
- unnecessary_statements
133-
- unnecessary_this
134-
- use_rethrow_when_possible
135-
# - use_setters_to_change_properties # not yet tested
136-
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664
137-
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
138-
139-
# === pub rules ===
140-
- package_names
9+
- public_member_api_docs

packages/android_alarm_manager/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.4+3
2+
3+
* Add unit tests and DartDocs.
4+
15
## 0.4.4+2
26

37
* Remove AndroidX warning.

packages/android_alarm_manager/example/lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// ignore_for_file: public_member_api_docs
6+
57
import 'dart:async';
68

79
import 'package:android_alarm_manager/android_alarm_manager.dart';

0 commit comments

Comments
 (0)