378 Commits

Author SHA1 Message Date
ff81b82176 [camera_web] Adopt code excerpts in README (#4584)
Updates the README to use a compiled excerpt source for its example of creating an `Image`.

Part of https://github.com/flutter/flutter/issues/102679
2023-08-04 18:23:53 +00:00
066e47a5f2 [ci] Add LUCI version of Android FTL tests in bringup mode (#4571)
Adds new LUCI versions of the Android FTL tests. These are new tasks, rather than being part of android_platform_tests, since those are already running the emulator version of the tests, and the combination is far too slow (unless we roughly double the number of shards anyway), and this lets us control the behavior separately (e.g., not running them on `stable`, and potentially making them post-submit only in the future).

Adjusts the repo tooling to make the `gcloud auth` step optional, since that's handled automatically for us in the LUCI environment, and to make it less tightly coupled to the Cirrus configuration by removing those defaults from the tool.

Part of https://github.com/flutter/flutter/issues/114373
See also https://github.com/flutter/flutter/issues/131429
2023-07-28 15:01:10 +00:00
a99fc8765d [tool/ci] Add iOS/macOS and Dart support to fetch-deps (#4562)
Adds `fetch-deps` support for:
- iOS/macOS dependencies, using `pod install`
- Dart package dependencies, using `pub get`

To make avoid doing extra work in the Dart dependencies step when using this with `*_platform_tests` CI, also adds flags for all of the other platforms, and adds a flag that allows skipping Dart dependencies for any package that doesn't have an example supporting any requested platform. This means that we can pass, e.g., `--windows --supporting-target-platforms-only` to only fetch Dart packages for packages with examples that will be build during the build-and-drive Windows tests.

Adds this as a new step in every platform tests CI task, and in the standard analyze step, so that we will pre-fetch Dart packages (and for iOS/macOS, pods). This won't yet fully eliminate later network access (see https://github.com/flutter/flutter/issues/131204), but will give us early warning on any major failures, such as pub being entirely unreachable from the bots.
- These are marked as an infrastructure step; we'll have to see if this ends up being confusing in practice. If `pub` resolution fails for legitimate reasons, such as a PR that tries to require a version of a package that doesn't exist or that has conflicts, this will cause a failure that is marked as infra. My assumption is that the much more common case is going to be that it is actually an infra failure.

Fixes https://github.com/flutter/flutter/issues/130280
2023-07-26 13:06:22 +00:00
2481d92950 [ci] Enable Android emulator-based tests (#4494)
Adds emulators to the Android platform test tasks, and enable both native integration tests and `flutter test` Dart integration tests. This finally gives us presubmit coverage of Android integration tests for non-team-member PRs, as well as giving us a path to reducing the dependency on FTL for all of our Android testing.

Currently this uses Android 13 emulators; we could expand this to a set of legacy version emulator tests in the future once this is in place.

Some specific notes:
- Camera and Google Maps tests are currently excluded, so that we can enable everything else while we work on the blockers for those.
- `shared_preferences` was missing its debug entitlement, which prevented the debug service from running, and thus broke `flutter test`; we'd just never noticed because FTL tests don't need that mechanism to work.
- IAP was using `test` instead of `testWidget`, which we only check for in `drive-examples`, so hadn't noticed.

Fixes https://github.com/flutter/flutter/issues/93810
2023-07-24 20:48:19 +00:00
e06061ce52 [ci] Clean up except exclusion list (#4547)
Removes several entries from the exclusion list where the packages no longer need to be there (e.g., because they had Dart excerpts at some point, but no longer do).

Part of https://github.com/flutter/flutter/issues/102679
2023-07-21 23:10:23 +00:00
e6a71440d8 [go_router] Remove unused dependency (#4545)
Removes `adaptive_dialog` from the example pubspec, as it is not used, and removes the repository allowance for it.

Also updates the comments for the remaining pinned dependency exceptions to reflect the results of the audit.

Part of https://github.com/flutter/flutter/issues/130897
2023-07-21 17:35:51 +00:00
1af4d1a40a [go_router_builder] Removes path_to_regexp from the dependencies (#4524)
Fixes https://github.com/flutter/flutter/issues/130817
Relates to https://github.com/flutter/flutter/issues/122713

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2023-07-21 16:07:51 +00:00
05fdd1337f [plugin_platform_interface] Adopt code-excerpts (#4534)
Updates the README to use code excerpts from the unit test file, adjusting the existing test code slightly to make it suitable for use in the example.

Also fleshes out the example a bit more, to make it look more like a real class.

Finally, adds a note about `base`, linking to the ongoing discussion, since we don't have a decision yet, but people may well wonder why this class exists given `base`.

Part of https://github.com/flutter/flutter/issues/102679
2023-07-20 21:14:10 +00:00
dc41cccbe3 Remove equatable and xml allowances (#4489)
The only package that was using the `equatable` package removed it, so we no longer need this allowance.

The only package depending on `xml` was `flutter_migrate`, but it never actually used it, so that can be removed as well.

Part of https://github.com/flutter/flutter/issues/122713
2023-07-17 18:56:02 +00:00
369ee7e1a1 [Tool] New tool to download android dependencies (#4408)
This pr is pushed for high level feedback/conversation. I will add tests before serious review. 
should be read in conjuction with https://flutter-review.googlesource.com/c/recipes/+/46980

- Create new top level command to run flutter dependencies on changed packages
- when running android tests download dependencies before running tests

https://github.com/flutter/flutter/issues/120119
2023-07-14 16:04:20 +00:00
e2711c1ff9 [ci] Move snippet checks to LUCI (#4446)
Moves the check that README snippets using code excerpting are up to date to LUCI. Now that the check has been rewritten to be extremely fast, it's folded into the existing repo checks instead of being a separate task.

Also adjusts the tooling slightly so that it logs the count of snippets checked, for auditability in CI, like the old version of the excerpt update tooling did.

Part of https://github.com/flutter/flutter/issues/114373
2023-07-12 16:17:07 +00:00
aaebc6ee03 [rfw] Add some more documentation for RFW (#4349) 2023-07-12 07:12:01 +00:00
6fbc9f9018 [ci] Remove unused Chromium setup (#4437)
The tasks that used the Cirrus template and shell script to install a specific version of Chromium have been migrated to LUCI, so this is cruft; I forgot to remove it when finishing that migration.

Also combines two setup steps into one template now that they are only used together.
2023-07-11 22:47:33 +00:00
bd5d19113e [flutter_plugin_tools] Reimplements the excerpt system inline in the tool, rather than relying on a separate package. (#4417)
* Allows excerpts to come from any package, not just examples.
* Fixes a bug in the excerpting logic that was causing a stray `}` to appear in one example.
* Removes the need for `build.excerpt.yaml` files.
* Remove the dependency on build_runner for excerpts.
* Reduces the time to generate the excerpts from about 10 minutes to about 5 seconds.
* Almost certainly fixes https://github.com/flutter/flutter/issues/107180 (untested).

The new logic is not quite backwards compatible; the `path-base` feature now specifies a real path to the actual source directories, rather than a path into the invisible generated `excerpts/` directory with its special structure. Also, a number of features from the previous package that were not actually used in this repository are no longer supported (such as having multiple section names per `#docregion` pragma).
2023-07-11 21:49:24 +00:00
e479ca5d82 [ci] Remove webview_flutter implementation opt outs for custom analysis (#4438)
https://github.com/flutter/flutter/issues/127323 has been closed and the packages no longer have the custom analysis files.
2023-07-11 20:27:53 +00:00
28c419d2ab [tool] Conditionalize color on stdout (#4436)
Refactors colorization to a centralized utility file, and makes it all conditional on `stdout` having ANSI escape support. This makes the output more readable on LUCI, which unlike the Cirrus log display doesn't handle ANSI.

Fixes https://github.com/flutter/flutter/issues/89392
2023-07-11 19:02:59 +00:00
404084cb0a [go_router_builder] Cleans up builder code. (#4356)
No functional change, this is a refactoring of the builder code and pull out external library dependency
2023-07-11 17:04:56 +00:00
b4c3424fb0 [ci] Add initial LUCI legacy analysis (#4428)
Adds new legacy analysis targets to LUCI in bringup mode.

Also updates the repo tooling to use a Flutter->Dart version mapping instead of having to separately maintain a Dart version, now that we already have such a map in the tool anyway.

Part of https://github.com/flutter/flutter/issues/114373
2023-07-10 22:23:25 +00:00
f1f0f240db [tool] Update Dart SDK version (#4402)
Since the tool only needs to support back to Flutter 3.3 (the oldest version we still run CI with), this updates the tool to the corresponding minimum Dart version.

This allows the use of `super` parameters, so `dart fix --apply` was run to convert them all (and remove all the includes that were only needed for setting default values).

Also opportunistically cleans up a bunch of unnecessary, very old `dart:async` includes. (Other than those removals, the changes here are all `dart fix`-generated.)
2023-07-08 14:31:19 +00:00
12ec9fe3f0 [tool] Use 'flutter pub get' for Flutter packages (#4397)
Extracts common logic for running `pub get`, and switches commands to use it. The common logic always uses `flutter pub get` for Flutter packages, rather than `dart pub get`, since the latter will fail if someone has a non-Flutter `dart` in their path before `flutter` (e.g., Dart team members contributing PRs).
2023-07-07 20:22:19 +00:00
902e4bef4c [tool] Fix --current-package for app-facing packages (#4399)
The new `--current-package` flag was returning `foo` when run in the app-facing package of a federated plugin called `foo`, but `foo` as a package argument is treated as being the entire group, so it was running all for all of the packages in the plugin. This fixes it to return `foo/foo` in that case, which is how the tool targets app-facing packages specifically.
2023-07-07 19:04:13 +00:00
9bcf4bfa49 [ci] Add LUCI web platform tests (#4391)
Adds web platform tests for LUCI in bringup mode.

The Cirrus version of the test starts `chromedriver` at the beginning and just leaves it running, which is fine since it's a fresh docker image each run. For LUCI we don't want that behavior though, so instead this adds tooling support for running chromedriver as part of running the integration tests, controllable with a flag. This will also be useful for running locally.

Part of https://github.com/flutter/flutter/issues/114373
2023-07-07 01:10:14 +00:00
fd0415308d [webview_flutter] Enable unawaited_futures lint (#4271)
Removes the exception, and enables the lint, fixing violations.

Although this does make the tests more verbose, explicitly marking everything as unawaited is preferable to turning it off for the whole file since we have had bugs with not correctly awaiting important parts of tests in the past (such as completers).

Part of https://github.com/flutter/flutter/issues/127323
2023-07-07 01:10:12 +00:00
ff00264ec5 [ci] Add partial LUCI Android platform tests (#4381)
Adds an initial Android platform tests LUCI script, and initial targets in bringup mode (using 6 shards instead of the 8 we have in Cirrus since the added shards were to try to address what in retrospect was likely a device availability issue, and since for now this will be running fewer tests; once everything is migrated we can evaluate whether we need more shards).

Rather than wait for emulator and/or FTL support in LUCI to do the migration of this target, this will partially migrate; the script currently does only the parts that don't require any kind of device. That will let us set up a baseline of LUCI Android platform tests bots to easily expand from as we figure out those pieces, and we can turn down these parts of the tests in Cirrus once these come out of bringup mode to minimize duplication.

To avoid having to run a full `flutter build` for both versions, this also updates the repo tooling to use the new `flutter build apk --config-only` option to create `gradlew` without doing a full build.

Part of https://github.com/flutter/flutter/issues/114373
2023-07-06 22:48:01 +00:00
771ec9b42a [ci] Enable LUCI Dart unit tests (#4378)
Enables the new LUCI Dart unit tests.

There is no corresponding Cirrus removal because that test was
accidentally removed early in
https://github.com/flutter/packages/pull/4352.

Part of https://github.com/flutter/flutter/issues/114373
2023-07-06 10:29:55 -04:00
14d9a21617 [ci] Bring up LUCI Linux custom package tests (#4382)
Adds LUCI version of Linux custom package tests.

Removes the custom tests for `cross_file` and `google_identity_services_web` since they only existed to run unit tests in browser mode, which is [now standard for all packages that can be run that way](https://github.com/flutter/packages/pull/4378).

Part of https://github.com/flutter/flutter/issues/114373
2023-07-06 06:53:07 +00:00
1809a6c815 [camerax] Fixes unawaited_futures violations (#4337)
Fixes `unawaited_futures` violations in `camera_android_camerax` plugin. The only `await`s that I did not add are those related to closing/disposing native objects that shouldn't require us to wait for completion.

Part of https://github.com/flutter/flutter/issues/127323.
2023-07-05 17:28:59 +00:00
38745bffef [tools] Switch to flutter test (#4348)
For non-web platforms, `flutter drive` is deprecated. This switches those platforms from `flutter drive` to `flutter test`. This makes the logic to check for test driver files web-specific, since `flutter test` doesn't require a driver.

Removes support for the legacy test-in-test_driver-directory structure, which is no longer used anywhere in the repository.

Also includes a minor drive-by fix to the way we do process output, noticed while manually testing. Instead of adding all stdout, and only then adding all stderr, this adds both then waits for both, which should allow interleaving of stdout and stderr in the terminal.

Fixes https://github.com/flutter/flutter/issues/105634
2023-07-05 15:47:57 +00:00
704207985a [ci] Add a web version of Dart unit tests (#4352)
Adds new LUCI targets in bringup mode to run all possible Dart unit tests in Chrome.

This is a new test (see linked issue), not a port of a Cirrus test, so it involves changes to tooling and packages:
- The tooling now accepts an explicit platform. The default behavior if none is provided is the previous behavior of running in VM for everything but web plugin implementations (since that's convenient locally).
- The tooling now has a basic understanding of `dart_test.yaml` `test_on` directives, to know when to skip.
- Packages that don't support web have opt-out files.
- Packages that do support web but have a few tests that fail on web have those tests opted out.
- Packages that do support web but have a lot of failures on web have temporary opt-out files with TODOs + issue links.

Most of https://github.com/flutter/flutter/issues/128979
2023-07-05 00:27:25 +00:00
8b3b1ef91f [tool] Add a flag to skip cleanup (#4357)
It can be useful in debugging snippet setup to look at the extraction output, but the tool cleans that up automatically. Running the extraction manually is complicated due to the on-the-fly pubspec modifications, so this adds a `--no-cleanup` flag that can be used to skip the deletion of the extraction output, and instead log its location to the terminal.
2023-07-01 10:53:16 +00:00
41d5ca918d [file_selector] Endorse Android (#4329)
Endorses the new Android implementation of `file_selector`, updating the README accordingly.

Also adjusts the example to better handle platform diffs, by hiding UI that doesn't work instead of just labelling it on the button. Left a TODO to improve how we determine what to hide once we have the API to do so.

Fixes https://github.com/flutter/flutter/issues/110098
2023-07-01 10:53:14 +00:00
d4752c4069 [metrics_center] Add retries to unlock a lock file in case of 504 errors (#4323)
* https://github.com/flutter/flutter/issues/120440
* Updates the `GcsLock` class to retry unlocking the file in case a 504 error occurs
* Updates the `GcsLock` constructor to require a `StorageApi` object instead of `AuthClient`, which allows mocking the object, since the `AuthClient` object isn't actually being used within the `GcsLock` class besides to create the `StorageApi`.
2023-06-29 16:00:18 +00:00
48232e890b [tool] Consider comment-only changes to be dev-only (#4279)
Updates the state checker to inspect changed Dart files to see if the only changes are implementation (not documentation) comment lines. In particular, this will fix the problem of CI flagging changes that do nothing but add `// ignore:` comments (for federated package changes involving deprecation, framework changes that require temporary ignores in packages to support stable, etc.) as needing version and changelog changes
2023-06-23 17:06:07 +00:00
04bb2ac418 [tools] Fix format instructions (#4259)
The instructions for `format` failures still referred to using `activate`, which is no longer how tools are invoked. Replace the specific instructions with a link to the relevant README section to make them evergreen.
2023-06-21 20:28:09 +00:00
3b2c441370 [tools] Add mockito support to update-dependency (#4260)
Regenerates mocks when updating `mockito` using the tooling.

Fixes https://github.com/flutter/flutter/issues/124196
2023-06-21 14:02:56 +00:00
59d93d64cb [tool] Add command aliases (#4207)
Adds aliases for all commands that put the verb first, since currently they are inconsistent which can make it hard to remember (in particular, I often write `check-foo` instead of `foo-check` when running locally, and it fails).

Also does the long-overdue renaming of `test` to `dart-test`, since we now have `native-test`, `custom-test`, etc. `test` continues to work as an alias for individual muscle memory.
2023-06-16 13:01:25 +00:00
fa2e8a0528 [tool] Support code excerpts for any .md file (#4212)
Updates `update-excerpts` to support any top-level .md file (other than CHANGELOG.md), rather than just README.md. This is useful for supplemental content, such as migration guides linked from the main README file.

Also makes some small improvements to the error messaging:
- The list of incorrect files is now relative to, and restricted to, the package. This makes the error message simpler, and ensures that changed files in other packages don't get listed.
- Adds a link to the relevant wiki docs, since this has been a source of confusion for newer contributors.
2023-06-15 13:57:35 +00:00
7869896018 [image_picker] getMedia platform implementations (#4175)
Adds `getMedia` and `getMultipleMedia` methods to all image_picker
platforms.

~~waiting on https://github.com/flutter/packages/pull/4174~~

precursor to https://github.com/flutter/packages/pull/3892

part of https://github.com/flutter/flutter/issues/89159

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [relevant style guides] and ran the
auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages
repo does use `dart format`.)
- [x] I signed the [CLA].
- [x] The title of the PR starts with the name of the package surrounded
by square brackets, e.g. `[shared_preferences]`
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated `pubspec.yaml` with an appropriate new version according
to the [pub versioning philosophy], or this PR is [exempt from version
changes].
- [x] I updated `CHANGELOG.md` to add a description of the change,
[following repository CHANGELOG style].
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[relevant style guides]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[pub versioning philosophy]: https://dart.dev/tools/pub/versioning
[exempt from version changes]:
https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#version-and-changelog-updates
[following repository CHANGELOG style]:
https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changelog-style
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
2023-06-14 17:34:05 -07:00
f9314a3b83 [tool] Support running main.dart (#4208)
The change to how the repository is located assumed the script was being
run from bin/flutter_plugin_tools.dart, but it can also be run directly
from lib/src/main.dart which was broken. This restores the ability to
run it either way.

Fixes the tree breakage in `release`.
2023-06-13 22:07:53 -04:00
eed9b68284 [tool] Allow running from anywhere (#4199)
Now that the repo tooling is always run from source, not via `pub global`, we no longer need to infer the repo location from the current directory. Instead, hard-code knowledge of where the repository root is. This makes it much easier to run the tooling, since it's common to be in a package directory rather than the repo root.

To make it even easier to run from within a package, this also adds a `--current-package` as an alternative to `--packages`. This makes it possible to, e.g., write local wrapper scripts that run a specific set of commands on whatever the current package happens to be (such as a generic version of the script discussed in https://github.com/flutter/packages/pull/4129).

As related cleanup, makes the tool non-publishable (we haven't been publishing it since the repo merge, but I never made it unpublishable; this is important now that it would not work if published) and remove the LICENSE and CHANGELOG since it's no longer a stand-alone package.

Fixes https://github.com/flutter/flutter/issues/128231
Fixes https://github.com/flutter/flutter/issues/128232
2023-06-13 17:24:56 +00:00
ecf2b68093 [image_picker] Add desktop support - implementations (#4172)
Platform implementation portion of
https://github.com/flutter/packages/pull/3882

Updates the Windows implementation to use the new base class for camera delegation, and creates new macOS and Linux implementations that are near-duplicates.

These are separate packages, rather than a single shared package, because it's likely that they will diverge over time (e.g., the TODO for macOS to use a system image picker control on newer versions of macOS), and the amount of code that could be shared is minimal anyway.

Part of https://github.com/flutter/flutter/issues/102115 Part of https://github.com/flutter/flutter/issues/102320 Part of https://github.com/flutter/flutter/issues/85100
2023-06-09 21:40:38 +00:00
e13b8c4338 [tool] Only run unit tests in Chrome for inline web (#4153)
Currently we are running Dart unit tests in Chrome for any plugin with
web support, but it should only be necessary for plugins that have an
inline web implementation, not for app-facing packages that endorse a
web implementation.
2023-06-08 14:38:03 +00:00
e37dd83c91 [various] Add http 1.0 compatibility (#4147)
The `http` package was updated to 1.0. There are no change that affect our usage (it just adds new class restrictions), so this extends all dependencies to include both 0.13.x and 1.x.

All changes here are tool-applied (`update-dependencies` and `update-release-info`) except for the script/tools/ pubspec update, so are identical in all packages.

Fixes https://github.com/flutter/flutter/issues/127926
2023-06-07 21:07:10 +00:00
a84b2c2ac3 [ci] Exclude maps unit tests on Windows (#4152)
Now that `google_maps_flutter` supports web, add it to the list of tests
that don't currently run correctly on a Windows CI host.

Also enables multidex in `local_auth` to fix an OOB failure from the
recent publishing of local_auth_android.
2023-06-06 19:28:09 -04:00
08374a5f44 [tools] Fix OOB test error (#4144)
An update to `args` changed the failure mode for a missing flag; this
updates the tests accordingly to fix the tree.
2023-06-05 16:20:38 -04:00
97e3ba64d7 [various] Fixes unawaited_futures violations (#4067)
This option had been disabled to match flutter/flutter, but the reason it was disabled there was "too many false positives", mostly around animation. That doesn't apply to most packages here, and we've had a number of production bugs—especially in plugins, that use async heavily in ways that are intended to be client-awaitable—that this would have caught.

This PR:
- Enables the option at the repo level.
- Permanently (unless the owners decide to change it) opts out `animations` and `go_router`, both of which looked like mostly or entirely false positives.
- Temporarily opted out a few plugins that have a lot of violations that should be handled in their own PRs later (`camera_android_camerax`, most of `webview_flutter`).
- Fixes all remaining violations.

In many cases this PR is behavior-changing, replacing implicitly unawaited futures that did not seem obviously intentional with `await`ed futures, so non-test code in particular should be reviewed carefully to make sure the changes are correct. All of the changes are manual, not `fix`-generated.

Part of https://github.com/flutter/flutter/issues/127323
2023-05-24 15:39:26 +00:00
d449a17f87 [various] Remove unnecessary null checks (#4060)
Removes `unnecessary_null_comparison: ignore` from the repository analysis options. Now that Dart 3 has reached the stable channel, all fully supported customers will be running in strong mode, so the extra null checks are no longer needed. While many packages do support earlier versions, this won't break anyone, it will just mean that people who are both a) using old versions of Flutter and b) violating the API contract by passing null to a non-nullable type, won't get error messages that are as obvious, which is fine for the best-effort support level we give to pre-current-stable versions of Flutter.
2023-05-22 20:10:40 +00:00
30ebcf38c9 [ci] Add a legacy Android build-all test (#4005)
Adds the ability to replace portions of the `flutter create`d app with saved copies, and adds a second build-all phase for Android that uses a Flutter 2.0.6-created `android/` directory (AGP 4.1, Gradle 6.7) to catch issues like https://github.com/flutter/flutter/issues/125621 and https://github.com/flutter/flutter/issues/125482 prior to release.

Includes some incidental cleanup:
- Extracts a helper method for adjusting files, so that this doesn't add even more copies of basically identical code.
    - (This was motivated by an earlier version of the PR that added modifications to several more files, which I ended up undoing, but the cleanup seemed worth keeping.)
- Adds missing unit test coverage.
- Reworks the unit tests to use a mock process manager and dummy files, instead of each test actually calling `flutter create`, which made each new test add several seconds to the unit test suite.
    - While this reduces the integration-style coverage, in practice the integration tests of the repo tooling is the CI itself, so the unit tests should be true unit tests.
- Changes the non-legacy test to Kotlin; we were still testing with Java even though Kotlin has been the default for quite a while, so we weren't testing what most new users would actually be running. Since we now have a legacy test, I used Java there to cover both.
- Removes some dead code for modifying the AndroidManifest.xml; when trying to set up unit tests for it I discovered that it no longer matches anything in an actual project. It dates back to the original command, and seems to have been a camera-related hack, which we clearly no longer need since it wasn't working and camera still works in build-all.

This is captured somewhat in the README in the legacy project directory, but to document the approach here: originally I was going to add flags to change individual items (AGP version, Gradle version), but quickly ran into the fact that selective downgrading is extremely fragile. E.g.,:
- The Kotlin version set in current projects doesn't work when downgrading AGP and Gradle.
- The app template can unconditionally use anything (e.g., `namespace`) that the AGP version it uses supports, so arbitrary future breakage is possible.

It's also less useful as a real test of what a plugin client's project likely looks like. Starting with a complete platform directory, and doing whatever the minimal changes are to keep it working, will likely reflect a common real-world scenario. On the flip side, the reason this doesn't use a complete 2.0.6 project, but instead is based on specific platform directories, is that we don't want to waste time manually maintaining, e.g., old Dart code that is irrelevant to the goal of the test. For now this only uses Android because that's where we've seen problems in practice, but we can alway add other legacy platform tests later if we find a need.

Fixes https://github.com/flutter/flutter/issues/125689
2023-05-22 20:10:38 +00:00
a78a9137fa [tools] Ignore comments in federated safety check (#4028)
Because we treat analysis warnings as errors, there are common cases where non-breaking changes to part of a federated plugin (adding an enum value, deprecating a method, etc.) are CI-breaking for us. Currently we can't ignore those issues in the same PR where they are added, because doing so would violate the federated saftey check, adding extra complexity to those PRs.

This improves the change detection logic for the federated safety check to ignore comment-only changes in Dart code, which should allow us to add temporary `// ignore:`s in the PRs that create the need for them.

Fixes https://github.com/flutter/flutter/issues/122390
2023-05-17 20:28:24 +00:00
2b38236a95 [ci] Re-enable Windows repo tool tests (#4007)
Fixes publish test to always expect the command being run to be 'flutter', since it uses a mock platform that reports as Linux.

Fixes https://github.com/flutter/flutter/issues/126750
2023-05-17 01:22:30 +00:00