Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7d7be76
Bump google_maps_flutter pubspec to match CHANGELOG (#2267)
jmagman Nov 12, 2019
35e984f
[android_intent] Add missing DartDocs (#2268)
Nov 13, 2019
bbee85f
[infra] Ignore analyzer issues in CI (#2271)
Nov 13, 2019
76854d6
[quick_actions] Update and migrate iOS example project (#2100)
jmagman Nov 13, 2019
e87ef4c
[shared_preferences] Update and migrate iOS example project (#2103)
jmagman Nov 13, 2019
3c59297
[connectivity] Lint for public DartDocs (#2269)
Nov 13, 2019
f5f0d57
[image_picker] Lint for public DartDocs (#2270)
Nov 13, 2019
218016f
[sensors] Documentation and test improvements (#2272)
Nov 13, 2019
9ddc6c1
[path_provider] Update and migrate iOS example project (#2099)
jmagman Nov 13, 2019
a336b28
[video_player] Add v2 embedding support (#2226)
Nov 13, 2019
56e46ac
[google_maps_flutter] Define clang module for iOS, fix analyzer warni…
jmagman Nov 13, 2019
16e916c
[url_launcher] DartDoc and test improvements (#2274)
Nov 14, 2019
2c92b3f
[battery] Update and migrate iOS example project (#2089)
jmagman Nov 14, 2019
4a94503
Update cirrus to create IOS simulator on 13.2 an xCode 11 (#2275)
Nov 14, 2019
d22502a
[webview_flutter] Add async NavigationDelegates (#2257)
Nov 14, 2019
1b5eae5
[google_sign_in] Port plugin to use the federated Platform Interface …
ditman Nov 15, 2019
8380988
[connectivity] Fix reachability stream for iOS (#2281)
mehmetf Nov 15, 2019
953e50d
[image_picker] Fix a crash when picking video on iOS 13 and above. (#…
Nov 19, 2019
dd9eb8b
Add google_sign_in_web (0.8.0) plugin. (#2280)
ditman Nov 19, 2019
8b1f2f0
[path_provider] Add missing DartDocs (#2288)
Nov 19, 2019
e3e38db
[url_launcher] Update deps and docs in url_launcher_web (#2289)
ditman Nov 19, 2019
fb47143
Migrate plugins to use e2e tests. (#2282)
Nov 20, 2019
d28c98c
[video_player] Move [player dispose] to `onUnregistered` (#2124)
Nov 20, 2019
cba3932
[video_player] Add platform interface (#2273)
cbenhagen Nov 21, 2019
dc48e70
[path_provider] Add v2 embedding support for (#2284)
xster Nov 22, 2019
95594f5
Fix testing instructions in CONTRIBUTING.md (#2222)
Nov 22, 2019
95873dc
Update CONTRIBUTING.md (#2292)
collinjackson Nov 22, 2019
db123e8
[image_picker]fix a crash when a non-image file is picked. (#2293)
Nov 22, 2019
56b81b7
[video_player] Improve DartDocs and test coverage (#2286)
Nov 22, 2019
3a87296
[shared_preferences] Add missing DartDoc (#2296)
Nov 22, 2019
4ace778
[share] README update (#2297)
Nov 22, 2019
f31b997
[all] Switch to pedantic analysis rules (#2300)
Nov 25, 2019
8eca031
[none] Add release process to CONTRIBUTING.md (#2304)
Nov 25, 2019
2ea4bc8
add shared_preferences_platform_interface (#2291)
yjbanov Nov 26, 2019
43f14ab
[quick_actions] Add DartDoc and test coverage (#2298)
Nov 26, 2019
1d1f457
[android_alarm_manager] Testing and documentation (#2283)
Nov 26, 2019
2a01082
Add Chrome to the Docker for CI (#2307)
hterkelsen Nov 26, 2019
f5df0a8
Emit correct VideoEventType (#2305)
cbenhagen Nov 26, 2019
2d15096
[google_sign_in_web] Add empty podspec to plugin. (#2316)
ditman Nov 26, 2019
948744e
[camera] Fix unawaited future errors (#2312)
Nov 26, 2019
561da7f
[android_intent] Fix pedantic linter errors (#2310)
Nov 26, 2019
330a3e0
[script] Exclude google_sign_in_web from podspec lint. (#2318)
ditman Nov 27, 2019
bb604ef
[google_sign_in] Migrate away from quiver_hashcode (#2301)
mehmetf Nov 27, 2019
b7b94b3
throw AssertionError on non-mock implementations (#2324)
yjbanov Nov 27, 2019
e61e9d4
[android_alarm_manager] migrate to the V2 Android embedding (#2193)
bkonyi Nov 27, 2019
7af9a1a
Implement shared_preferences on top of platform interface (#2325)
yjbanov Nov 27, 2019
3d57cff
[video_player] Use platform interface (#2276)
cbenhagen Nov 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ RUN yes | sdkmanager \
"extras;android;m2repository"

RUN yes | sdkmanager --licenses

# Add repo for Google Chrome and install it
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list
RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends google-chrome-stable
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ task:
task:
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
image: mojave-xcode-10.2-flutter
image: mojave-xcode-11.2.1-flutter
setup_script:
- pod repo update
upgrade_script:
Expand All @@ -94,7 +94,7 @@ task:
activate_script: pub global activate flutter_plugin_tools
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-12-2 | xargs xcrun simctl boot
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-2 | xargs xcrun simctl boot
matrix:
- name: build_all_plugins_ipa
script:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ keystore.properties
gradlew
gradlew.bat
gradle-wrapper.jar
.flutter-plugins-dependencies
*.iml

GeneratedPluginRegistrant.h
Expand Down
116 changes: 100 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,46 @@ USB and debugging enabled on that device.

## Running the tests

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

To run the unit tests:
To run the integration tests using Flutter driver:

```
flutter test test/<name_of_plugin>_test.dart
```console
cd example
flutter drive test_driver/<name_of_plugin_test>.dart
```

To run the integration tests using Flutter driver:
To run integration tests as instrumentation tests on a local Android device:

```
```console
cd example
flutter drive test/<name_of_plugin>.dart
flutter build apk
cd android && ./gradlew -Ptarget=$(pwd)/../test_driver/<name_of_plugin>_test.dart app:connectedAndroidTest
```

To run integration tests as instrumentation tests on a local Android device:
These tests may also be in folders just named "test," or have filenames ending
with "e2e".

### Dart unit tests

To run the unit tests:

```console
flutter test test/<name_of_plugin>_test.dart
```

### Java unit tests

These can be ran through Android Studio once the example app is opened as an
Android project.

Without Android Studio, they can be ran through the terminal.

```console
cd example
(cd android && ./gradlew -Ptarget=$(pwd)/../test_live/<name_of_plugin>_test.dart connectedAndroidTest)
flutter build apk
cd android
./gradlew test
```

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

The plugins team prefers that unit tests are written using `setMockMethodCallHandler`
rather than using mockito to mock out `MethodChannel`. For a list of the plugins that
are still using the mockito testing style and need to be converted, see
[issue 34284](https://github.com/flutter/flutter/issues/34284). If you are contributing
tests to an existing plugin that uses mockito `MethodChannel`, consider converting
them to use `setMockMethodCallHandler` instead.

Once you've gotten an LGTM from a project maintainer and once your PR has received
the green light from all our automated testing, wait for one the package maintainers
to merge the pull request and `pub submit` any affected packages.
Expand All @@ -134,3 +147,74 @@ Newly opened PRs first go through initial triage which results in one of:
* **Starting a non trivial review** - if the review requires non trivial effort and the issue is a priority; in this case the maintainer will:
* Add the "in review" label to the issue.
* Self assign the PR.

### The release process

We push releases manually. Generally every merged PR upgrades at least one
plugin's `pubspec.yaml`, so also needs to be published as a package release. The
Flutter team member most involved with the PR should be the person responsible
for publishing the package release. In cases where the PR is authored by a
Flutter maintainer, the publisher should probably be the author. In other cases
where the PR is from a contributor, it's up to the reviewing Flutter team member
to publish the release instead.

Some things to keep in mind before publishing the release:

- Has CI ran on the master commit and gone green? Even if CI shows as green on
the PR it's still possible for it to fail on merge, for multiple reasons.
There may have been some bug in the merge that introduced new failures. CI
runs on PRs as it's configured on their branch state, and not on tip of tree.
CI on PRs also only runs tests for packages that it detects have been directly
changed, vs running on every single package on master.
- [Publishing is
forever.](https://dart.dev/tools/pub/publishing#publishing-is-forever)
Hopefully any bugs or breaking in changes in this PR have already been caught
in PR review, but now's a second chance to revert before anything goes live.
- "Don't deploy on a Friday." Consider carefully whether or not it's worth
immediately publishing an update before a stretch of time where you're going
to be unavailable. There may be bugs with the release or questions about it
from people that immediately adopt it, and uncovering and resolving those
support issues will take more time if you're unavailable.

Releasing a package is a two-step process.

1. Push the package update to [pub.dev](https://pub.dev) using `pub publish`.
2. Tag the commit with git in the format of `<package_name>-v<package_version>`,
and then push the tag to the `flutter/plugins` master branch. This can be
done manually with `git tag $tagname && git push upstream $tagname` while
checked out on the commit that updated `version` in `pubspec.yaml`.

We've recently updated
[flutter_plugin_tools](https://github.com/flutter/plugin_tools) to wrap both of
those steps into one command to make it a little easier. This new tool is
experimental. Feel free to fall back on manually running `pub publish` and
creating and pushing the tag in git if there are issues with it.

Install the tool by running:

```terminal
$ pub global activate flutter_plugin_tools
```

Then, from the root of your local `flutter/plugins` repo, use the tool to
publish a release.

```terminal
$ pub global run flutter_plugin_tools publish-plugin --package $package
```

By default the tool tries to push tags to the `upstream` remote, but that and
some additional settings can be configured. Run `pub global activate
flutter_plugin_tools --help` for more usage information.

The tool wraps `pub publish` for pushing the package to pub, and then will
automatically use git to try and create and push tags. It has some additional
safety checking around `pub publish` too. By default `pub publish` publishes
_everything_, including untracked or uncommitted files in version control.
`flutter_plugin_tools publish-plugin` will first check the status of the local
directory and refuse to publish if there are any mismatched files with version
control present.

There is a lot about this process that is still to be desired. Some top level
items are being tracked in
[flutter/flutter#27258](https://github.com/flutter/flutter/issues/27258).
141 changes: 5 additions & 136 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,140 +1,9 @@
# Specify analysis options.
#
# Until there are meta linter rules, each desired lint must be explicitly enabled.
# See: https://github.com/dart-lang/linter/issues/288
#
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
# See the configuration guide for more
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
#
# NOTE: Please keep this file in sync with
# https://github.com/flutter/flutter/blob/master/analysis_options.yaml

include: package:pedantic/analysis_options.yaml
analyzer:
language:
enableStrictCallChecks: true
enableSuperMixins: true
enableAssertInitializer: true
strong-mode:
implicit-dynamic: false
errors:
# treat missing required parameters as a warning (not a hint)
missing_required_param: warning
# treat missing returns as a warning (not a hint)
missing_return: warning
# allow having TODOs in the code
todo: ignore
exclude:
- 'bin/cache/**'
# the following two are relative to the stocks example and the flutter package respectively
# see https://github.com/dart-lang/sdk/issues/28463
- 'lib/i18n/stock_messages_*.dart'
- 'lib/src/http/**'

# Ignore generated files
- '**/*.g.dart'
- 'lib/src/generated/*.dart'
linter:
rules:
# these rules are documented on and in the same order as
# the Dart Lint rules page to make maintenance easier
# http://dart-lang.github.io/linter/lints/

# === error rules ===
- avoid_empty_else
- avoid_slow_async_io
- cancel_subscriptions
# - close_sinks # https://github.com/flutter/flutter/issues/5789
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
- control_flow_in_finally
- empty_statements
- hash_and_equals
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
- iterable_contains_unrelated_type
- list_remove_unrelated_type
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
- no_adjacent_strings_in_list
- no_duplicate_case_values
- test_types_in_equals
- throw_in_finally
- unrelated_type_equality_checks
- valid_regexps

# === style rules ===
- always_declare_return_types
# - always_put_control_body_on_new_line
- always_require_non_null_named_parameters
- always_specify_types
- annotate_overrides
# - avoid_annotating_with_dynamic # not yet tested
- avoid_as
# - avoid_catches_without_on_clauses # not yet tested
# - avoid_catching_errors # not yet tested
# - avoid_classes_with_only_static_members # not yet tested
# - avoid_function_literals_in_foreach_calls # not yet tested
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # not yet tested
- avoid_return_types_on_setters
# - avoid_returning_null # not yet tested
# - avoid_returning_this # not yet tested
# - avoid_setters_without_getters # not yet tested
# - avoid_types_on_closure_parameters # not yet tested
- await_only_futures
- camel_case_types
# - cascade_invocations # not yet tested
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
- directives_ordering
- empty_catches
- empty_constructor_bodies
- implementation_imports
# - join_return_with_assignment # not yet tested
- library_names
- library_prefixes
- non_constant_identifier_names
# - omit_local_variable_types # opposite of always_specify_types
# - one_member_abstracts # too many false positives
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
- overridden_fields
- package_api_docs
- package_prefixed_library_names
# - parameter_assignments # we do this commonly
- prefer_adjacent_string_concatenation
- prefer_collection_literals
# - prefer_conditional_assignment # not yet tested
- prefer_const_constructors
# - prefer_constructors_over_static_methods # not yet tested
- prefer_contains
- prefer_equal_for_default_values
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
# - prefer_final_fields # https://github.com/dart-lang/linter/issues/506
- prefer_final_locals
# - prefer_foreach # not yet tested
# - prefer_function_declarations_over_variables # not yet tested
- prefer_initializing_formals
# - prefer_interpolation_to_compose_strings # not yet tested
- prefer_is_empty
- prefer_is_not_empty
- prefer_void_to_null
# - recursive_getters # https://github.com/dart-lang/linter/issues/452
- slash_for_doc_comments
- sort_constructors_first
- sort_unnamed_constructors_first
- super_goes_last
# - type_annotate_public_apis # subset of always_specify_types
- type_init_formals
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
# - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627
- unnecessary_statements
- unnecessary_this
- use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review

# === pub rules ===
- package_names
- public_member_api_docs
8 changes: 8 additions & 0 deletions packages/android_alarm_manager/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.4.5

* Add support for Flutter Android embedding V2

## 0.4.4+3

* Add unit tests and DartDocs.

## 0.4.4+2

* Remove AndroidX warning.
Expand Down
31 changes: 30 additions & 1 deletion packages/android_alarm_manager/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 28

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion 16
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -37,3 +40,29 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'
api 'androidx.core:core:1.0.1'
}

// TODO(bkonyi): Remove this hack once androidx.lifecycle is included on stable. https://github.com/flutter/flutter/issues/42348
afterEvaluate {
def containsEmbeddingDependencies = false
for (def configuration : configurations.all) {
for (def dependency : configuration.dependencies) {
if (dependency.group == 'io.flutter' &&
dependency.name.startsWith('flutter_embedding') &&
dependency.isTransitive())
{
containsEmbeddingDependencies = true
break
}
}
}
if (!containsEmbeddingDependencies) {
android {
dependencies {
def lifecycle_version = "1.1.1"
api 'android.arch.lifecycle:runtime:$lifecycle_version'
api 'android.arch.lifecycle:common:$lifecycle_version'
api 'android.arch.lifecycle:common-java8:$lifecycle_version'
}
}
}
}
Loading