Adds initial file-based filtering. This does not attempt to be comprehensive, just to get some low-hanging fruit, and to create a blueprint for anyone to follow in the future when adding more filtering. I expect that once this is in place, what will happen is that as we notice cases where PRs are hitting slow or flaky tests that they clearly don't need to, we can incrementally improve the filtering on demand.
Fixes https://github.com/flutter/flutter/issues/136394
Follow-up to https://github.com/flutter/packages/pull/9075. On iOS and
macOS, `native-test` also requires an unconditional project file
generatino in debug mode now, to ensure that the debug Xcode build of
the tests will not fail due to a build mode mismatch.
Unblocks the flutter/flutter->flutter/packages roller.
Currently xcode-analyze relies on the native project files already having been generated. This is unreliably locally, and now is problematic on CI as well since Xcode builds now (as of https://github.com/flutter/flutter/pull/165916) must match the last build mode, so analysis will fail if the previous CI step built in release mode (as is currently the case).
This adds a config-only build call in debug mode before analyzing. Since running a config-only build is a common operation in the tool, this extracts a helper to abstract the logic.
Unblocks the flutter/flutter->flutter/packages roller.
Consolidates the code to find all changed file paths into the `PackageLoopingCommand` class that is the base of almost all of the repo tooling commands. This in a preparatory PR for a future change to allow each command to define a list of files or file patterns that definitively *don't* affect that test, so that CI can be smarter about what tests to run (e.g., not running expensive integration tests for README changes).
A side effect of this change is that tests of almost all commands now need a mock `GitDir` instance. This would add a lot of copy/pasted boilerplate to the test setup, and there is already too much of that, so instead this refactors common test setup:
- Creating a memory file system
- Populating it with a packages directory
- Creating a RecordingProcessRunner to mock out process calls
- Creating a mock GitDir that forwards to a RecordingProcessRunner
into a helper method (using records and destructuring to easily return multiple values). While some tests don't need all of these steps, those that don't can easily ignore parts of it, and it will make it much easier to update tests in the future if they need them, and it makes the setup much more consistent which makes it easier to reason about test setup in general.
Prep for https://github.com/flutter/flutter/issues/136394
Checks that plugins use `compileSdk` rather than the deprecated `compileSdkVersion`, and that if they set it to
`flutter.compileSdkVersion` they require at least Flutter 3.27.
Would have prevented https://github.com/flutter/flutter/issues/164362
Today, we treat Xcode warnings as errors on all iOS and macOS plugins.
However, the google_sign_in_ios plugin has dependencies with warnings. We're unable to suppress these warnings when using Swift Package Manager. As a workaround, we'll need to disable Xcode warnings for the google_sign_in_ios plugin. This will be done in a subsequent pull request (see https://github.com/flutter/packages/pull/7356).
This change introduces `--xcode-warnings-exceptions` to the `native-test` command. When running Xcode test, `GCC_TREAT_WARNINGS_AS_ERRORS` will be provided only if the plugin isn't on the exception list.
Additionally, plugins that are the exception list are excluded from the `xcode-analyze` command.
Part of https://github.com/flutter/flutter/issues/146904
Updates `make-deps-path-based` to manually output dependency overrides in sorted order, as `YamlMap` apparently doesn't have a defined output ordering, leading to CI analysis failures in some cases.
Fixes https://github.com/flutter/flutter/issues/160810
Re-re-lands https://github.com/flutter/packages/pull/8494 with a change to remove `--ignored` from the `git status` check in the repo tooling `publish` command, which is what caused the `release` failure in the last landing. `pub publish` has ignored files in `.gitignore` for years, so there's no longer any value in checking that they don't exist.
I've verified that `publish --dry-run` passes locally with this change. Server-only check failures could still potentially cause another revert, but those can't be found other than the hard way.
Multiple commands in the Flutter plugin tool have arguments that accepts a list of strings or a list of YAML files that contain a list of strings. This introduces a `getYamlListArg` helper so that this logic doesn't need to be duplicated multiple times.
In a subsequent pull requests, this will be used to add a list of packages that are allowed to have Xcode warnings. This will be used by the google_sign_in_ios package which will have warnings when using SwiftPM.
Part of: https://github.com/flutter/flutter/issues/146904
Currently the special-casing for allowing comment-only changes to other packages in a plugin group as part of a single PR, which is necessary for some changes to add `// ignore` directives, allows comment lines, but not blank lines. Blank lines should be allowed since they are safe, and are expected for certain changes (notably, temporary file-level ignores).
Adds CI configuration to run web integration tests (in the master channel) compiled to Wasm.
It also removes the `build-examples` step from web integration tests, in some isolated testing:
| platform tests shard | With build-examples | Without build-examples |
|---|-----|-----|
| 1 | 30m | 21m |
| 2 | 13m | 11m |
| 3 | 17m | 10m |
## Issues
* Fixes https://github.com/flutter/flutter/issues/151664
This PR fixes a couple of issues that have popped up in the CI of the tree in the last couple of days:
1. Disables some Android video_player tests that require network access.
2. Fixes our internal tool after a breaking change was made in an upstream dependency.
## Issues
* Mitigates https://github.com/flutter/flutter/issues/160797
* Fixes https://github.com/flutter/flutter/issues/160799
adds event channel support for kotlin and swift
work towards https://github.com/flutter/flutter/issues/66711
adds sealed classes with extensions (empty base classes only)
fixes https://github.com/flutter/flutter/issues/155859 (Fix a small inconsistency with Pigeon docs)
adds some convenience methods to Root
fixes generation/format tests to include test pigeons
Makes swift codec class names upper camel case
This updates the license check to ignore any file contained in a `FlutterGeneratedPluginSwiftPackage` directory.
https://github.com/flutter/packages/pull/8128 was reverted as it caused the license check to [fail](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8730732827684094689/+/u/Run_package_tests/license_validation/stdout):
```
The license block for these files is missing or incorrect:
/b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher/example/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift
/b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher/example/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Sources/FlutterGeneratedPluginSwiftPackage/FlutterGeneratedPluginSwiftPackage.swift
/b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher/example/macos/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift
/b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher/example/macos/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Sources/FlutterGeneratedPluginSwiftPackage/FlutterGeneratedPluginSwiftPackage.swift
If this third-party code, move it to a "third_party/" directory, otherwise ensure that you are using the exact copyright and license text used by all first-party files in this repository.
```
Part of https://github.com/flutter/flutter/issues/159173
If the `flutter test` run takes more than 10 minutes (default timeout is 12 minutes) take a screenshot and attach to the logs directory.
Helped debug https://github.com/flutter/flutter/issues/153578#issuecomment-2465941063.
Probably `flutter test` should have a screenshot option similar to `flutter drive`, but at the moment it doesn't.
The new Dart formatter needs to know the Dart language version of the
code it is formatting, and it reads that from a file in `.dart_tool`,
not `pubspec.yaml` directly. To avoid it failing to determine the
version and assuming the latest (which will almost always be wrong in
this repo):
- Adds a step to the `format` repo command to ensure that `pub get`
appears to have been run, and runs it if not, and
- To avoid `pub get` running in `format` in CI, adds a deps-fetching
step to the `repo_checks` task, as we have in other tasks that need to
`pub get`.
This should unblock the roll.
Removes `.flutter-plugins` reference from example by (1) deleting the `packages/animations/example/android` directory, (2) running (in the `packages/animations` directory)
```
flutter create example --platforms android -a kotlin --org "dev.flutter.packages.animations"
```
and then (3) manually made the following changes:
- Added back `packages/animations/example/android/.pluginToolsConfig.yaml` (removed by command)
- Updated the Gradle version from 8.7 to 8.3 (downgraded by command)
- Deleted `example/analysis_options.yaml` (added by command)
- Deleted `example/test/` (added by command)
- Added back artifact hub
- Removed template TODOs
- Bumped Kotlin Gradle version to 1.9.0
- Bumped AGP version from 8.1.0 to 8.5.1.
Part of https://github.com/flutter/flutter/issues/157660.
Instead of running Dart formatting on the whole repo at once, run it per
package, from the package's directory. This is slower, but necessary
since the new formatter behaves differently depending on the package's
min SDK version.
â ï¸ _This PR does not update packages' versions as it only affects unpublished parts of example apps and tests._
We added `use_modular_headers!` to our `Podfile`s as we originally planned to phase out `use_frameworks!` (see https://github.com/flutter/flutter/pull/42204). However, our plans have now changed and we are instead phasing out CocoaPods entirely in favor of Swift Package Manager.
CocoaPods's `use_frameworks!` and `use_modular_headers!` are two different overlapping options that should not be used together. This change removes the `use_modular_headers!` from example apps' `Podfile`s. This change does not affect packages themselves.
Part of https://github.com/flutter/flutter/issues/156259
Imports https://github.com/dnfield/flutter_svg into this repository,
with history, and updates it to follow repository conventions:
- Updates min SDKs.
- Removes analysis options and fixes resulting warnings.
- Autoformats.
- Updates pubspecs to follow repo standard.
- Updates repo tooling to allow the `flutter_svg_test` non-dev
dependency on `flutter_test`.
- Adds repo metadata.
- Adds METADATA files.
- Bumps versions and slightly relax version constraints for
vector_graphics* to allow the new versions.
Imports https://github.com/dnfield/vector_graphics into this repository,
with history, and updates it to follow repository conventions:
- Adds missing licence headers.
- Removes analysis options and fixes resulting warnings.
- Updates min SDKs.
- Autoformats.
- Updates pubspecs to follow repo standard, including updating the
metadata
to point to the Flutter repositories.
- Allows `xml` as a pinned dependency, and relaxes the pinning
requirement
in the repo tools to allow an explicit, inclusive-endpoint range.
- Skips some unit tests on unsupported platforms.
- Adds repo metadata.
- Bumps versions and slightly relax version constraints to allow the new
versions.
Currently the autoformatter check is run per-package, so doesn't include script/tool. This adds a new CI step to check the formatting of the repo tooling, just as we have for running its unit tests.
Fixes `--current-package` so that when run on a package in third_party/packages/ in works as expected, rather than failing with an error message saying that it must be run from inside a package.
`made-deps-path-based` would sometimes create invalid relative paths when `third_party/packages` was involved because it was using the sibling directory of `packages` as the base. This updates the logic to always make the paths relative to the repository root; this is often a longer relative path than necessary, but that's harmless, and always using the repo root makes it easier to reason about.
Also fixes the fact that paths that were already path based (which is always the case for `some_package/example`'s dependency on `some_package`) were being overridden, causing CI to do some unnecessary duplicate analysis work.
Minor cleanup of the script to create the build-all app, mostly for Android:
- Don't override the minSdk to 21, since the Flutter-provided value is now 21 already.
- Don't enable multidex, since that isn't necessary for minSdk 20+.
- Remove camera_android_camerax from the direct dependency list, not camera_android, now that the endorsement has switched. This will return us to the previous, intended behavior of testing that both versions build together.
- If for some reason the Dart SDK isn't detected, use 3.0.0+ instead of 2.12.0+.
Imports https://github.com/dnfield/flutter_svg into this repository,
with history, and updates it to follow repository conventions:
- Updates min SDKs.
- Removes analysis options and fixes resulting warnings.
- Autoformats.
- Updates pubspecs to follow repo standard.
- Updates repo tooling to allow the `flutter_svg_test` non-dev
dependency on `flutter_test`.
- Adds repo metadata.
- Adds METADATA files.
- Adds commemoration to README.
- Updates example app Android build files to current standards.
- Bumps versions and slightly relax version constraints for
vector_graphics* to allow the new versions.
- Moves gitignore of golden test diffs into the package.
- Add missing licence headers.
- Remove analysis options fix new warnings.
- Update min SDKs.
- Autoformat.
- Update pubspecs to follow repo standard.
- Includes removing dependency overrides for inter-package path
pinning as a default state; this can be added temporarily in PRs
with repo tooling.
- Allow xml dependency, and relax the pinning requirement to allow an
explicit, inclusive-endpoint range.
- Skip tests on unsupported platforms.
- Switch vector_graphics_codec from flutter_test to test.
- Add repo metadata.
- Add commemoration to the README.
- Add AUTHORS files.
- Bump versions and slightly relax version constraints to allow the new
versions.
Now that `stable` requires AGP 7.0, which in turn requires Java 11+, we should be able to set our compatibility version to 11 (setting the min Flutter SDK version to current stable).
Also removes the gradle conditionals for setting namespace (and the repo tool checks that it is present), as that was only needed for AGP 4.1 compatibility.
Part of https://github.com/flutter/flutter/issues/156111
Several dev dependencies, most notably mockito, were only allow as exactly pinned versions, in order to avoid out-of-band breakage due to deprecations in minor version updates. Now that the policy for Flutter repos has changed to not include deprecation warnings in analysis, this is no longer an issue, so we can relax these dependencies to follow the more normal pattern of using ranges.
macOS privacy manifest enforcement is rolling out soon, so this brings all macOS plugins into alignment with our iOS policy of always having a manifest, including updating the repo tooling to enforce that.
Very few plugins are affected because most share the implementation package with iOS, and we didn't do any target platform switching when adding the manifests for iOS, automatically covering macOS as well.
Fixes https://github.com/flutter/flutter/issues/155564
Upgrades all AGP versions less than 8 to latest. The primary motivation is to prepare for https://github.com/flutter/flutter/issues/136879#issuecomment-2292073921, which requires that plugins use a non-7.3 version. We believe it only affects version 7.3 - I'm going to test this, but am not sure the exact range yet and updating is independently valuable, so I just updated all pre 8 versions (it doesn't affect 8+).
Also:
- Upgrades Gradle versions as required
- Marks the use of `Camera2Interop` with `@OptIn`, as it is required by the newer AGP version.
- Changes the Camerax example java directory path to align with the package xml attribute/AGP namespace attribute.
- Sets `android.buildFeatures.buildConfig` to true for compatibility with AGP 8.0+ in some places.
- Sets `exported=true` in a manifest, requires for AGP bump.
- Updates espresso in some examples, required by the AGP bump (0.2.0 isn't compatible with AGP 8.0+).
Also related to https://github.com/flutter/flutter/issues/146660