Skip to content

Commit 1d14251

Browse files
[various] Clean up contributing guides (flutter#8032)
Several packages had documentation about how to use Pigeon or Mockito generation; this made sense when those were rare, but they are both now extremely common in our packages. Instead, flutter#158326 adds this information to the general documentation for contribuing to flutter/packages, so it no longer needs to be in (a random subset of) specific packages. This also removes Contributing sections from several READMEs, as READMEs should be client-focused rather than developer-focused, and puts content in CONTRIBUTING.md where needed.
1 parent 4a7b385 commit 1d14251

File tree

20 files changed

+48
-166
lines changed

20 files changed

+48
-166
lines changed

packages/camera/camera_android_camerax/CONTRIBUTING.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ to generate the communication layer between Flutter and native Android code, so
3232
of these Dart-wrapped classes may also have Host API and Flutter API implementations
3333
that handle communication to the host native Android platform and from the host
3434
native Android platform, respectively. The communication interface is defined in
35-
the `pigeons/camerax_library.dart` file. After editing the communication interface,
36-
regenerate the communication layer by running
37-
`dart run pigeon --input pigeons/camerax_library.dart` from the plugin root.
35+
the `pigeons/camerax_library.dart` file.
3836

3937
In the native Java Android code in `android/src/main/java/io/flutter/plugins/camerax/`,
4038
you'll find the Host API and Flutter API implementations of the same classes
@@ -54,7 +52,7 @@ annotated as `@immutable` to avoid lint errors with mock objects that are
5452
generated for them that you may use for testing.
5553

5654
For more information, please see the [design document][2] or feel free
57-
to ask any questions on the #hackers-ecosystem channel on [Discord][6]. For
55+
to ask any questions on the #hackers-ecosystem channel on [Discord][4]. For
5856
more information on contributing packages in general, check out our
5957
[contribution guide][3].
6058

@@ -65,14 +63,8 @@ wrapped native Android classes (Java & Dart) are tested. You can find the Java t
6563
`android/src/test/java/io/flutter/plugins/camerax/` and the Dart tests under `test/`. To
6664
run these tests, please see the instructions in the [running plugin tests guide][5].
6765

68-
Besides [`pigeon`][1], this plugin also uses [`mockito`][4] to generate mock objects for
69-
testing purposes. To generate the mock objects, run
70-
`dart run build_runner build --delete-conflicting-outputs`.
71-
72-
7366
[1]: https://pub.dev/packages/pigeon
7467
[2]: https://docs.google.com/document/d/1wXB1zNzYhd2SxCu1_BK3qmNWRhonTB6qdv4erdtBQqo/edit?usp=sharing&resourcekey=0-WOBqqOKiO9SARnziBg28pg
7568
[3]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md
76-
[4]: https://pub.dev/packages/mockito
69+
[4]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
7770
[5]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/testing/Plugin-Tests.md#running-tests
78-
[6]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md

packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.6+12
2+
3+
* Updates README to remove contributor-focused documentation.
4+
15
## 0.3.6+11
26

37
* Bumps androidx.annotation:annotation from 1.8.2 to 1.9.0.

packages/in_app_purchase/in_app_purchase_android/README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,6 @@ Using the Alternative billing only feature requires Google Play app configuratio
2222
## Migrating to 0.3.0
2323
To migrate to version 0.3.0 from 0.2.x, have a look at the [migration guide](migration_guide.md).
2424

25-
## Contributing
26-
27-
This plugin uses
28-
[json_serializable](https://pub.dev/packages/json_serializable) for the
29-
many data structs passed between the underlying platform layers and Dart. After
30-
editing any of the serialized data structs, rebuild the serializers by running
31-
`flutter packages pub run build_runner build --delete-conflicting-outputs`.
32-
`flutter packages pub run build_runner watch --delete-conflicting-outputs` will
33-
watch the filesystem for changes.
34-
35-
If you would like to contribute to the plugin, check out our
36-
[contribution guide](https://github.com/flutter/packages/blob/main/CONTRIBUTING.md).
37-
38-
3925
[1]: https://pub.dev/packages/in_app_purchase
4026
[2]: https://flutter.dev/to/endorsed-federated-plugin
4127
[3]: https://pub.dev/packages/in_app_purchase_android/install

packages/in_app_purchase/in_app_purchase_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: in_app_purchase_android
22
description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs.
33
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
5-
version: 0.3.6+11
5+
version: 0.3.6+12
66

77
environment:
88
sdk: ^3.5.0

packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.18+5
2+
3+
* Updates README to remove contributor-focused documentation.
4+
15
## 0.3.18+4
26

37
* Adds StoreKit 2 support for restoring purchases.

packages/in_app_purchase/in_app_purchase_storekit/README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ so you do not need to add it to your `pubspec.yaml`.
1212
However, if you `import` this package to use any of its APIs directly, you
1313
should [add it to your `pubspec.yaml` as usual][3].
1414

15-
## Contributing
16-
17-
This plugin uses
18-
[json_serializable](https://pub.dev/packages/json_serializable) for the
19-
many data structs passed between the underlying platform layers and Dart. After
20-
editing any of the serialized data structs, rebuild the serializers by running
21-
`flutter packages pub run build_runner build --delete-conflicting-outputs`.
22-
`flutter packages pub run build_runner watch --delete-conflicting-outputs` will
23-
watch the filesystem for changes.
24-
25-
If you would like to contribute to the plugin, check out our
26-
[contribution guide](https://github.com/flutter/packages/blob/main/CONTRIBUTING.md).
27-
28-
2915
[1]: ../in_app_purchase
3016
[2]: https://flutter.dev/to/endorsed-federated-plugin
3117
[3]: https://pub.dev/packages/in_app_purchase_storekit/install

packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: in_app_purchase_storekit
22
description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework.
33
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
5-
version: 0.3.18+4
5+
version: 0.3.18+5
66

77
environment:
88
sdk: ^3.3.0

packages/interactive_media_ads/CONTRIBUTING.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,9 @@ To update a wrapper for a platform, follow the steps:
144144
- [iOS SDK]
145145
- Pigeon file to update: `pigeons/interactive_media_ads_ios.dart`
146146

147-
##### 3. Run the code generator from the terminal
147+
Once the file is updated, [run pigeon] to update generated code with the changes.
148148

149-
* Android: `dart run pigeon --input pigeons/interactive_media_ads_android.dart`
150-
* iOS: `dart run pigeon --input pigeons/interactive_media_ads_ios.dart`
151-
152-
##### 4. Update the generated APIs in native code
149+
##### 3. Update the generated APIs in native code
153150

154151
Running the `flutter build` step from step 1 again should provide build errors and indicate what
155152
needs to be done. Alternatively, it can be easier to update native code with the platform's specific
@@ -158,7 +155,7 @@ IDE:
158155
* Android: Open `example/android/` in a separate Android Studio project.
159156
* iOS: Open `example/ios/` in Xcode.
160157

161-
##### 5. Write API tests
158+
##### 4. Write API tests
162159

163160
Assuming a non-static method or constructor was added to the native wrapper, a native test will need
164161
to be added.
@@ -169,8 +166,7 @@ to be added.
169166
#### Dart Unit Testing
170167

171168
Tests for the platform implementations use [mockito] to generate mock objects of the native Dart
172-
wrappers. To generate the mock objects in `test/`, run
173-
`dart run build_runner build --delete-conflicting-outputs`.
169+
wrappers. To generate the mock objects in `test/`, [run mockito].
174170

175171
### App-facing Interface
176172

@@ -214,3 +210,5 @@ implementation.
214210
[Android SDK]: https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/package-summary
215211
[iOS SDK]: https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/reference/Classes
216212
[mockito]: https://pub.dev/packages/mockito
213+
[run pigeon]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#pigeon
214+
[run mockito]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#mockito

packages/video_player/video_player_android/CONTRIBUTING.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/video_player/video_player_avfoundation/CONTRIBUTING.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)