|
| 1 | +## Updating pigeon-generated files |
| 2 | + |
| 3 | +If you update files in the pigeons/ directory, run the following |
| 4 | +command in this directory (ignore the errors you get about |
| 5 | +dependencies in the examples directory): |
| 6 | + |
| 7 | +```bash |
| 8 | +flutter pub upgrade |
| 9 | +flutter pub run pigeon --dart_null_safety --input pigeons/messages.dart |
| 10 | +# git commit your changes so that your working environment is clean |
| 11 | +(cd ../../../; ./script/incremental_build.sh format --travis --clang-format=clang-format-7) |
| 12 | +``` |
| 13 | + |
| 14 | +If you update pigeon itself and want to test the changes here, |
| 15 | +temporarily update the pubspec.yaml by adding the following to the |
| 16 | +`dependency_overrides` section, assuming you have checked out the |
| 17 | +`flutter/packages` repo in a sibling directory to the `plugins` repo: |
| 18 | + |
| 19 | +```bash |
| 20 | + pigeon: |
| 21 | + path: |
| 22 | + ../../../../packages/packages/pigeon/ |
| 23 | +``` |
| 24 | + |
| 25 | +Then, run the commands above. When you run `pub get` it should warn |
| 26 | +you that you're using an override. If you do this, you will need to |
| 27 | +publish pigeon before you can land the updates to this package, since |
| 28 | +the CI tests run the analysis using latest published version of |
| 29 | +pigeon, not your version or the version on master. |
| 30 | + |
| 31 | +In either case, the configuration will be obtained automatically from |
| 32 | +the `pigeons/messages.dart` file (see `configurePigeon` at the bottom |
| 33 | +of that file). |
| 34 | + |
| 35 | +While contributing, you may also want to set the following dependency |
| 36 | +overrides: |
| 37 | + |
| 38 | +```yaml |
| 39 | +dependency_overrides: |
| 40 | + video_player_platform_interface: |
| 41 | + path: |
| 42 | + ../video_player_platform_interface |
| 43 | + video_player_web: |
| 44 | + path: |
| 45 | + ../video_player_web |
| 46 | +``` |
| 47 | +
|
| 48 | +## Publishing plugin updates that span multiple plugin packages |
| 49 | +
|
| 50 | +If your change affects both the interface package and the |
| 51 | +implementation packages, then you will need to publish a version of |
| 52 | +the plugin in between landing the interface changes and the |
| 53 | +implementation changes, since the implementations depend on the |
| 54 | +interface via pub. |
| 55 | +
|
| 56 | +To do this, follow these steps: |
| 57 | +
|
| 58 | +1. Create a PR that has all the changes, and update the |
| 59 | +`pubspec.yaml`s to have path-based dependency overrides as described |
| 60 | +in the "Updating pigeon-generated files" section above. |
| 61 | + |
| 62 | +2. Upload that PR and get it reviewed and into a state where the only |
| 63 | +test failure is the one complaining that you can't publish a package |
| 64 | +that has dependency overrides. |
| 65 | + |
| 66 | +3. Create a PR that's a subset of the one in the previous step that |
| 67 | +only includes the interface changes, with no dependency overrides, and |
| 68 | +submit that. |
| 69 | + |
| 70 | +4. Once you have had that reviewed and landed, publish the interface |
| 71 | +parts of the plugin to pub. |
| 72 | + |
| 73 | +5. Now, update the original full PR to not use dependency overrides |
| 74 | +but to instead refer to the new version of the plugin, and sync it to |
| 75 | +master (so that the interface changes are gone from the PR). Submit |
| 76 | +that PR. |
| 77 | + |
| 78 | +6. Once you have had _that_ PR reviewed and landed, publish the |
| 79 | +implementation parts of the plugin to pub. |
| 80 | + |
| 81 | +You may need to publish each implementation package independently of |
| 82 | +the main package also, depending on exactly what your change entails. |
0 commit comments