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

Commit

Permalink
Merged with master
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanbeusekom committed Sep 2, 2021
2 parents 02e130b + 5d1ed48 commit c3e2fdd
Show file tree
Hide file tree
Showing 562 changed files with 24,453 additions and 8,397 deletions.
54 changes: 51 additions & 3 deletions .ci.yaml
Expand Up @@ -8,9 +8,57 @@
enabled_branches:
- master

platform_properties:
linux:
properties:
caches: >-
[
]
dependencies: >
[
{"dependency": "curl"}
]
device_type: none
os: Linux
windows:
properties:
caches: >-
[
{"name": "vsbuild", "path": "vsbuild"},
{"name": "pub_cache", "path": ".pub-cache"}
]
dependencies: >
[
{"dependency": "certs"}
]
device_type: none
os: Windows

targets:
- name: Windows Plugins
builder: Windows Plugins
postsubmit: false
- name: Windows Plugins master channel
recipe: plugins/plugins
timeout: 30
properties:
dependencies: >
[
{"dependency": "vs_build"}
]
scheduler: luci

- name: Windows Plugins stable channel
recipe: plugins/plugins
timeout: 30
properties:
channel: stable
dependencies: >
[
{"dependency": "vs_build"}
]
scheduler: luci

- name: Linux ci_yaml plugins roller
recipe: infra/ci_yaml
timeout: 30
scheduler: luci
runIf:
- .ci.yaml
109 changes: 71 additions & 38 deletions .cirrus.yml
Expand Up @@ -20,10 +20,28 @@ flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin
# Switch to the requested branch.
- flutter channel $CHANNEL
- flutter upgrade
- git checkout $CHANNEL
# Reset to upstream branch, rather than using pull, since the base image
# can sometimes be in a state where it has diverged from upstream (!).
- git reset --hard @{u}
# Run doctor to allow auditing of what version of Flutter the run is using.
- flutter doctor -v
<< : *TOOL_SETUP_TEMPLATE

build_all_plugins_app_template: &BUILD_ALL_PLUGINS_APP_TEMPLATE
create_all_plugins_app_script:
- dart $PLUGIN_TOOL all-plugins-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
build_all_plugins_debug_script:
- cd all_plugins
- if [[ "$BUILD_ALL_ARGS" == "web" ]]; then
- echo "Skipping; web does not support debug builds"
- else
- flutter build $BUILD_ALL_ARGS --debug
- fi
build_all_plugins_release_script:
- cd all_plugins
- flutter build $BUILD_ALL_ARGS --release

macos_template: &MACOS_TEMPLATE
# Only one macOS task can run in parallel without credits, so use them for
# PRs on macOS.
Expand Down Expand Up @@ -72,40 +90,45 @@ task:
- cd script/tool
- dart analyze --fatal-infos
script:
- ./script/tool_runner.sh analyze
# DO NOT change the custom-analysis argument here without changing the Dart repo.
# See the comment in script/configs/custom_analysis.yaml for details.
- ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml
### Android tasks ###
- name: build_all_plugins_apk
env:
BUILD_ALL_ARGS: "apk"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
- ./script/build_all_plugins_app.sh apk
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
### Web tasks ###
- name: build_all_plugins_web
env:
BUILD_ALL_ARGS: "web"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
- ./script/build_all_plugins_app.sh web
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
### Linux desktop tasks ###
- name: build_all_plugins_linux
env:
BUILD_ALL_ARGS: "linux"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
setup_script:
- flutter config --enable-linux-desktop
- ./script/build_all_plugins_app.sh linux
- name: build-linux+drive-examples
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
- name: linux-build+platform-tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
build_script:
- flutter config --enable-linux-desktop
- ./script/tool_runner.sh build-examples --linux
native_test_script:
- ./script/tool_runner.sh native-test --linux --no-integration
drive_script:
- xvfb-run ./script/tool_runner.sh drive-examples --linux

Expand All @@ -125,7 +148,7 @@ task:
memory: 12G
matrix:
### Android tasks ###
- name: build-apks+java-test+firebase-test-lab
- name: android-build+platform-tests
env:
matrix:
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
Expand All @@ -144,13 +167,22 @@ task:
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- ./script/tool_runner.sh build-examples --apk
java_test_script:
lint_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- ./script/tool_runner.sh java-test # must come after apk build
- ./script/tool_runner.sh lint-android # must come after build-examples
native_unit_test_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
# Native integration tests are handled by firebase-test-lab below, so
# only run unit tests.
- ./script/tool_runner.sh native-test --android --no-integration # must come after apk build
firebase_test_lab_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
Expand All @@ -159,16 +191,19 @@ task:
- export CIRRUS_COMMIT_MESSAGE=""
- if [[ -n "$GCLOUD_FIREBASE_TESTLAB_KEY" ]]; then
- echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
- ./script/tool_runner.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26
- ./script/tool_runner.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26 --exclude=script/configs/exclude_integration_android.yaml
- else
- echo "This user does not have permission to run Firebase Test Lab tests."
- fi
# Upload the full lint results to Cirrus to display in the results UI.
always:
android-lint_artifacts:
path: "**/reports/lint-results-debug.xml"
type: text/xml
format: android-lint
### Web tasks ###
- name: build-web+drive-examples
- name: web-build+platform-tests
env:
# Currently missing; see https://github.com/flutter/flutter/issues/81982
# and https://github.com/flutter/flutter/issues/82211
PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS: "file_selector,shared_preferences_web"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
Expand All @@ -181,7 +216,7 @@ task:
build_script:
- ./script/tool_runner.sh build-examples --web
drive_script:
- ./script/tool_runner.sh drive-examples --web --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
- ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml

# macOS tasks.
task:
Expand All @@ -195,18 +230,14 @@ task:
### iOS tasks ###
- name: build_all_plugins_ipa
env:
BUILD_ALL_ARGS: "ios --no-codesign"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
- ./script/build_all_plugins_app.sh ios --no-codesign
- name: build-ipas+drive-examples
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
- name: ios-build+platform-tests
env:
PATH: $PATH:/usr/local/bin
# in_app_purchase_ios is currently missing tests; see https://github.com/flutter/flutter/issues/81695
# ios_platform_images is currently missing tests; see https://github.com/flutter/flutter/issues/82208
# sensor hangs on CI.
PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS: "in_app_purchase_ios,ios_platform_images,sensors"
matrix:
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
Expand All @@ -221,35 +252,37 @@ task:
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-5 | xargs xcrun simctl boot
build_script:
- ./script/tool_runner.sh build-examples --ios
xctest_script:
- ./script/tool_runner.sh xctest --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --ios
native_test_script:
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
drive_script:
# `drive-examples` contains integration tests, which changes the UI of the application.
# This UI change sometimes affects `xctest`.
# So we run `drive-examples` after `xctest`, changing the order will result ci failure.
- ./script/tool_runner.sh drive-examples --ios --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
# So we run `drive-examples` after `native-test`; changing the order will result ci failure.
- ./script/tool_runner.sh drive-examples --ios --exclude=script/configs/exclude_integration_ios.yaml
### macOS desktop tasks ###
- name: build_all_plugins_macos
env:
BUILD_ALL_ARGS: "macos"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
setup_script:
- flutter config --enable-macos-desktop
- ./script/build_all_plugins_app.sh macos
- name: build-macos+drive-examples
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
- name: macos-build+platform-tests
env:
# conncectivity_macos is deprecated, so is not getting unit test backfill.
# package_info is deprecated, so is not getting unit test backfill.
PLUGINS_TO_EXCLUDE_MACOS_XCTESTS: "connectivity_macos,package_info"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
PATH: $PATH:/usr/local/bin
build_script:
- flutter config --enable-macos-desktop
- ./script/tool_runner.sh build-examples --macos
xctest_script:
- ./script/tool_runner.sh xctest --macos --exclude $PLUGINS_TO_EXCLUDE_MACOS_XCTESTS
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --macos
native_test_script:
- ./script/tool_runner.sh native-test --macos --exclude=script/configs/exclude_native_macos.yaml
drive_script:
- ./script/tool_runner.sh drive-examples --macos
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -28,15 +28,17 @@ jobs:
run: dart pub get
working-directory: ${{ github.workspace }}/script/tool

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

- name: run release
run: |
Expand Down
5 changes: 5 additions & 0 deletions packages/android_alarm_manager/CHANGELOG.md
@@ -1,3 +1,8 @@
## NEXT

* Remove support for the V1 Android embedding.
* Updated Android lint settings.

## 2.0.2

* Update README to point to Plus Plugins version.
Expand Down
49 changes: 0 additions & 49 deletions packages/android_alarm_manager/README.md
Expand Up @@ -74,55 +74,6 @@ will not run in the same isolate as the main application. Unlike threads, isolat
memory and communication between isolates must be done via message passing (see more documentation on
isolates [here](https://api.dart.dev/stable/2.0.0/dart-isolate/dart-isolate-library.html)).


## Using other plugins in alarm callbacks

If alarm callbacks will need access to other Flutter plugins, including the
alarm manager plugin itself, it may be necessary to inform the background service how
to initialize plugins depending on which Flutter Android embedding the application is
using.

### Flutter Android Embedding V1

For the Flutter Android Embedding V1, the background service must be provided a
callback to register plugins with the background isolate. This is done by giving
the `AlarmService` a callback to call the application's `onCreate` method. See the example's
[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).

In particular, its `Application` class is as follows:

```java
public class Application extends FlutterApplication implements PluginRegistrantCallback {
@Override
public void onCreate() {
super.onCreate();
AlarmService.setPluginRegistrant(this);
}

@Override
public void registerWith(PluginRegistry registry) {
GeneratedPluginRegistrant.registerWith(registry);
}
}
```

Which must be reflected in the application's `AndroidManifest.xml`. E.g.:

```xml
<application
android:name=".Application"
...
```

**Note:** Not calling `AlarmService.setPluginRegistrant` will result in an exception being
thrown when an alarm eventually fires.

### Flutter Android Embedding V2

For the Flutter Android Embedding V2, plugins are registered with the background
isolate via reflection so `AlarmService.setPluginRegistrant` does not need to be
called.

For help getting started with Flutter, view our online
[documentation](https://flutter.dev/).

Expand Down
15 changes: 15 additions & 0 deletions packages/android_alarm_manager/android/build.gradle
Expand Up @@ -38,6 +38,21 @@ android {
}
lintOptions {
disable 'InvalidPackage'
disable 'GradleDependency'
baseline file("lint-baseline.xml")
}


testOptions {
unitTests.includeAndroidResources = true
unitTests.returnDefaultValues = true
unitTests.all {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen {false}
showStandardStreams = true
}
}
}
}

Expand Down

0 comments on commit c3e2fdd

Please sign in to comment.