Skip to content

Commit

Permalink
Fix version conflicts, verify publishability of packages in CI, Remov…
Browse files Browse the repository at this point in the history
…e Travis (firebase#729)

This fixes a number of version resolution errors that would prevent these packages from building, and turn off Travis, since Cirrus now works.

I also fixed a number of errors that would have prevented these packages from being published without warnings, and establishes a CI script that will verify publishability for any changed packages in a PR.

For some examples, we were depending upon versions of other 1st-party plugins by using path: ../../<package>, which really isn't the right way to do things, so for those examples, they now depend on a published version.

I bumped the version number of any packages that were modified, and updated their CHANGELOGs since the dependencies have changed.

Also fixed a number of analyzer errors that somehow snuck in.
  • Loading branch information
gspencergoog authored Aug 20, 2018
1 parent 77b2fde commit c86d44f
Show file tree
Hide file tree
Showing 33 changed files with 187 additions and 176 deletions.
6 changes: 6 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
task:
container:
image: cirrusci/flutter:latest
cpu: 4
memory: 8G
upgrade_script:
- flutter channel master
- flutter upgrade
- git fetch origin master
activate_script: pub global activate flutter_plugin_tools
matrix:
- name: publishable
script: ./script/check_publish.sh
- name: test+format
install_script:
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
Expand Down Expand Up @@ -41,6 +46,7 @@ task:
- brew install ios-deploy
- pod repo update
- git clone https://github.com/flutter/flutter.git
- git fetch origin master
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor
- pub global activate flutter_plugin_tools
Expand Down
4 changes: 4 additions & 0 deletions packages/cloud_functions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.3

* Added missing dependency on meta package.

## 0.0.2

* Bump Android and Firebase dependency versions.
Expand Down
52 changes: 2 additions & 50 deletions packages/cloud_functions/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,19 @@
name: cloud_functions_example
description: Demonstrates how to use the cloud_functions plugin.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
version: 1.0.0+1
author: Flutter Team <[email protected]>

dependencies:
flutter:
sdk: flutter

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2

dev_dependencies:
flutter_test:
sdk: flutter

cloud_functions:
path: ../

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
path: ..

# The following section is specific to Flutter.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true

# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.

# For details regarding adding assets from package dependencies, see
# https://flutter.io/assets-and-images/#from-packages

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
2 changes: 1 addition & 1 deletion packages/cloud_functions/example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:cloud_functions_example/main.dart';
import '../lib/main.dart';

void main() {
testWidgets('Verify Response', (WidgetTester tester) async {
Expand Down
5 changes: 3 additions & 2 deletions packages/cloud_functions/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cloud_functions
description: Flutter plugin for Cloud Functions.
version: 0.0.2
version: 0.0.3
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_functions

Expand All @@ -10,9 +10,10 @@ flutter:
pluginClass: CloudFunctionsPlugin

dependencies:
meta: ^1.1.6
flutter:
sdk: flutter
firebase_core: "^0.2.2"
firebase_core: ^0.2.2

dev_dependencies:
flutter_test:
Expand Down
4 changes: 4 additions & 0 deletions packages/firebase_admob/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.7

* Bumped mockito dependency to pick up Dart 2 support.

## 0.5.6

* Bump Android and Firebase dependency versions.
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_admob/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: firebase_admob
description: Firebase AdMob plugin for Flutter applications.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_admob
version: 0.5.6
version: 0.5.7

flutter:
plugin:
Expand All @@ -17,7 +17,7 @@ dependencies:
sdk: flutter

dev_dependencies:
mockito: ^2.0.2
mockito: ^3.0.0
flutter_test:
sdk: flutter

Expand Down
4 changes: 4 additions & 0 deletions packages/firebase_analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.3

* Updated test and mockito dependencies to pick up Dart 2 support

## 1.0.2

* Bump Android and Firebase dependency versions.
Expand Down
5 changes: 3 additions & 2 deletions packages/firebase_analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Google Analytics for Firebase, an app measuremen
solution that provides insight on app usage and user engagement on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_analytics
version: 1.0.2
version: 1.0.3

flutter:
plugin:
Expand All @@ -17,7 +17,8 @@ dependencies:
sdk: flutter

dev_dependencies:
mockito: ^2.0.2
test: ^1.3.0
mockito: ^3.0.0
flutter_test:
sdk: flutter

Expand Down
6 changes: 4 additions & 2 deletions packages/firebase_analytics/test/firebase_analytics_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ void main() {
invokedMethod = null;
arguments = null;

when(mockChannel.invokeMethod(typed(any), any))
when(mockChannel.invokeMethod(any, any))
.thenAnswer((Invocation invocation) {
invokedMethod = invocation.positionalArguments[0];
arguments = invocation.positionalArguments[1];
return Future<void>.value();
});

analytics = new FirebaseAnalytics.private(mockChannel);
Expand Down Expand Up @@ -130,9 +131,10 @@ void main() {
name = args['name'];
parameters = args['parameters'];
expect(args.keys, unorderedEquals(<String>['name', 'parameters']));
return Future<void>.value();
});

when(mockChannel.invokeMethod(typed(argThat(isNot('logEvent'))), any))
when(mockChannel.invokeMethod(argThat(isNot('logEvent')), any))
.thenThrow(new ArgumentError('Only logEvent invocations expected'));

analytics = new FirebaseAnalytics.private(mockChannel);
Expand Down
6 changes: 6 additions & 0 deletions packages/firebase_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.5.19

* Update test package dependency to pick up Dart 2 support.
* Modified dependency on google_sign_in to point to a published
version instead of a relative path.

## 0.5.18

* Adding support for updateEmail in FirebaseAuth.
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_auth/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: firebase_auth_example
description: Demonstrates how to use the firebase_auth plugin.
author: Flutter Team <[email protected]>

dependencies:
flutter:
sdk: flutter
firebase_auth:
path: ../
google_sign_in:
path: ../../google_sign_in
google_sign_in: ^3.0.4

flutter:
uses-material-design: true
4 changes: 3 additions & 1 deletion packages/firebase_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Flutter plugin for Firebase Auth, enabling Android and iOS
like Google, Facebook and Twitter.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_auth
version: 0.5.18
version: 0.5.19

flutter:
plugin:
Expand All @@ -18,6 +18,8 @@ dependencies:
sdk: flutter

dev_dependencies:
google_sign_in: ^3.0.4
test: ^1.3.0
flutter_test:
sdk: flutter

Expand Down
4 changes: 4 additions & 0 deletions packages/firebase_database/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.4

* Bumped test and mockito versions to pick up Dart 2 support.

## 1.0.3

* Bump Android and Firebase dependency versions.
Expand Down
5 changes: 3 additions & 2 deletions packages/firebase_database/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Database, a cloud-hosted NoSQL database
with realtime data syncing across Android and iOS clients, and offline access.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_database
version: 1.0.3
version: 1.0.4

flutter:
plugin:
Expand All @@ -17,7 +17,8 @@ dependencies:
firebase_core: ^0.2.2

dev_dependencies:
mockito: ^2.0.2
test: ^1.3.0
mockito: ^3.0.0
flutter_test:
sdk: flutter

Expand Down
4 changes: 4 additions & 0 deletions packages/firebase_messaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.5

* Bumped test and mockito versions to pick up Dart 2 support.

## 1.0.4

* Bump Android and Firebase dependency versions.
Expand Down
5 changes: 3 additions & 2 deletions packages/firebase_messaging/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Cloud Messaging, a cross-platform
messaging solution that lets you reliably deliver messages on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_messaging
version: 1.0.4
version: 1.0.5

flutter:
plugin:
Expand All @@ -18,7 +18,8 @@ dependencies:
sdk: flutter

dev_dependencies:
mockito: ^2.0.2
test: ^1.3.0
mockito: ^3.0.0
flutter_test:
sdk: flutter

Expand Down
14 changes: 4 additions & 10 deletions packages/firebase_messaging/test/firebase_messaging_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,14 @@ void main() {

test('configure', () {
firebaseMessaging.configure();
verify(mockChannel.setMethodCallHandler(typed(any)));
verify(mockChannel.setMethodCallHandler(any));
verify(mockChannel.invokeMethod('configure'));
});

test('incoming token', () async {
firebaseMessaging.configure();
final dynamic handler =
verify(mockChannel.setMethodCallHandler(typed(captureAny)))
.captured
.single;
verify(mockChannel.setMethodCallHandler(captureAny)).captured.single;
final String token1 = 'I am a super secret token';
final String token2 = 'I am the new token in town';
Future<String> tokenFromStream = firebaseMessaging.onTokenRefresh.first;
Expand All @@ -79,9 +77,7 @@ void main() {
test('incoming iOS settings', () async {
firebaseMessaging.configure();
final dynamic handler =
verify(mockChannel.setMethodCallHandler(typed(captureAny)))
.captured
.single;
verify(mockChannel.setMethodCallHandler(captureAny)).captured.single;
IosNotificationSettings iosSettings = const IosNotificationSettings();

Future<IosNotificationSettings> iosSettingsFromStream =
Expand Down Expand Up @@ -110,9 +106,7 @@ void main() {
onResume.complete(m);
});
final dynamic handler =
verify(mockChannel.setMethodCallHandler(typed(captureAny)))
.captured
.single;
verify(mockChannel.setMethodCallHandler(captureAny)).captured.single;

final Map<String, dynamic> onMessageMessage = <String, dynamic>{};
final Map<String, dynamic> onLaunchMessage = <String, dynamic>{};
Expand Down
6 changes: 5 additions & 1 deletion packages/firebase_ml_vision/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## 0.1.2

* Fix example imports so that publishing will be warning-free.

## 0.1.1

Set pod version of Firebase/MLVision to avoid breaking changes.
* Set pod version of Firebase/MLVision to avoid breaking changes.

## 0.1.0

Expand Down
3 changes: 2 additions & 1 deletion packages/firebase_ml_vision/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import 'dart:async';
import 'dart:io';

import 'package:firebase_ml_vision/firebase_ml_vision.dart';
import 'package:firebase_ml_vision_example/detector_painters.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';

import 'detector_painters.dart';

void main() => runApp(new MaterialApp(home: _MyHomePage()));

class _MyHomePage extends StatefulWidget {
Expand Down
5 changes: 2 additions & 3 deletions packages/firebase_ml_vision/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: firebase_ml_vision_example
description: Demonstrates how to use the firebase_ml_vision plugin.

version: 1.0.0+1
author: Flutter Team <[email protected]>

dependencies:
flutter:
sdk: flutter

image_picker: "^0.4.5"
image_picker: ^0.4.5
cupertino_icons: ^0.1.2

dev_dependencies:
Expand Down
Loading

0 comments on commit c86d44f

Please sign in to comment.