168 Commits

Author SHA1 Message Date
1bbfb60816 [flutter_plugin_tools] Fix subpackage analysis (#5027) 2022-03-11 12:15:26 -08:00
159f6d87b7 [ci] Run analysis with older versions of Flutter (#5000) 2022-03-09 08:35:23 -08:00
199afd96f1 [flutter_plugin_tool] Fix iOS/macOS naming (#4861) 2022-02-15 17:20:24 -08:00
fdba05bf57 [flutter_plugin_tool] Remove podspec --allow-warnings (#4839) 2022-02-14 12:50:12 -08:00
4aeb80aed7 [url_launcher] Support new desktop implementation versions (#4779) 2022-02-10 14:35:22 -08:00
7009234867 Enforce asterisk alignment for C++ and ObjC pointers (#4703)
So far we've been using the default mode of prevailing-in-file, which
means we aren't consistent within each language what mode we use. Now
that clang-format can identify ObjC headers (which didn't used to be the
case), we can enforce different styles for the two languages.

This sets left-aligned for C++ to match the Flutter engine, and
right-aligned for ObjC to match the prevaling Apple style.
2022-01-26 17:59:32 -05:00
0f71f1755b [webview_flutter] Remove dependency on flutter.dev and google.com (#4691) 2022-01-25 13:10:21 -08:00
257f10e19e [all] Update repo links to 'main' (#4690) 2022-01-24 20:25:15 -08:00
902c337f6f [ci] Pin Chromium version for web tests (#4620)
Switches the web tests from using the version of Chrome installed by the Dockerfile, which is whatever happened to be stable when the image is generated, and thus not hermetic, to a pinned version of Chromium. This uses a slightly modified version of the script that is already used for flutter/packages.

Since Chromium doesn't support mp4 playback, this updates the `video_player` integration tests to use WebM on web instead, to avoid having all the tests fail in CI.

Part of https://github.com/flutter/flutter/issues/84712
2022-01-05 12:53:05 -08:00
7855a20369 [flutter_plugin_tools] Auto-retry failed FTL tests (#4610)
Currently the flake situation for Firebase Test Lab tests is very bad,
and the task running those tests are some of the slowest tasks in the
CI. Re-running failed tests is slow, manual work that is signficantly
affecting productivity.

There are plans to actually address the flake in the short-to-medium
term, but in the immediate term this will improve the CI situation, as
well as reducing the drag on engineering time that could be spent on the
root causes.

Part of https://github.com/flutter/flutter/issues/95063
2021-12-15 08:22:52 -08:00
e45a509b35 [tools] fix typo in tools (#4607) 2021-12-10 16:09:20 -08:00
12afeda41e Add missing return for nullably typed function (#4598) 2021-12-10 03:18:07 -08:00
3de67cea56 [flutter_plugin_tools] Improve package targeting (#4577)
Improve package targeting:
- `--run-on-changed-packages` now includes only changed packages in a federated plugin, not all packages. Include all packages isn't useful since (without changes that would cause them to be included anyway) package dependencies are not path-based between packages.
- `--packages` now allows specifying package names of federated plugins. E.g., `--packages=path_provider_ios` will now work, instead of requiring `--packages=path_provider/path_provider_ios`. The fully qualified form still works as well (and is still needed for app-facing packages to disambiguate from the plugin group).

Fixes https://github.com/flutter/flutter/issues/94618
2021-12-07 07:02:24 -08:00
52f49c1aa2 Remove deprecated plugins (#4580)
This removes all of the deprecated plugins from the tree, as well as all references to them.

They were being left in the tree only in case they needed critical fixes before the end of this year, when they will become completely unsupported and be officially discontinued on pub.dev. The end of the year is now close enough that such a release is extremely unlikely, and they are causing some maintenance burden (e.g., the tree is currently closed on an out-of-band failure in android_alarm_manager). In the event that we do have to push an emergency fix in the next several weeks, we can either temporarily restore the plugin from git history, or use a branch.

Minor related cleanup:
- Scanning the repository for remaining references turned up that `image_picker_for_web` and `video_player_for_web` had copypasta'd the package name of its example application from one of the deprecated plugins, so this fixes those names.
- Fixes `federation-safety-check` handling of top-level files in unfederated plugins that accidentally tripped federated plugin heuristics.
- Fixes `federation-safety-check` handling of deleted plugins, as it was crashing, and tests that.
- Fixes `make-deps-path-based` handling of deleted plugins, as it was crashing, and tests that.
2021-12-06 10:23:14 -08:00
5dc663274a [flutter_plugin_tools] Add a new 'make-deps-path-based' command (#4575)
Adds a new command that adds `dependency_overrides` to any packages in the repository that depend on a list of target packages, including an option to target packages that will publish a non-breaking change in a given diff.

Adds a new CI step that uses the above in conjunction with a new `--run-on-dirty-packages` to adjust the dependencies of anything in the repository that uses a to-be-published package and then re-run analysis on just those packages. This will allow us to catch in presubmit any changes that are not breaking from a semver standpoint, but will break us due to our strict analysis in CI.

Fixes https://github.com/flutter/flutter/issues/89862
2021-12-04 09:43:13 -08:00
b25b31427a [flutter_plugin_tools] Check for FlutterTestRunner in FTL tests (#4531)
When running via Firebase Test Lab, ensure that there is a test using
`FlutterTestRunner`. This ensures that a plugin can't silently not run
any of the Dart integration test on Android by having some other native
integration test.

Fixes https://github.com/flutter/flutter/issues/93952
2021-11-23 18:52:01 -08:00
7b6ac13139 [flutter_plugin_tools] Check for missing version and CHANGELOG updates (#4530)
The currently documented repository policy is to:
- require version updates for packages changes that don't meet specific exemptions, and
- require CHANGELOG changes for essentially all changes.

This adds tooling that enforces that policy, with a mechanism for overriding it via PR descriptions, to avoid cases where they are accidentally omitted without reviewers catching it.

In order to facilitate testing (which require mocking another `git` command), this also updates the existing `version-check` tests:
- Replaces the custom git result injection/validating with the newer bind-to-process-mocks approach that is now used in the rest of the tool tests.
- Fixes some tests that were only checking for `ToolExit` to also check the error output, in order to ensure that failure tests are not accidentally passing for the wrong reason (as is being done in general as tests in the tooling are updated).

Fixes https://github.com/flutter/flutter/issues/93790
2021-11-23 08:34:18 -08:00
f4546c0791 [flutter_plugin_tools] Build gtest unit tests (#4492) 2021-11-14 18:26:05 -08:00
d7f8fc267f [flutter_plugin_tools] Add optional timing info (#4500)
Adds a `--log-timing` flag that can be passed to cause package-looping
commands to log relative start time and per-package elapsed time, to
help with future efforts to improve CI times (e.g., finding unusually
slow packages, or designing changes to sharding).

Adds this flag to the CI scripts to enable timing there.
2021-11-14 17:21:32 -08:00
5d15fe9626 [flutter_plugin_tools] Add 'main' support (#4474)
Treat `main` the same as `master` for branch-based switching, in
preparation for switching the branch names in Flutter repositories.

Also updates all of the tests that used `master` as the explicit base to
use `main` instead; what the tests use is arbitrary, so they can be
switched now even though the repo itself hasn't switched.

Part of https://github.com/flutter/flutter/issues/90476
2021-11-10 11:46:35 -08:00
78395e5adf [flutter_plugin_tools] Fix pubspec-check on Windows (#4428)
The repository check always failed when run on Windows, because the
relative path generated to check the end of the URL was using local
filesystem style for separators, but URLs always use POSIX separators.
2021-10-25 08:29:07 -07:00
5bd3ae6a0a [flutter_plugin_tools] Fix license-check on Windows (#4425) 2021-10-20 08:03:04 -07:00
c2717e7699 [ci] Replace Firebase Test Lab deprecated Pixel 4 device with Pixel 5 (#4436) 2021-10-19 10:48:42 -07:00
b7568184de Bump compileSdkVersion to 31 (#4432) 2021-10-15 18:18:02 -07:00
a731d6e131 [flutter_plugin_tools] Validate pubspec description (#4396)
pub.dev deducts points for having a pubspec.yaml `description` that is too short or too long; several of our plugins are losing points on this. To ensure that we are following—and modeling—best practices, this adds a check that our `description` fields meet pub.dev expectations.

Fixes our existing violations. Two are not published even though this only takes effect once published:
- camera: We change this plugin pretty frequently, so this should go out soon without adding a release just for this trivial issue.
- wifi_info_flutter: This is deprecated, so we don't plan to release it. It has to be fixed to allow the tool change to land though.
2021-09-30 10:30:26 -07:00
769043d35a [flutter_plugin_tools] Check licenses in Kotlin (#4373)
The license check overlooked Kotlin, since it's not currently widely
used in our repositories.

Also adds the missing license to one Kotlin file, from an example that
was (likely accidentally) re-generated using Kotlin instead of Java.
2021-09-28 06:20:20 -07:00
3d4782ae62 [flutter_plugin_tools] Improve version check error handling (#4376)
Catches invalid CHANGELOG formats and logs useful error messages for them,
rather than throwing FormatExceptions.
2021-09-23 12:40:04 -07:00
c0aca80c15 [flutter_plugin_tools] Allow overriding breaking change check (#4369) 2021-09-23 10:23:06 -07:00
91ef4b1a00 Add false secret lists, and enforce ordering (#4372) 2021-09-22 10:58:07 -07:00
211a21792e Require authors file (#4367)
Adds a check to `publish-check` that there is an AUTHORS file present,
since our license refers to "The Flutter Authors", so we want to have a
file distributed with each package that says who the AUTHORS are (vs.
just having a top-level repo AUTHORS file, which is not part of package
distribution).

Adds AUTHORS files to packages that have been created since the
earlier one-time fix that added them, but didn't add a check to prevent
future issues.

Also updates the publish-check failure tests to include checks for
specific output so that we know that they are failing for the reasons
the test is expecting, bringing them up to current repo standards for
failure tests.

Fixes https://github.com/flutter/flutter/issues/89680
2021-09-21 12:04:34 -07:00
3e7ec17a0e [flutter_plugin_tools] Fix federated safety check (#4368)
The new safety check doesn't allow simple platform-interface-only
changes because it doesn't actually check that a non-interface package
is actually modified before failing it for a modified platform
interface.

This fixes that, and adds a test case covering it.
2021-09-21 12:03:58 -07:00
1b95825c76 [flutter_plugin_tools] Add a federated PR safety check (#4329)
Creates a new command to validate that PRs don't change platform interface packages and implementations at the same time, to try to prevent ecosystem-breaking changes. See https://github.com/flutter/flutter/issues/89518 for context.

Per the explanation in the issue, this has carve-outs for:
- Changes to platform interfaces that aren't published (allowing for past uses cases such as making a substantive change to an implementation, and making minor adjustments to comments in the PI package based on those changes).
- Things that look like bulk changes (e.g., a mass change to account for a new lint rule)

Fixes https://github.com/flutter/flutter/issues/89518
2021-09-20 10:54:02 -07:00
927e0ab197 Run firebase test in flutter-cirrus (#4332) 2021-09-14 22:02:03 -07:00
ae15095e05 [flutter_plugin_tools] Make no unit tests fatal for iOS/macOS (#4341)
Brings iOS and macOS into alignment with the other platforms, where
having unit tests set up is required.

- For deprecated plugins with no tests, `--exclude`s them, as on other platforms.
- For `quick_actions` and `share`, which have integration tests but no unit tests,
  sets up the unit test scaffolding. (This is done for `share` even though it's
  deprecated since unlike other platforms, iOS/macOS runs both native tests in the 
  same command, and setting up a special way to exclude just units tests for that
  one case would be much more effort.)

Fixes flutter/flutter#85469
2021-09-13 16:37:12 -07:00
2b615cad84 [google_maps_flutter_web] Fix getScreenCoordinate, zIndex of Circles (#4298)
This commit:

* uses the zIndex attribute when converting Circle geometry objects.
* ensures that the getScreenCoordinate method works as expected on the web platform.
  * adds tests that can use a fully-rendered Google Map (see projection_test.dart)
    * changes the initialization flow of the web Google Map, so the Controller is only returned to the main plugin when it's ready to work.

In order to test the getScreenCoordinate method, the Controller of a fully-rendered map must be available on the test, so we can retrieve information from an actual map instance. While working on this, it was observed that the Controller was being sent to the programmer before it was truly ready (while the map was still initializing).

Instead of littering the test with imprecise timeouts that may make these tests slower (and flakier) than needed, this PR also changes the initialization process of a GMap slightly so when its Controller is returned to the user of the plugin (onPlatformViewCreated method call), it is truly ready.

For this: 

* Controller.init is immediately called after the controller is created, 
* The plugin waits for the first onTilesloaded event coming from the JS SDK, and then 
* The Controller is sent to the user

This change happens within "private" sections of the plugin, so programmers using the plugin "normally" shouldn't notice any difference whatsoever (only that the GMap might load slightly faster, and the onPlatformViewCreated callback might be firing a few hundred milliseconds later).
2021-09-10 17:36:22 -07:00
188d56248a [flutter_plugin_tools] Make having no Java unit tests a failure (#4310)
This brings the native Android unit tests in line with the policy of having tests that we expect all plugins to have—unless there's a very specific reason to opt them out—fail when missing instead of skipping when missing, to help guard against errors where we silently fail to run tests we think we are running.

Adds an explicit exclusion list covering the plugins that have a reason to be opted out.

Android portion of flutter/flutter#85469
2021-09-10 13:07:16 -07:00
4ea49f8625 [flutter_plugin_tools] Remove an unnecessary logging message (#4320) 2021-09-10 13:07:06 -07:00
916121b9fb [ci] Enable the new Windows targets (#4325)
Now that the builders have propagated, enable all the new tests and remove the obsolete versions.
2021-09-09 06:59:18 -07:00
8d5bf5953e [flutter_plugin_tools] Adjust diff logging (#4312) 2021-09-03 16:01:04 -07:00
4f63c43ce7 build-examples .pluginToolsConfig.yaml support (#4305) 2021-09-03 15:51:04 -07:00
e8d657cf96 Add a way to opt a file out of Dart formatting (#4292) 2021-09-01 13:11:03 -07:00
0c3fb71cc7 [flutter_plugin_tools] Add Linux support to native-test (#4294)
- Adds a minimal unit test to url_launcher_linux as a proof of concept. This uses almost exactly the same CMake structure as the Windows version that was added recently.
- Adds Linux support for unit tests to `native-test`, sharing almost all of the existing Windows codepath.
- Fixes the fact that it it was running the debug version of the unit tests, but `build-examples` only builds release. (On other platforms we run debug unit tests, but on those platforms the test command internally builds the requested unit tests, so the mismatch doesn't matter.)
- Enables the new test in CI.

Also opportunistically fixes some documentation in `native_test_command.dart` that wasn't updated as more platform support was added.

Linux portion of https://github.com/flutter/flutter/issues/82445
2021-09-01 11:18:22 -07:00
4a92b627b3 [flutter_plugin_tools] Fix build-examples for packages (#4248)
The build-examples command was filtering what it attempted to build by plugin platform, which means it never does anything for non-plugin packages. flutter/packages has steps that run this command, which suggests it used to work and regressed at some point, but nobody noticed; this will re-enable those builds so that we are getting CI coverage that the examples in flutter/packages build.

Mostly fixes https://github.com/flutter/flutter/issues/88435 (needs a flutter/packages tool pin roll to pick this up)
2021-08-31 19:57:43 -07:00
da676376b3 [flutter_plugin_tool] Migrate 'publish' to new base command (#4290)
Moves `publish` to PackageLoopingCommand, giving it the same
standardized output and summary that is used by most other commands in
the tool.

Adds minor new functionality to the base command to allow it to handle
the specific needs of publish:
- Allows fully customizing the set of packages to loop over, to support
  --all-changed
- Allows customization of a few more strings so the output better
  matches the functionality (e.g., using 'published' instead of 'ran' in
  the summary lines).

Fixes https://github.com/flutter/flutter/issues/83413
2021-08-31 10:55:01 -07:00
6919432e62 [flutter_plugin_tool] Move branch-switching logic from tool_runner.sh to tool (#4268)
Eliminates the remaining logic from tool_runner.sh, completing the goal of migrating repository tooling off of bash (both to make maintenance easier, and to better support Windows both locally and in CI). Its branch-based logic is now part of the tool itself, via a new `--packages-for-branch` flag (which is hidden in help since it's only useful for CI).

Part of https://github.com/flutter/flutter/issues/86113
2021-08-31 07:54:41 -07:00
c7e7f65108 [flutter_plugin_tool] Add support for running Windows unit tests (#4276)
Implements support for `--windows` in `native-test`, for unit tests only. The structure of the new code has most of the new functionality in a generic utility for running GoogleTest test binaries, so that it can be trivially extended to Linux support in a follow-up once the Linux test PoC has landed.

This runs the recently-added `url_launcher_windows` unit test. However, it's not yet run in CI since it needs LUCI bringup; that will be done one this support is in place.

Requires new logic to check if a plugin contains native code, and some new test utility plumbing to generate plugins whose pubspecs indicate that they only contain Dart code to test it, to allow filtering filtering out the FFI-based Windows plugins.

Part of flutter/flutter#82445
2021-08-30 11:51:58 -07:00
d3a20df4dc [flutter_plugin_tools] Switch 'publish' from --package to --packages (#4285)
Replaces the `publish`-command-specific `--package` flag with support for `--packages`, and unifies the flow with the existing looping for `--all-changed`.

This better aligns the command's API with the rest of the commands, and reduces divergence in the two flows (e.g., `--package` would attempt to publish and fail if the package was already published, whereas now using `--packages` will use the flow that pre-checks against `pub.dev`). It also sets up a structure that will allow easily converting it to the new base package looping command that most other commands now use, which will be done in a follow-up.

Since all calls now attempt to contact `pub.dev`, the tests have been adjusted to always mock the HTTP client so they will be hermetic.

Part of https://github.com/flutter/flutter/issues/83413
2021-08-28 09:39:15 -07:00
bc3e0ecf85 Remove support for bypassing, or prompting for, git tagging (#4275)
We never want a plugin to be published without tagging the release, so there's no reason to support the added complexity of these flags. Similarly, once someone has confirmed publishing, we don't want to give them an opt-out for doing the tag.
2021-08-27 08:36:03 -07:00
dcf97f741f [flutter_plugin_tool] Add support for building UWP plugins (#4047)
This allows building UWP plugin examples with `build-examples --winuwp`. As with previous pre-stable-template desktop support, this avoids the issue of unstable app templates by running `flutter create` on the fly before trying to build, so a template that will bitrot doesn't need to be checked in.

Also adds no-op "support" for `drive-examples --winuwp`, with warnings about it not doing anything. This is to handle the fact that the LUCI recipe is shared between Win32 and UWP, and didn't conditionalize `drive`. Rather than change that, then change it back later, this just adds the no-op support now (since changing the tooling is much easier than changing LUCI recipes currently).

This required some supporting tool changes:
- Adds the ability to check for the new platform variants in a pubspec
- Adds the ability to write test pubspecs that include variants, for testing

Part of https://github.com/flutter/flutter/issues/82817
2021-08-26 12:07:33 -07:00
e7ef3168bf [flutter_plugin_tools] Move publish tests to RecordingProcessRunner (#4269)
Replaces almost all of the `TestProcessRunner`, which was specific to the `publish` tests, with the repo-standard `RecordingProcessRunner` (which now has most of the capabilities these tests need). This finishes aligning these tests with the rest of the repository tests, so they will be easier to maintain as part of the overall repository.

To support this, `RecordingProcessRunner` was modified slightly to return a succeeding, no-output process by default for `start`. That makes it consistent with its existing `run` behavior, so is a good change in general.
2021-08-26 12:05:28 -07:00