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

Commit e5bf93b

Browse files
committed
Document how to use pigeon and update to the latest version.
This mainly splits out the test logic from the messages.dart file.
1 parent ad6d03c commit e5bf93b

File tree

12 files changed

+473
-374
lines changed

12 files changed

+473
-374
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Updating pigeon-generated files
2+
3+
If you update files in the pigeons/ directory, run the following
4+
command in this directory:
5+
6+
```bash
7+
flutter pub get
8+
flutter pub run pigeon --dart_null_safety --input pigeons/messages.dart
9+
(cd ../../../; ./script/incremental_build.sh format --travis --clang-format=clang-format-7)
10+
```
11+
12+
If you update pigeon itself, temporarily update the pubspec.yaml by
13+
adding the following to the `dependency_overrides` section, assuming
14+
you have checked out the `flutter/packages` repo in a sibling
15+
directory to the `plugins` repo:
16+
17+
```bash
18+
pigeon:
19+
path:
20+
../../../../packages/packages/pigeon/
21+
```
22+
23+
Then, run the commands above. When you run `pub get` it should warn
24+
you that you're using an override. If you do this, you will need to
25+
publish pigeon before you can land the updates to this package, since
26+
the CI tests run the analysis using latest published version of
27+
pigeon, not your version or the version on master.
28+
29+
In either case, the configuration will be obtained automatically from
30+
the `pigeons/messages.dart` file (see `configurePigeon` at the bottom
31+
of that file).

packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Autogenerated from Pigeon (v0.1.12), do not edit directly.
1+
// Autogenerated from Pigeon (v0.1.17), do not edit directly.
22
// See also: https://pub.dev/packages/pigeon
33

44
package io.flutter.plugins.videoplayer;

packages/video_player/video_player/ios/Classes/messages.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Autogenerated from Pigeon (v0.1.12), do not edit directly.
1+
// Autogenerated from Pigeon (v0.1.17), do not edit directly.
22
// See also: https://pub.dev/packages/pigeon
33
#import <Foundation/Foundation.h>
44
@protocol FlutterBinaryMessenger;

packages/video_player/video_player/ios/Classes/messages.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Autogenerated from Pigeon (v0.1.12), do not edit directly.
1+
// Autogenerated from Pigeon (v0.1.17), do not edit directly.
22
// See also: https://pub.dev/packages/pigeon
33
#import "messages.h"
44
#import <Flutter/Flutter.h>
@@ -7,7 +7,6 @@
77
#error File requires ARC to be enabled.
88
#endif
99

10-
#ifndef __clang_analyzer__
1110
static NSDictionary *wrapResult(NSDictionary *result, FlutterError *error) {
1211
NSDictionary *errorDict = (NSDictionary *)[NSNull null];
1312
if (error) {
@@ -362,4 +361,3 @@ void FLTVideoPlayerApiSetup(id<FlutterBinaryMessenger> binaryMessenger, id<FLTVi
362361
}
363362
}
364363
}
365-
#endif

packages/video_player/video_player/pigeons/messages.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ abstract class VideoPlayerApi {
5454

5555
void configurePigeon(PigeonOptions opts) {
5656
opts.dartOut = '../video_player_platform_interface/lib/messages.dart';
57+
opts.dartTestOut = '../video_player_platform_interface/lib/test.dart';
5758
opts.objcHeaderOut = 'ios/Classes/messages.h';
5859
opts.objcSourceOut = 'ios/Classes/messages.m';
5960
opts.objcOptions.prefix = 'FLT';

packages/video_player/video_player/pubspec.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: video_player
22
description: Flutter plugin for displaying inline video with other Flutter
33
widgets on Android, iOS, and web.
4-
# 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump
5-
# the version to 2.0.0.
6-
# See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0
74
version: 2.0.0-nullsafety.3
85
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player
96

@@ -31,13 +28,20 @@ dependencies:
3128

3229
flutter:
3330
sdk: flutter
34-
35-
dev_dependencies:
3631
flutter_test:
3732
sdk: flutter
33+
3834
pedantic: ^1.10.0-nullsafety.1
39-
pigeon: 0.1.7
35+
pigeon: 0.1.17
4036

4137
environment:
4238
sdk: ">=2.12.0-0 <3.0.0"
4339
flutter: ">=1.12.13+hotfix.5"
40+
41+
dependency_overrides:
42+
video_player_platform_interface:
43+
path:
44+
../video_player_platform_interface
45+
video_player_web:
46+
path:
47+
../video_player_web

packages/video_player/video_player/test/video_player_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:flutter/widgets.dart';
1212
import 'package:flutter_test/flutter_test.dart';
1313
import 'package:video_player/video_player.dart';
1414
import 'package:video_player_platform_interface/messages.dart';
15+
import 'package:video_player_platform_interface/test.dart';
1516
import 'package:video_player_platform_interface/video_player_platform_interface.dart';
1617

1718
class FakeController extends ValueNotifier<VideoPlayerValue>

0 commit comments

Comments
 (0)