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

Commit c391466

Browse files
committed
Merge branch 'master' into video_player_web_2
2 parents f376060 + 3d57cff commit c391466

File tree

190 files changed

+2685
-881
lines changed

Some content is hidden

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

190 files changed

+2685
-881
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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ keystore.properties
3030
gradlew
3131
gradlew.bat
3232
gradle-wrapper.jar
33+
.flutter-plugins-dependencies
3334
*.iml
3435

3536
GeneratedPluginRegistrant.h

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

packages/android_alarm_manager/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 0.4.5
2+
3+
* Add support for Flutter Android embedding V2
4+
5+
## 0.4.4+3
6+
7+
* Add unit tests and DartDocs.
8+
19
## 0.4.4+2
210

311
* Remove AndroidX warning.

packages/android_alarm_manager/android/build.gradle

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ apply plugin: 'com.android.library'
2323

2424
android {
2525
compileSdkVersion 28
26-
26+
compileOptions {
27+
sourceCompatibility JavaVersion.VERSION_1_8
28+
targetCompatibility JavaVersion.VERSION_1_8
29+
}
2730
defaultConfig {
2831
minSdkVersion 16
2932
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -37,3 +40,29 @@ dependencies {
3740
implementation 'androidx.appcompat:appcompat:1.0.0'
3841
api 'androidx.core:core:1.0.1'
3942
}
43+
44+
// TODO(bkonyi): Remove this hack once androidx.lifecycle is included on stable. https://github.com/flutter/flutter/issues/42348
45+
afterEvaluate {
46+
def containsEmbeddingDependencies = false
47+
for (def configuration : configurations.all) {
48+
for (def dependency : configuration.dependencies) {
49+
if (dependency.group == 'io.flutter' &&
50+
dependency.name.startsWith('flutter_embedding') &&
51+
dependency.isTransitive())
52+
{
53+
containsEmbeddingDependencies = true
54+
break
55+
}
56+
}
57+
}
58+
if (!containsEmbeddingDependencies) {
59+
android {
60+
dependencies {
61+
def lifecycle_version = "1.1.1"
62+
api 'android.arch.lifecycle:runtime:$lifecycle_version'
63+
api 'android.arch.lifecycle:common:$lifecycle_version'
64+
api 'android.arch.lifecycle:common-java8:$lifecycle_version'
65+
}
66+
}
67+
}
68+
}

0 commit comments

Comments
 (0)