Until https://github.com/flutter/flutter/issues/172427 is resolved, `xcode-analyze` doesn't work as desired with SwiftPM enabled (it analyzes only the test code, not the plugin code). To avoid losing analysis coverage in the meantime, this disabled SwiftPM temporarily while running analysis.
This PR also updates `build-examples` to use the newer pubspec-based config option to set the SwiftPM flag state instead of setting global state, to avoid future issues where we are unintentionally bleeding flag changes across different tests, and to make local runs not impact developer machine state.
To unit test this functionality, this adds a new feature to the existing process mock system that allows running an arbitrary test callback at the ponit where a process is being run, which in this case allows reading the temporarily-modified pubspec contents at the right point in the command execution.
Fixes https://github.com/flutter/flutter/issues/171442
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
> [!IMPORTANT]
> **(DONE ✅ in https://github.com/flutter/flutter/pull/172384)**
> https://github.com/flutter/flutter/pull/169899 must be rolled into packages AND be in Flutter stable for this to land. I will try to cherry-pick this change into 3.32 stable once the 3.35 beta is cut.
> [!NOTE]
> Several files are not changed but simply formatted as a result of the bumped Flutter/Dart versions for `camera_android_camerax` that include https://github.com/flutter/flutter/pull/171703. I will comment on these files for clarity.
Re-lands https://github.com/flutter/packages/pull/9360.
Since timing for `Surface` requests cannot be guaranteed, request a new `Surface` from `SurfaceProducer.getSurface` each time a `Surface` is requested for rendering the camera preview to.
Fixes https://github.com/flutter/flutter/issues/155294.
Fixes https://github.com/flutter/flutter/issues/169506.
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
First attempt at an AGENTS.md file to make Jules more effective at
creating PRs.
I started with an initial draft, then iterated based on feedback from
Gemini Code Assist, taking most of its suggestions (under the theory
that it has more examples of AGENTS.md files in its model than I do),
but removing some hallucinations.
I was going to put the "Agent Environment Setup" in a separate file, so
that people could manually add it to their Jules configuration, but
Gemini found that file and thought it should be in AGENTS.md. I'm
curious to see if that will work well enough that we don't each need to
do the manual one-time configuration. If it doesn't work, we can move it
later.
🤷🏻
flutter drive for web should no longer need this workaround.
See dart-lang/sdk#60289
See flutter/flutter#170612
Add charset to some index.html files which is needed in the new DDC module system.
As of Xcode 16, `swift-format` is part of the Xcode distribution. Since CI now uses Xcode 16, we can just always use that version.
This:
- Removes the `swift-format-path` logic.
- Removes the check for `swift-format` being available
- Defaults Swift formatting to true only on macOS
- Removes the `swift-format` CIPD package from .ci.yaml
- Updates Pigeon in packages using Swift Pigeon generation to pick up a fix for a lint issue picked up by the latest version of `swift-format` (which was already fixed in Pigeon).
Fixes https://github.com/flutter/flutter/issues/153803
## Pre-Review Checklist
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Bumps the `create_all_packages_command` `compileSdk` to 36. The test targets will test against the bump.
Partially Adresses https://github.com/flutter/flutter/issues/163071
## Pre-Review Checklist
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Android builds now create .cxx directories in some cases; this has been added to the app template's ignore file, so should be ignored here as well. As is generally the case for this repo, we ignore it at the root level instead of updating every package.
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.