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

Commit

Permalink
[plugin_platform_interface] Migrate to null safety (#3115)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia committed Oct 9, 2020
1 parent 05b1010 commit e5e0c3b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .cirrus.yml
Expand Up @@ -37,7 +37,7 @@ task:
# https://github.com/flutter/flutter/issues/42864
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
- flutter channel $CHANNEL
- ./script/incremental_build.sh test
- ./script/incremental_build.sh test --enable-experiment=non-nullable
- name: analyze
script: ./script/incremental_build.sh analyze
- name: build_all_plugins_apk
Expand Down Expand Up @@ -87,13 +87,13 @@ task:
- echo "$CIRRUS_COMMIT_MESSAGE" > /tmp/cirrus_commit_message.txt
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- ./script/incremental_build.sh build-examples --apk
- ./script/incremental_build.sh build-examples --apk --enable-experiment=non-nullable
- ./script/incremental_build.sh java-test # must come after apk build
- if [[ $GCLOUD_FIREBASE_TESTLAB_KEY == ENCRYPTED* ]]; then
- echo "This user does not have permission to run Firebase Test Lab tests."
- else
- echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
- ./script/incremental_build.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26
- ./script/incremental_build.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26 --enable-experiment=non-nullable
- fi
- export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt`
- export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt`
Expand Down Expand Up @@ -177,8 +177,8 @@ task:
# https://github.com/flutter/flutter/issues/42864
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
- flutter channel $CHANNEL
- ./script/incremental_build.sh build-examples --ipa
- ./script/incremental_build.sh drive-examples
- ./script/incremental_build.sh build-examples --ipa --enable-experiment=non-nullable
- ./script/incremental_build.sh drive-examples --enable-experiment=non-nullable
task:
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
only_if: $CIRRUS_TAG == ''
Expand Down
2 changes: 2 additions & 0 deletions analysis_options.yaml
@@ -1,5 +1,7 @@
include: package:pedantic/analysis_options.1.8.0.yaml
analyzer:
enable-experiment:
- non-nullable
exclude:
# Ignore generated files
- '**/*.g.dart'
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin_platform_interface/CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.1.0-nullsafety

* Migrate to null safety.

## 1.0.3

* Fix homepage in `pubspec.yaml`.
Expand Down
Expand Up @@ -41,7 +41,7 @@ import 'package:meta/meta.dart';
/// [MockPlatformInterfaceMixin] for a sample of using Mockito to mock a platform interface.
abstract class PlatformInterface {
/// Pass a private, class-specific `const Object()` as the `token`.
PlatformInterface({@required Object token}) : _instanceToken = token;
PlatformInterface({required Object token}) : _instanceToken = token;

final Object _instanceToken;

Expand Down
13 changes: 8 additions & 5 deletions packages/plugin_platform_interface/pubspec.yaml
Expand Up @@ -12,17 +12,20 @@ description: Reusable base class for Flutter plugin platform interfaces.
# be done when absolutely necessary and after the ecosystem has already migrated to 1.X.Y version
# that is forward compatible with 2.0.0 (ideally the ecosystem have migrated to depend on:
# `plugin_platform_interface: >=1.X.Y <3.0.0`).
version: 1.0.3
version: 1.1.0-nullsafety

repository: https://github.com/flutter/plugins/tree/master/packages/plugin_platform_interface

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: '>=2.10.0-56.0.dev <3.0.0'

# Don't publish this package until null safety is stable or the package is in the allow list.
publish_to: none

dependencies:
meta: ^1.0.0
meta: ^1.3.0-nullsafety.3

dev_dependencies:
mockito: ^4.1.1
test: ^1.9.4
pedantic: ^1.8.0
test: ^1.10.0-nullsafety.1
pedantic: ^1.10.0-nullsafety.1
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// TODO(egarciad): Remove once Mockito is migrated to null safety.
// @dart = 2.9
import 'package:mockito/mockito.dart';
import 'package:test/test.dart';

Expand Down

0 comments on commit e5e0c3b

Please sign in to comment.